国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > WEB開發 > 正文

css基礎1

2024-04-27 15:12:11
字體:
來源:轉載
供稿:網友

 使用webstorm 編輯

1. 確定項目文件夾

2. 規劃好頁面

    a. 首頁   index.html

    b. 樣式  CSS文件夾: css文件      base樣式 和  global 樣式

   c.  圖片  images文件夾  

    d. 特效  js文件夾:js文件

3. css初始化

4. 引入css

   <link rel="stylesheet"  href="css/base.css">

5.引入favicon圖標

   <link rel=""  href="favicon.ico">

6. css權重

    標簽 1    ,   類 10 ,id 100 , 行內 1000 ,

7. 

網頁穩定:

        Width 和height  最穩定

        其次 padding    

        最后才考慮margin

8 . 清除浮動

清除浮動的目的就是為了解決父親盒子的高為0的問題

a.額外標簽法

<div class=" cl h"></div>

.cl{clear:both}

.h{height:}

b. overflow:hidden

c. 偽元素法

.clearfix:after {          content:””;          Visibility:hidden;            Display:block;           Height:0;          Clear:both;     }    .clearfix{      Zoom:1;}

  d. 雙偽元素法

.clearfix:before,.clearfix:after{    display: table;    content: "";}.clearfix:after {    clear: both;}.clearfix {    zoom: 1;}案例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head>	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">	<title>Document</title>	<style type="text/css">		*{			margin: 0px;			padding: 0px;		}		.father{			width: 600px;			border: 1px solid red;			/* overflow: hidden; */		}		.xiongda,.xionger{			width: 200px;			height: 100px;			background-color: yellow;			float: left;		}		/* 雙偽元素清除浮動 */		.xiongda,.xionger{			width: 200px;			height: 100px;			background-color: yellow;			float: left;		}		.clearfix:after{			display: block;			content: "";			clear: both;			visibility: hidden;			height: 0;		}		.clearfix{			zoom:1;		}		/* 偽元素清除浮動		.clearfix:before,.clearfix:after{			display: table;			content: "";		}		.clearfix:after{			clear: both;		}		.clearfix{			zoom:1;		} */	</style></head><body>	<div class="father clearfix">		<div class="xiongda">熊大</div>		<div class="xionger">熊二</div>	</div></body></html>

   


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 内乡县| 逊克县| 土默特左旗| 拉萨市| 泸西县| 新野县| 道孚县| 平潭县| 昔阳县| 丰顺县| 马关县| 高邮市| 赤壁市| 日土县| 灵宝市| 泌阳县| 衡东县| 永州市| 枝江市| 武城县| 扶沟县| 民权县| 哈密市| 南江县| 洛南县| 涡阳县| 泸西县| 蛟河市| 天门市| 娄底市| 绥宁县| 沙坪坝区| 塘沽区| 安远县| 安乡县| 柏乡县| 普安县| 蒲江县| 崇文区| 平湖市| 腾冲县|