Guest geedub Posted July 8, 2009 Report Share Posted July 8, 2009 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 More sharing options...
dsonesuk Posted July 8, 2009 Report Share Posted July 8, 2009 (edited) 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 July 8, 2009 by dsonesuk Link to comment Share on other sites More sharing options...
uwspstar Posted July 9, 2009 Report Share Posted July 9, 2009 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 More sharing options...
dsonesuk Posted July 9, 2009 Report Share Posted July 9, 2009 (edited) yes! good for spotting that. Edited July 9, 2009 by dsonesuk Link to comment Share on other sites More sharing options...
jmcgriff60 Posted July 26, 2009 Report Share Posted July 26, 2009 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 More sharing options...
dsonesuk Posted July 26, 2009 Report Share Posted July 26, 2009 R.G.B should be 0 to 255, 0,0,0 is black, and 255, 255, 255 is white Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now