- One, div+css with the use of
Now the foreground effect is getting more and more dazzling, especially some e-commerce or portals, many of which do not use the original HTML to control the layout of the page, are used div+css.
First of all, give an example of how to use DIV+CSS to control the layout of the page, a simple understanding of the next is good, these are not what we do.
Integrated use of <HTML><HEAD><TITLE>CSS: Div+css</title><style type= "Text/css" > #head {height:15 %;background-color:blue;padding:5px;} #body {Height:75%;background-color:gray;} #left {width:15%;height:100%;background-color:red;float:left;} #main {width:85%;height:100%;background-color:green;float:right;} #foot {height:10%;background-color:orange;padding:5px;} </style>
- Second, how to modify the CSS style in the script, just 2 steps
1, get to the target element where CSS styles need to be set
2, modify the CSS style of the target element, there are two common ways:
Modifies an inline CSS property value, such as: Obj.style. Property Name = property value
Modify the class attribute of the HTML element, for example: Obj.classname=class selector
It is important to note that the CSS property name in the script is not exactly the same as the static CSS property name in the page.
The CSS property name in the script is stripped of (-) from the original static CSS property, and the first letter is lowercase, and the first letter of each word is capitalized. For example, the static CSS property name is Background-color, and the property name in the corresponding script is backgroundcolor. If the original static CSS property does not contain (-), the CSS property name in the script is the same as the original static CSS property name.
css--Supplement