- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › CSS FILE Question … if I have a page that doesn’t need ALL the CSS as rest of site?
Thank you for the help. I have a general .CSS that is controlling most of my site. If on one page, I want one of the DIV tags to ignore one of it’s attributes, specifically a padding-top; does that page need it’s own CSS file, or can I place in the header an ‘over riding” line of code? Hope this make sense. Thanks in advance.
@hendrix940 Nope. If you’re using WordPress, target the body ID along with the div class/ID and set the padding-top to 0. If you’re not using WordPress, just declare a body ID and go from there.
Example
/*
#about represents the body ID
.information represents the div class
*/
#about .information {padding-top: 0;}
Chris, so writing it like that, then on the ‘about’ page, the padding-top will be set to zero, in the information div, over ridding whatever the padding-top value is on the information div, correct?
And I would add the above code into the header of the page, is that right? Or would I add this code into my CSS file? Thanks.
@hendrix940 Yes it will override as long as it is below the CSS code that is applied to the div on all the pages. Put it in your CSS file.
Add it to your CSS file…it would be the easiest way and you can’t forget about it.