|
|
|
|
Thread title: Override CSS |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
06-11-2008, 04:43 AM
|
#1
|
Status: Jakowenko.com
Join date: Jun 2005
Location: Michigan
Expertise:
Software:
Posts: 2,199
|
Override CSS
I have this in my css file,
Code:
h1,h2,h3,ul,p,li{
margin: 0; padding: 0;
}
And I want to no how to override it for a certain div.
I already tried something like.
Code:
#div h1,h2,h3,ul,p,li{
margin: 5; padding: 5;
}
But no luck.
|
|
06-11-2008, 05:02 AM
|
#2
|
Status: Member
Join date: Oct 2006
Location: Australia
Expertise:
Software:
Posts: 297
|
Originally Posted by Jako
I have this in my css file,
Code:
h1,h2,h3,ul,p,li{
margin: 0; padding: 0;
}
And I want to no how to override it for a certain div.
I already tried something like.
Code:
#div h1,h2,h3,ul,p,li{
margin: 5; padding: 5;
}
But no luck.
|
#div h1, #div h2
Putting h2,h3,ul just overrides the defaults
|
|
06-11-2008, 05:07 AM
|
#3
|
Status: Waving
Join date: Aug 2005
Location:
Expertise:
Software:
Posts: 2,694
|
Also check the "5" it should be "5px", or "5em".
Or you can use !important, if it doesn't seem to work.
so, margin: 5px !important;
|
|
06-11-2008, 02:46 PM
|
#4
|
Status: I'm new around here
Join date: Jun 2008
Location: New York, NY
Expertise:
Software:
Posts: 11
|
Also check to see what #div is. To css #div means something with id="div" if you want to just change something for one div, add a special id do it id="special" for example and then change the css to:
HTML Code:
#special h1, #special h2, #special h3...(etc){
margin:0;
padding:0;
}
|
|
06-12-2008, 04:30 PM
|
#5
|
Status: Member
Join date: Jul 2006
Location: soundwave.
Expertise:
Software:
Posts: 379
|
Yup. Define the div and each of the sub contents
HTML Code:
#div h1, #div h2, #div h3 etc.
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|