From: David Dorward on
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.

In an HTML document all text has to be contained by /some/ element. Apply
the style to that element.


--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
From: Beauregard T. Shagnasty on
Jukka K. Korpela wrote:

> 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.

Of course. But you knew that, and so do I.

--
-bts
-Motorcycles defy gravity; cars just suck.
From: Patrick Sullivan on
Andy is right, look at <span>, it's the inline method to contain styling.

--

Patrick Sullivan, AA-BA, BA-IT

"Michael Bulatovich" <Please(a)dont.try> wrote in message
news:edshm80kno(a)news2.newsguy.com...
> 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: Spartanicus on
"Beauregard T. Shagnasty" <a.nony.mous(a)example.invalid> 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.

Indeed.

>If you describe the circumstance, some advice could be given. Such as
>"put it in a <div> ..."

But "some .. element" should be "some semantic element", that excludes
<div>.

--
Spartanicus
From: Jukka K. Korpela on
Spartanicus <invalid(a)invalid.invalid> scripsit:

>> If you describe the circumstance, some advice could be given. Such as
>> "put it in a <div> ..."
>
> But "some .. element" should be "some semantic element", that excludes
> <div>.

Should it? Even under the circumstances that HTML has a rather limited
repertoire of semantic elements? Quite often, the choice is between a
non-semantic element (<div> or <span>) and a semantically _wrong_ element,
such as abusing <p> for something that ain't no paragraph.

From the CSS viewpoint, using semantically wrong elements has the practical
drawback that they may come with default property values that have been
designed with the correct semantics in mind. If you use <p> for
representing, say, a short copyright notice (<p>&copy; 2006 John Doe</p>),
you have to worry about the default top and bottom margin, or perhaps
default padding. Using <div>, you can pretty safely expect no default
rendering specialties: the <div> element is rendered as a block, normally
with no margins or padding. (The HTML specifications even say this
relatively clearly, though not explicitly in CSS terms.) So you can just
start _adding_ the styling you wish.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7
Prev: textarea wrap
Next: Image and Text Side By Side