CNT
02-27-2017, 04:41 PM
"margin: 10px 20px 30px 40px;" means 10px on top (and as in "margin-top"), 20px on right ("margin-right"), 30px on bottom ("margin-bottom"), and 40px on left ("margin-left")
"margin: 20px;" means all margins is 20px
"margin: auto;" means what?
and default is "margin: 0;" really?
"padding" is SAME THING as "margin"?
"position: absolute; left: -8px;" (I don't want to use this and even that does NOT do it right anyways).
I am asking this because even I set "margin: 0px;", the text still NOT butt to the edge of browser. "padding" doesn't do. "border" doesn't either. A long time ago, I saw a website that has a diagram of all those "edge" along CSS Properties, does anyone know of this website (better seeing it then wording it).
Gotta ask... Example, in beginning, set all defaults (as in below), then I want to make sure my nav is 8px from left and top ("margin: 8px 0px 0px 8px;"), will this effect the body default (for remain coding after nav)? The point is I am struggling with nav positioning (8px to be exact in all compatible browsers).
body{
margin: 0;
padding: 0;
border: 0;
}
.nav ul {
margin: 8px 0px 0px 8px;
padding: 0;
}
While at this subject, where can I find browser's defaults? Is there a link that displays all defaults for each major browsers? Would those CSS default mean same thing as browser default (in other words, whatever browser default is, the CSS default follows it)? Does browser "margin" means same thing as CSS "margin"?
OT: should nav be ID or class?
Once I understand this, then hopefully I will see what's all wrong with my case with localhost and webhost.
"margin: 20px;" means all margins is 20px
"margin: auto;" means what?
and default is "margin: 0;" really?
"padding" is SAME THING as "margin"?
"position: absolute; left: -8px;" (I don't want to use this and even that does NOT do it right anyways).
I am asking this because even I set "margin: 0px;", the text still NOT butt to the edge of browser. "padding" doesn't do. "border" doesn't either. A long time ago, I saw a website that has a diagram of all those "edge" along CSS Properties, does anyone know of this website (better seeing it then wording it).
Gotta ask... Example, in beginning, set all defaults (as in below), then I want to make sure my nav is 8px from left and top ("margin: 8px 0px 0px 8px;"), will this effect the body default (for remain coding after nav)? The point is I am struggling with nav positioning (8px to be exact in all compatible browsers).
body{
margin: 0;
padding: 0;
border: 0;
}
.nav ul {
margin: 8px 0px 0px 8px;
padding: 0;
}
While at this subject, where can I find browser's defaults? Is there a link that displays all defaults for each major browsers? Would those CSS default mean same thing as browser default (in other words, whatever browser default is, the CSS default follows it)? Does browser "margin" means same thing as CSS "margin"?
OT: should nav be ID or class?
Once I understand this, then hopefully I will see what's all wrong with my case with localhost and webhost.