Use Web Standards Day 8: Getting Started with CSS Layout

xiaoxiao2021-03-06  42

The biggest difference between the CSS layout and the traditional table (Table) layout is that the original positioning is a table, through the spacing of the table, or the spacing of the layout block with colorless transparent GIF images; and now use the layer (DIV) To locate, through the layers of Margin, Padding, Border, etc. to control the spacing of the block.

1. Define a DIV analysis A typical definition Div example: #sample {margin: 10px 10px 10px 10px; padding: 20px 10px 10px 20px; border-right: #ccc 2px solid; border-bottom: #ccc 2px solid; border-left : #CCC 2PX SOLID; Border-Top: #ccc 2px Solid; Background: URL (images / bg_poem.jpg) #Fefefefefe No-repeat Right Bottom; Color: # 666; text-align: center; line-height: 150% Width: 60%;} The description is as follows:

转载请注明原文地址:https://www.9cbs.com/read-51163.html

New Post(0)