Benjamin Hawkes-Lewis wrote:
> On 22/5/09 12:49, PJ wrote:
>> Sorry, but no one suggested a mailing list for CSS and the W3 Schools
>> Forum has problems.
> Actually, I did:
My apologies... wasn't at the top of my attention at that point. :-[
>> Why do I get completely different formatting with two identical classes?
>> I want to change part of the formatting on just one page on the site
>> using the exact same class with some changes so I don't modify other
>> pages. I copied div#frame to div#frame1 and changed the class on the
>> page to id="frame1". But now the page no longer displays the formatting
>> as with id="frame" - e.g.<p>  produces 16px font-size instead of 12px.
> This description is confusing. Can you please link to a minimal test
> case showing the problem you're talking about, so that we can view
> your code and ideally probe it with DOM inspectors like Firebug?
Ok, I have duplicate classes - #frame and #frame1.
What I don't understand is why switching from #frame to #frame1 should
change formatting. The two classes are absolutely the same, the only
difference is the "1" in the name. I would logically assume that the
interpreter or whoever is operating this stuff would understand that the
page is using a different class, whether it is the same name as another
or not. If I create still another class and start to format the various
sections of that class, I will wind up with the identical class as
#frame1.  So where is the logic here? This is utterly incomprehesible
and seems to the the typical mess that we find in using CSS. It seems to
me that what I am trying to do is logically and intuitively clear and
I think you can see the implications of such confusion in creating a
different class - how can I rely on it doing what one would expect?
> may help you produce one.
> In general, I'd suggest creating page-specific style variations by
> sticking a class on the body (e.g. <body class="article"> ) and using
> that as a hook to modify the styling of the class whose formatting you
> want to be different.
> .thing {
>     font-weight: bold;
> }
> .article .thing {
>     font-style: italic;
> }
> for example.
> -- 
> Benjamin Hawkers-Lewis

Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
Phil Jourdan ---

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to