HTML5的實用

來源:互聯網
上載者:User

標籤:置中   百度   nbsp   logo   ffffff   pad   inline   ado   fixed   

1.盒子模型

# 01.可以拿到當前網頁當中所有的標籤: 去掉當前網頁當中所有標籤的內邊距和外邊距

// * { margin: 0  padding: 0 }

# 02.內邊距

// padding: 10px 8px 5px 15px;(上, 右, 下, 左)

# 03.邊框

// border: 5px solid red;(寬度, 樣式, 顏色)

# 04.外邊距

// margin: 50px 10px 20px 8px;(上, 右, 下, 左)

# 05.盒子模型

// box-sizing: border-box

 

2-CSS3的屬性

# 01.陰影

// box-shadow: 10px, 10px, 10px, oringe;(必需。水平陰影的位置, 必需。垂直陰影的位置, 可選。模糊的距離, 可選。陰影的顏色)

# 02.圓角

// border-top-left-radius: 100px;

// border-radius: 100px;

# 03.透明度

// background-color: rgba(255, 0, 0, 1.0);(紅色值, 綠色值, 藍色值, 透明度)

 

3-CSS的布局

# 01.float,會將標籤修改成行內塊級標籤,脫離標準流

// float: left;

// 在便簽內定義id和類:

// <div id="main">

// <div class="test1">我要左浮動</div>

# 02.定位(子絕父相)

// position: relatie;(產生相對定位的元素->子項目)

// position: fixed;(產生絕對位置的元素->瀏覽器)

// position: absolute;(產生絕對元素的定位->父元素)

# 03.行內標籤和行內塊級標籤置中

// 水平置中: 在父標籤中添加: text-align: center

// 垂直置中: 在父標籤中添加: align: height

# 04.塊級標籤置中

" 水平置中: 在自身中設定margin: 0 auto;

" 垂直置中: 通過形變來實現:

// position: absolute;

// top: 50%;

// left: 50%;

// transform: translate(-50%, -50%);

" <p>: 塊級標籤, <span>: 行內標籤, <button>: 行內塊級標籤

 

04-高仿百度首頁

# 01.id和class的使用位置

// <div id="content">

//       <div class="logo">

# 02.設定背景尺寸

// background-size: cover;(平鋪)

# 03設定字型加粗

// font-weight: bolder;

# 04.設定字型不加粗

// font-weight: lighter;

# 05.去掉底線

// text-decoration: none;

# 06.偽類

// #header a.more-product:hover { color: red; }

# 07.改變標籤的類型

// display: inline-block;

# 08.設定不透明度

// opacity: 0.6;

HTML5的實用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.