Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Wordpress - Highlighting Code
Old 06-12-2010, 03:10 AM Wordpress - Highlighting Code
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
I have a problem when my plugin for Wordpress highlights my code. Theres not enough space in the line for the text so its hidden and your able to scroll and see it. I would like the white block to cover the length of the text but it stops. Any ideas?

Link: http://www.benwebdeveloper.com/2010/...-website-icon/

CSS:
Code:
.wp_syntax {
  color: #100;
  background-color: #f9f9f9;
  border: 1px solid silver;
  margin: 0 0 1.5em 0;
  overflow: auto;
}

/* IE FIX */
.wp_syntax {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: expression(this.scrollWidth > this.offsetWidth ? 15 : 0);
  width: 100%;
}

.wp_syntax table {
  border-collapse: collapse;
}

.wp_syntax div, .wp_syntax td {
  vertical-align: top;
  padding: 2px 4px;
}

.wp_syntax .line_numbers {
  text-align: right;
  background-color: #def;
  color: gray;
  overflow: visible;
}

/* potential overrides for other styles */
.wp_syntax pre {
  margin: 0;
  width: auto;
  float: none;
  clear: none;
  overflow: visible;    
  font-size: 12px;
  line-height: 1.333;
  white-space: pre;
}
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
 
Register now for full access!
Old 06-12-2010, 08:24 AM Re: Wordpress - Highlighting Code
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
remove overfow: hidden; & overflow: auto;
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-12-2010, 08:28 AM Re: Wordpress - Highlighting Code
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
I have done that now but the white space still doesnt cover all the text.
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
Old 06-12-2010, 09:22 AM Re: Wordpress - Highlighting Code
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Code:
.wp_syntax {
  color: #100;
  background-color: #f9f9f9;
  border: 1px solid silver;
  margin: 0 0 1.5em 0;
  overflow: auto;
}
is where the scroll comes from.

And the code is a mess of nested element which there is no need for at all
A <pre> with a class that doesn't appear to exist (.html) and inline style added. Wrapped in a div with another class that doesn't appear in the style sheets (.code) all inside ANOTHER <div> (.wp_syntax)

HTML Code:
<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;SHORTCUT ICON&quot; href=&quot;http://www.yourdomain.com/path/favicon.ico&quot;/&gt;</pre></div></div>
There is two elements too many in that lot and THAT is what is causing the problem.
the background is filling the parent but because no rules apply to the children they simply take up the defaults.

Either rewrite the "pugin" to produce better code or add classes for .html and .code with a background-colour of transparent specified
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Wordpress - Highlighting Code
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.57944 seconds with 12 queries