значения свойства:
.a {
width
:
300px
;
height
150px
background-color
#3BA9DE
}
#div
1
{
#56A31D
.b {
#852E76
.a { width: 300px; height: 150px; background-color: #3BA9DE; } #div1 { height: 150px; background-color: #56A31D; } .b { height: 150px; background-color: #852E76; }
<!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"
br
id
"div1"
"b"
/*JavaScript*/
document.getElementById("div1").style.width = "300px";
/*jQuery*/
$(document).ready(function () {
$(".b").css("width", "300px");
});