значения свойства:
* {
margin
:
0
;
padding
}
.wrapper {
width
900px
height
150px
10px
auto
border
1px
solid
#808080
.a {
margin-left
#div
1
, .a, .b {
300px
50px
background-color
#7092BE
* { margin: 0; padding: 0; } .wrapper { width: 900px; height: 150px; margin: 10px auto; border: 1px solid #808080; } .a { margin-left: 10px; } #div1, .a, .b { 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
"wrapper"
"a"
id
"div1"
"b"
/*JavaScript*/
document.getElementById("div1").style.marginLeft = "15px";
/*jQuery*/
$(document).ready(function () {
$(".b").css({ "margin-left": "20px" });
});