Jump to content

classes - mind boggling


envexlabs

Recommended Posts

Hey,

 

I have a piece of PHP code that is rendering out even and odd classes.

 

this is exactly what the code is outputting:

 

<div class="one"id="233">Once</div>
<div class="two"id="235">Two</div>
<div class="one"id="234">One</div>        

 

The css code is as follows, and it's at the bottom of the css page, so i know nothing is being overwritten:

 

.one{
    background: red;
    font: 3em/1em helvetica, arial, sans-serif; 
}

.two{
    background: white;
    font: 1.4em/1em helvetica, arial, sans-serif;
    border-top: 1px solid #efefef;
    padding: 7px 0 7px 5px; 
}

 

Only the div with class="two" is being effected by the css, the other div="one" is plain.

 

I've gotten the other web designer to take a look at it, and we can't figure it out to save our lives :P

Link to comment
https://forums.phpfreaks.com/topic/68248-classes-mind-boggling/
Share on other sites

No way to help for sure if we don't know what the rest of your CSS and (X)HTML are doing. Sounds possibly like a problem with specificity, try adding this to your CSS:

 

.one {font: 3em/1em helvetica, arial, sans-serif !important; background: red !important;}

 

If it "fixes the problem" then you have a specificity issue...you will have to resolve it. Don't resort to using !important.

If it doesn't make a difference then I don't know what could be wrong without seeing more code.

 

Also, you need to put a space between class and id in your markup:

 

<div class="one"id="233">

should be

<div class="one" id="233">

Link to comment
https://forums.phpfreaks.com/topic/68248-classes-mind-boggling/#findComment-343337
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.