《css笔记(Css笔记)》由会员分享,可在线阅读,更多相关《css笔记(Css笔记)(12页珍藏版)》请在金锄头文库上搜索。
1、css笔记(Css笔记)css笔记(Css笔记) CSS style sheet Defined format: 1, in the CSS stylesheet 2, create a new CSS file, write the CSS style sheet sequence in the file, and then in the page by this command to introduce CSS Style definition format: 1, label name The style property 1: value 1; The style property 2
2、: value 2; . * the label name here refers to the basic HTML element. For example, (P, table, div, span, DL, DD, DT, IMG, etc.) 2. Class name The style property 1: value 1; The style property 2: value 2; . * you can first specify which class the object will use, and then set the style to the class. W
3、hen calling a style, you must use the class= class name 3, #ID name The style property 1: value 1; The style property 2: value 2; . * you can first set the object using which ID, and then set the style to the ID. When calling a style, you must use the form of the ID=ID name CSS style standard proper
4、ties: First, font modification related 1, font sequence Format: font-family: font sequence; For example: font-family: bold, italics, arial; 2, font size Format: font-size: font value; For example: font-size:20px; / * * / font size of 20 pixels Font-size:5in; / * * / font size 5 inches Font-size:12pt
5、; / * * / font size of 12 pounds Font-size:5cm; / * * / font size 5 cm Font-size:40mm; / * * / font size 40 mm Font-size:150%; 150%*/ / * font size for the original size Font-size:0.8em; 80%*/ / * font size for the original size 3, font bold Format: font-weight: style; For example: font-weight:bold;
6、 / * * /. Font-weight:normal; / * * / as normal 4, font tilt Format: font-style: style; For example: font-style:italic; / * * / tilt Font-style:normal; / * * / as normal 5, font size Format: text-transform: style; For example: text-transform:uppercase; / * * / all caps All lowercase text-transform:l
7、owercase; / * * / Text-transform:capitalize; / * * / initials Text-transform:none; / * * / cancel case conversion 6, row height Format: line-height: row high value; For example: line-height:25px; / * will be set to 25 pixels high. * this property can also set Px, in, Pt, cm, mm, EM, and percentages
8、7, color Format: color: color values; For example: color:red; / * * / red Color:#00ff00; / * * / for green Color:rgb (0,0255); / * * / to blue Color:rgb (100%, 100%, 100%) / * * / as white 8, font decoration Format: text-decoration: modify effect; For example: text-decoration:underline; / * * /. Tex
9、t-decoration:overline; / * * / D Text-decoration:line-through; / * * / delete line Text-decoration:underline overline; / * * /. Text-decoration:none; / * * / without any modification Two, background related 1 background color Format: background-color: color values; * use method with color attribute
10、2. Background image Format: background-image:url (background file); Example: background-image:url (bg1.jpg); 3, background map repeat Format: background-repeat: attribute value; For example: background-repeat:no-repeat; / * * / A, not repeat Background-repeat:repeat-x; / * * / horizontal background
11、repeat Background-repeat:repeat-y; / * * / longitudinal repeat background Background-repeat:repeat; / * * / background repeat 4, background map position Format: background-position: location; Position: on -top, under -bottom, -center Left, -left, right, -right, -center For example: background-positi
12、on:left top; / * * / the upper left corner of the background Background-position:center center; / * * / background Center Background-position:center bottom; / * * / lower background Background-position:30px 100px; / * level 30 vertical 100*/ Background-position:10% 40%; / * level 10% vertical 40%*/
13、5, background fixed Format: background-attachment: property; For example: background-attachment:fixed; / * * / fixed background Background-attachment:scroll; / * * / background picture scroll Three, block 1, word spacing Format: word-spacing: value; For example: word-spacing:20px; / * the word dista
14、nce is 20px*/ 2, letter spacing Format: letter-spacing: value; For example: letter-spacing:5px; / * the letter spacing is set to 5px*/ 3, text alignment Format: text-align: alignment; For example: text-align:left; / * * / text to the left Text-align:center; / * * / text to the center Text-align:righ
15、t; / * * / text is right aligned 4, vertical alignment Format: vertical-align: alignment; For example: vertical-align:top; / * * / alignment settings Vertical-align:bottom; / * * / alignment settings Vertical-align:middle; / * * / set justifycenter 5, text indentation Format: text-indent: text indent value; For example: text-indent:30px; / * * / text right indent 30px; Text-indent:-3cm; / * * / text left indent 3cm; Four, border