On 11/24/10 12:33 PM, "Rory Bernstein" <r...@rorybernstein.com> wrote:

>Thanks, John. That would be a great solution for most cases, but I need
>to NOT have a span that wraps around the bigger text. No extra markup
>other than the <p> tags. I need the CSS (perhaps with the help of
>javascript?) to pick out X words, and style them bigger (of course I
>would write a style for that). The css would be like "add class .bigger"
>to the first X words of this paragraph" and then there would be a
>"bigger" class that gets used.
>
>
>> I did that with <span>, where you surround your lead-in text with span
>>and define your class in your style sheets, like this:
>> 
>> <p><span class="firstline">Here is the lead in sentance.</span>
>> Here is the rest of the paragraph. Here is the rest of the paragraph.
>>Here is the rest of the paragraph. Here is the rest of the paragraph.
>>Here is the rest of the paragraph. Here is the rest of the paragraph.
>></p>
>> 
>> .firstline {
>>     font-size: 150%;
>>     font-weight: bolder;
>> }
>> 
>> John


You can't put something like add class into CSS. What you will need to do
is like what John is saying.
However you don't need to hard code it.

You can add the <span> tags dynamically on load with a javascript
function. 

______________________________________________________________________
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