[UI] 02 - Layout & CSS3

開胃小菜


1、純CSS佈局

  • UI效果

From: 建立一個沒有表格的網頁php

 

  • 代碼詳情
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>菜鳥教程(runoob.com)</title> 
<style>
* {
    box-sizing: border-box;
}
body {
    margin: 0;
}
.header {
    background-color: #2196F3;
    color: white;
    text-align: center;
    padding: 15px;
}
.footer {
    background-color: #444;
    color: white;
    padding: 15px;
}
.topmenu {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #777;
}
.topmenu li {
    float: left;
}
.topmenu li a {
    display: inline-block;
    color: white;
    text-align: center;
    padding: 16px;
    text-decoration: none;
}
.topmenu li a:hover {
    background-color: #222;
}
.topmenu li a.active {
    color: white;
    background-color: #4CAF50;
}
.column {
    float: left;
    padding: 15px;
}
.clearfix::after {
    content: "";
    clear: both;
    display: table;
}
.sidemenu {
    width: 25%;
}
.content {
    width: 75%;
}
.sidemenu ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}
.sidemenu li a {
    margin-bottom: 4px;
    display: block;
    padding: 8px;
    background-color: #eee;
    text-decoration: none;
    color: #666;
}
.sidemenu li a:hover {
    background-color: #555;
    color: white;
}
.sidemenu li a.active {
    background-color: #008CBA;
    color: white;
}
View Code
 
 
</style>
</head>

<body>
<ul class="topmenu">
  <li><a href="#home" class="active">主頁</a></li>
  <li><a href="#news">新聞</a></li>
  <li><a href="#contact">聯繫咱們</a></li>
  <li><a href="#about">關於咱們</a></li>
</ul>

<div class="clearfix">

  <div class="column sidemenu">
    <ul>
      <li><a href="#flight">The Flight</a></li>
      <li><a href="#city" class="active">The City</a></li>
      <li><a href="#island">The Island</a></li>
      <li><a href="#food">The Food</a></li>
      <li><a href="#people">The People</a></li>
      <li><a href="#history">The History</a></li>
      <li><a href="#oceans">The Oceans</a></li>
    </ul>
  </div>

  <div class="column content">
    <div class="header">
      <h1>The City</h1>
    </div>
    <h1>Chania</h1>
    <p>Chania is the capital of the Chania region on the island of Crete. The city can be divided in two parts, the old town and the modern city.</p>
    <p>You will learn more about responsive web pages in a later chapter.</p>
  </div>
</div>

<div class="footer">
  <p>底部文本</p>
</div>
View Code
</body>
</html>

 

 

 

重要組件


1、基本組件

 

 

2、CSS 實例

Goto: http://www.runoob.com/css/css-examples.html【查詢實例】css

 

 

 

CSS3新特性


1、邊框

CSS3 圓角,也可詳見:http://www.runoob.com/css3/css3-border-radius.htmlhtml

CSS3 盒陰影css3

邊界圖片web

框大小,詳見:http://www.runoob.com/css3/css3-box-sizing.htmlapi

 

2、背景

 

3、漸變

 

4、文本效果、字體

 

5、2D/3D 轉換

 

6、過渡、動畫

 

7、多列布局

 

8、用戶界面

resizeide

box-sizing佈局

outline-offset字體

 

9、圖片

 

10、按鈕

 

11、分頁

 

12、彈性盒子

 

十3、多媒體查詢

Ref: CSS3 多媒體查詢實例動畫

 

 

以上僅僅記錄個別要點。

往後慢慢補充。

相關文章
相關標籤/搜索