Re: urgent CSS question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ashley Sheridan wrote:
> On Fri, 2009-05-22 at 12:59 +0100, 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:
>>
>> http://www.css-discuss.org/
>>
>>     
>>> 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.
>>>       
I don't understand how this could be simpler: first, it's and id and not
a class. The only difference is the number 1 in the name of the second
id which is a carbon copy of the first. Same parents, same inheritance,
same children.  Firebug does not indicate anything that helps. I don't
see the need to go through hell setting up some theoretical setup that
in the end will produce the same thing that I already have in a actual
situation. Nothing is change in the layout of the css id (only a
different name) and no change in the script. So why the discrepancy?
>> 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?
>>
>> http://webkit.org/quality/reduction.html
>>
>> 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
>>
>>     
> That hook on the body tag is a good one, which I wish I'd thought of a
> few weeks back! I've been using PHP to pull in external stylesheets
> based on the current script name for a project I'm working on, as each
> page has unique tweaks on common elements. It's not like I don't even
> use selectors even now!
>
>
> Ash
> www.ashleysheridan.co.uk
>
>
>   


-- 
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- pj@xxxxxxxxxxxxx
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux