Topic: Text background-color extends to end of line (Page 1 of 1) |
|
---|---|
Obsessive-Compulsive (I) Inmate From: Here, there and everywhere |
posted 06-13-2005 18:44
I'm using the following CSS code to highlight some text: code: pre {font-family: Courier New, Courier, monospace; color: #222; background-color: #4ad}
|
Maniac (V) Inmate From: under the bed |
posted 06-13-2005 20:12 |
Paranoid (IV) Inmate From: London |
posted 06-14-2005 02:02
Or use a span element around your text, assuming pre isn't of importance to your message...[code]The pre element defines preformatted text. The text enclosed in the pre element usually preserves spaces and line breaks. The text renders in a fixed-pitch font.[/code/Well from yuor example you can't judge much, but regardless use the right tool for the job, if you want inline results use an inline elment, here it would seem that Span mihgt do, DL-44 might correct me on this... |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 06-14-2005 02:27
Are you sure that the <pre> tag is the right thing to be using here? <pre> should be used for preformatted text, but if you don't *want* preformatting (that is, you want automatic formatting so the text is inline with other text), then you shouldn't use <pre>. |
Maniac (V) Inmate From: under the bed |
posted 06-14-2005 04:41
Yeah, I was hoping danaan would offer up what the usage here is...as pre is most likely not the right choice (though that is not necessarily true. |
Obsessive-Compulsive (I) Inmate From: Here, there and everywhere |
posted 06-14-2005 13:10
I'm using the <pre> tag for code, so I might use a CSS class instead, or the <code> tag, which I didn't know about before. |
Maniac (V) Inmate From: under the bed |
posted 06-15-2005 19:16
In that case, Slime's suggestion is what you need. |
Maniac (V) Mad Scientist From: :morF |
posted 06-16-2005 15:50
I would suggest using <code> for your code blocks then. Never hurts to be semantic in your markup. |