Jump to content

Css Body Margin And Padding '*'


Guest geedub
 Share

Recommended Posts

Guest geedub

I have a site I am building and got the wrapper div source code from the original site I am redesigning but at the beginning of the style sheet I have this style and I dont know what it refers to I only know that it sets the margin and padding to zero * { margin: 0; padding: 0; background-color:02112e; }body { background-position:top; background-image: url(images/bg.jpg); background-repeat:repeat-x; background-color:02112e; }this is the top two style could anyone tell me what the * refers to ?

Link to comment
Share on other sites

its an universal selector, most, if not all, element types are assigned its css declaration.*{margin:0; padding: 0;}will set all elements divs, p etc margins, and padding to zero.paragraph margin will have no margin, and will look like normal text, so you will have to reset the paragraphs margins.this might be a good thing, as paragraph margins are rendered differently, when you compare IE to say Firefox paragraphs. So by setting the margins for the paragraphs yourself, they will now look the same.

Edited by dsonesuk
Link to comment
Share on other sites

I have a site I am building and got the wrapper div source code from the original site I am redesigning but at the beginning of the style sheet I have this style and I dont know what it refers to I only know that it sets the margin and padding to zero * { margin: 0; padding: 0; background-color:02112e; }body { background-position:top; background-image: url(images/bg.jpg); background-repeat:repeat-x; background-color:02112e; }this is the top two style could anyone tell me what the * refers to ?
the books said that the CSS wildcard (*) Select to target all elements in an HTML document.another question, do you need to use # in the background-color:#02112e; ???
Link to comment
Share on other sites

  • 3 weeks later...

When specifying colors, you can do it three ways.(1) Color code, in hexadecimal. This is six characters, 0-9 or A-F, two each for red, green, and blue, preceded by # to specify that it is hex. background-color:#FF0000 will be red.(2) Color code, in RGB. Decimal rgb values, 0-127, like this: background-color:rgb(127,0,0)(3) Color name. i.e., background-color:red. W3schools has a list of the names, but only a few are well standardized.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...