[thelist] Issue with formatting paragraph

M. Seyon evoltlist at delime.com
Wed Mar 9 15:44:45 CST 2005

Message from Jim Mortland (3/9/2005 03:21 PM)
>I'm working on updating my company's web site to a table-less layout.
>One problem I have run into occurs on this page:
>http://www.psychologicalscience.org/beta/apssc/.  In the 2nd paragraph
>under Hotel Match-Up Program, I have this code:
><p class="small">The deadline for this program is March 31,
>The CSS I have to format the small class is:
>.small, .summary {font-size: 95%;}

Here's my take on the problem. I don't agree with ben morrison - !important 
should NEVER be used for something as trivial as this. If you ever find 
yourself needing to resort to !important to whack your CSS into shape, it's 
most likely because you've done something poorly in the first place.

He's right that the cascade is the problem though.

<p class="small">blah blah blah</p> renders at 95% of the body font.
<p class="small"><span class="summary">blah blah blah</span></p> is 
rendering at 95% of the size of the 'small' class font. 95% of 95% of the 
body font, in other words.

Why do you need this to do this?

Why not
.regulartext { font-size: 95%;}
.fineprint (font-size: 80%;}

<p class="regulartext">Blah blah blah</p> -  This will render at the 
regular size
<p class="fineprint">by the way, blah blah blah</p> - This will render smaller

You're using way, way, WAY too many spans in your markup. Why isn't 
<p><span class="label"> an h3 or h4 instead? It's a heading isn't it?

Why are you creating spans as the only content within the P? Just define a 
separate class for the P.

>I've validated the CSS and HTML to see if there were any errors that
>would affect the display, but none were found.

The validator can catch syntax problems. Unfortunately it doesn't catch 
logical problems. Your problem isn't your syntax. It's that you've failed 
to logically structure your document.


Trinidad Carnival in all its photographic glory. Playyuhself.com

More information about the thelist mailing list