Basic CSS syntax (2)_html/css_WEB-ITnose
CSS basic syntax (2)
1. Text font attributes
1. Text attributes: line-height, text-align, letter-spacing, text -decoration, white-space
2. Font attributes: font, font-family, font-size, font-weight
1 <html> 2 <head> 3 <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/> 4 <style type = "text/css"> 5 li{ 6 font: 15px 宋体; 7 text-align: left; 8 line-height: 28px; 9 }10 .title{11 letter-spacing:5px;12 white-space: nowrap;13 text-decoration:underline;14 }15 .bigfont{16 font-size:16px;17 color:red;18 }19 </style>20 </head>21 <body>22 <div>23 <ul>24 <li class="title">CSS基本语法(2)</li>25 <li class="bigfont">坚持不懈,努力学习CSS基本语法,为成为css高手而奋斗!</li>26 <li>CSS的文本属性</li>27 <li class="bigfont">学习CSS的下一步,是要更努力的学习javascript!</li>28 <li>CSS的字体属性</li>29 </ul>30 </div>31 </body>32 </html>
2. Background attributes
Background attribute parameters: background, background-color, background-img, background-repeat, background-position
1. background-repeat attribute Value:
repeat Tile horizontally and vertically at the same time, default value
repeat-x Tile horizontally
repeat-y Tile vertically
no -repeat The background image is not repeatedly tiled
2. The value of the background-position attribute
Xpos Ypos X represents the horizontal direction Y represents the vertical direction (positive value represents positive offset, while Down to left; negative value means reverse offset, while upward to right)
X% Y% Use percentage to indicate the position where the background appears (30% 50% vertically centered, horizontal offset 30%)
3. Common attributes of lists
1 <html> 2 <head> 3 <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/> 4 <style type = "text/css"> 5 div{ 6 background:url(img/test.jpg) no-repeat; 7 background-position:-100px 0px; 8 } 9 </style>10 </head>11 <body>12 <div>13 <h3>this is a test of background !</h3>14 <h3>this is a test of background !</h3>15 <h3>this is a test of background !</h3>16 <h3>this is a test of background !</h3>17 <h3>this is a test of background !</h3>18 <h3>this is a test of background !</h3>19 </div>20 </body>21 </html>
none No modifier
disc Number
2. float attribute Used to define the floating direction of the element.
Keep going a little further every day, come on!
1 <html> 2 <head> 3 <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/> 4 <style type = "text/css"> 5 li{ 6 width:150px; 7 color:red; 8 font:28px; 9 list-style:none;10 float:right;11 }12 </style>13 </head>14 <body>15 <div>16 <ul>17 <li>铅笔</li>18 <li>钢笔</li>19 <li>水笔</li>20 <li>毛笔</li>21 <li>画笔</li>22 </ul>23 </div>24 </body>25 </html>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.
