
批改狀態(tài):合格
老師批語:不錯, 繼續(xù)努力
components
)小結:1.組件化開發(fā)就是把一個頁面拆分成最小的功能塊,在寫網(wǎng)頁是再通過把各個功能塊組裝起來構成頁面。這樣可以減少重復工作。
2.組件化開發(fā)注意點:對文件夾的管理,文件的命名注意,比較容易記憶,這樣再以后利用是可以快速找到文件;
編程約定,@import
語法實現(xiàn)頁面的組裝;
是一個組件必須使用一個獨立無二的類名class。
最大的意義在于他的復用性
Flex
彈性盒子元素的六個屬性
.item{
flex-basis:<legth>; /*可以是數(shù)值和百分比*/
flex-basis:auto; /*默認值,原始寬度*/
}
.item{
flex-grow:<number>; /*放大的數(shù)值,默認值是0*/
}
.item{
flex-shrink:<mumber>;/*縮小的數(shù)值,默認值是1*/
}
flex:0 1 auto; 等價于 flex:initial;
flex:auto; 等價于 flex:1 1 auto; 等價于 flex:2;
flex:none; 等價于 flex:0 0 auto;
.item{
order:<integer>; /*排列數(shù)值,默認值為0*/
}
align-self
屬性定義了單個項目再縱軸上的對齊方式,可以覆蓋align-items
定義的屬性,默認值為auto即繼承父元素的align-items
屬性,如果沒有父元素,等同于stretch。
.tiem{
align-self:auto; /*默認值,繼承父元素align-items屬性*/
align-self:flex-start; /*交叉軸開始對齊*/
align-self:flex-end; /*交叉軸結束對齊*/
align-self:center; /*交叉軸中間對齊*/
align-self:baseline; /*交叉軸第一列基線*/
align-self:stretch; /*項目的邊距盒的尺寸盡可能接近所在行的尺寸*/
}
*{
margin:0;
padding:0;
outline: 1px dashed red;
}
body{
font-size: 13px;
color:#555;
background-color:#efefef;
}
a{
color:#404040;
text-decoration:none;
font-size:13px;
}
li {
list-style:none;
}
@import url(../../public_reset.css);
.public-header{
height:44px;
background-color:000;
padding:0 20px;
display:flex;
flex-flow: row nowrap;
}
.public-header a{
line-height:44px;
color:#ccc;
padding:0 10px;
}
.public-header > a:hover{
background-color:#fff;
color:#000;
}
.public-header > span{
margin-left:auto;
}
.public-header > span > a > i{
font-size:16px;
color:#ccc;
padding-right:10px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../static/font/iconfont.css">
<link rel="stylesheet" href="./public_header.css">
<title>頭部導航</title>
</head>
<body>
<div class="public-header">
<a href="">網(wǎng)站首頁</a>
<a href="">專題</a>
<a href="">網(wǎng)站導航</a>
<a href="">二手商品</a>
<a href="">討論區(qū)</a>
<span>
<a href=""><i class="iconfont icon-huiyuan2"></i>登錄</a>
<a href="">網(wǎng)站首頁</a>
</span>
</div>
</body>
</html>
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號