css--Supplement

Source: Internet
Author: User

    • 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.