java-Front-end CSS

Source: Internet
Author: User

CSS style:
<!--inline styles: Write styles within the style property of an element-

<!--internal styles: Write styles in the Style tab inside the head--
<style type= "Text/css" >
/*css's comments are like this.
H2{color:blue;}
</style>
<!--external styles: Write style inside a standalone CSS file the href is the path to the CSS file--
<link rel= "stylesheet" href= "My.css"/>
CSS style rules:
1. Inheritance, some styles of parent element (font, color) can be inherited by a quilt element
2. Cascade: Add different declarations to an element, and the effect will be superimposed
3. Priority: To add the same statement to an element, the effect of the future, also known as the nearest principle.
CSS class selector:
/*1. Element Selector */
/*2. Class Selector: Select a class of elements based on the class attribute */
. Female{color:pink;}
/*3.id selector: Select a unique element based on the id attribute */
#where {color:lime;font-size:20px;}
/*4. Selector group: Write out a set of selectors, you can select the corresponding set of each selector */
. Female, #where {font-weight:bold;}
/*5. Derivation selector: */
/*1) Select the descendants of an element */
#p5 b {color:orange;}
/*2) Select the son of an element */
#p5 >b{font-size:100px;}
P a{font-size:50px;}
/*6. Pseudo-Class selector: Select an element in a state */
/*1) Select a hyperlink that has not been visited */
a:link {color:green;}
/*2) Select a hyperlink that has already been visited */
a:visited {color:red;}
/*3) Select the button for activating the state */
. btn:active {background:red;}
/*4) Select the box with focus */
. Txt:focus{background-color:yellow;}
/*5) Select Hover Status */
. btn:hover {color:gray;width:50px;}
img:hover{width:250px;height:250px;}
CSS Border--border:
/*1. Give the title a single border */
h1{border-left:15px Solid blue;border-right:15px Solid red;border-bottom:15px solid yellow;border-top:15px Solid Green ;}
/*2. Add a border at the same time to a paragraph */
p{border:1px dashed Red;width:auto;height:60px;overflow:auto;}
Day03
/*1. Four sides set the same margin */
#d1 {padding:20px;margin:40px;}
/*2. Four sides set different margins--order is upper right bottom left */
#d2 {padding:10px 20px 30px 40px;margin:10px 20px 30px 40px;}
/*3. Side Set Margin */
#d3 {padding-top:20px;margin-left:30px;}
/*4. Symmetrical set margin--left and right after space
#d4 {padding:20px 40px;margin:50px 70px;}
/*5. A special case of symmetry setting: When the left and right margins are set to auto, the elements are centered horizontally/
#d5 {margin:20px Auto;}

I am a beginner, if the update is not good, welcome the Great God pointed out, thank you!

More exciting after the update, reprinted annotated!

java-Front-end CSS

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.