Divya Manian wrote:

> You can try using :first-line [1]. Probably use a <br/> to separate
> the lines? Not sure if it will work though (Certainly not semantic!).

It would work technically well (:first-line has been in CSS since CSS 1.0 
and is widely supported), but introducing an extra line break would be an 
odd way to deal with bolding. Moreover, in that approach, the colon ":" 
after the word would get styled too, and the question was about styling the 
first word only.

Besides, if you can and wish to add extra markup, you might just as well 
introduce <b> or <strong> (or some other inline element, to be styled), and 
then you would not need to create an extra line break.

No pure CSS solution (i.e. an approach that does not require any added 
markup to separate the first line from the rest of the content) is possible.

If you can affect the JavaScript code for the page, then you could probably 
write a relatively simple piece of JavaScript that traverses the document, 
modifies the structure by adding elements for the first words, and assigns 
style properties to them as desired.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 

______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to