Prev: textarea wrap
Next: Image and Text Side By Side
From: Michael Bulatovich on 8 Sep 2006 15:52 Is there a way to use CSS to format "plain" text in an html document. By plain I mean text which is not contained by <p> or <h#> tags. Is there no way to control how this stuff is rendered? tia
From: Beauregard T. Shagnasty on 8 Sep 2006 16:35 Michael Bulatovich wrote: > Is there a way to use CSS to format "plain" text in an html document. By > plain I mean text which is not contained by <p> or <h#> tags. If you are using a Strict DOCTYPE, there should be no text outside of .. some .. element. Transitional will let you get away with it, but it is poor practice to do so. You lose semantic meaning if you do that. > Is there no way to control how this stuff is rendered? If you describe the circumstance, some advice could be given. Such as "put it in a <div> ..." Got a sample page? -- -bts -Motorcycles defy gravity; cars just suck.
From: Andy Dingley on 8 Sep 2006 16:40 Michael Bulatovich wrote: > Is there a way to use CSS to format "plain" text in an html document. CSS can format it, but it'll all be formatted the same. The scope of CSS is selected (by and large) at the boundaries of these elements. > Is there no way to control how this stuff is rendered? Look into using the <span> element, or read any tutorial on CSS
From: Brendan Gillatt on 8 Sep 2006 16:59 Michael Bulatovich wrote: > Is there a way to use CSS to format "plain" text in an html document. By > plain I mean text which is not contained by <p> or <h#> tags. > > Is there no way to control how this stuff is rendered? I mostly use the body element to change page wide things for text as all your text should definitely be in there!
From: Jukka K. Korpela on 8 Sep 2006 17:20
Beauregard T. Shagnasty <a.nony.mous(a)example.invalid> scripsit: > If you are using a Strict DOCTYPE, there should be no text outside of > .. some .. element. Even if you use a Transitional DOCTYPE, there is no content text outside of some element, since everything is at least inside the <body> element. (Some early CSS implementations failed to apply style sheet rules to that element when the _tag_ <body> was missing, but this was definitely an error - the element is there even if the tags aren't - and shouldn't be a problem these days, and never was if you use explicit <body> and </body> tags.) -- Jukka K. Korpela ("Yucca") http://www.cs.tut.fi/~jkorpela/ |