значения свойства:
* {
margin
:
0
;
padding
}
.a {
width
900px
height
50px
background-color
#7092BE
5px
auto
.wrapper {
100px
border
1px
solid
#808080
#div
1
, .b, .c {
300px
* { margin: 0; padding: 0; } .a { width: 900px; height: 50px; background-color: #7092BE; margin: 5px auto; } .wrapper { width: 900px; height: 100px; margin: 5px auto; border: 1px solid #808080; } #div1, .b, .c { width: 300px; height: 50px; background-color: #7092BE; }
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
link
href
"css/style.css"
rel
"stylesheet"
script
type
"text/javascript"
src
"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
></
</
body
div
class
"a"
"wrapper"
id
"div1"
"b"
"c"
/*JavaScript*/
document.getElementById("div1").style.margin = "10px 20px 15px 5px";
/*jQuery*/
$(document).ready(function () {
$(".b").css({ "margin": "10px 20px" });
$(".c").css({ "margin": "10px auto" });
});