flex的应用
日志编号:266 发表时间: 2020-02-05 00:39:47 关注次数:399https://www.w3.org/TR/css-display-3/#valdef-display-flex
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<title>flex的应用</title>
<style type="text/css">
#main {
background:#ff0;
display: flex;
flex-direction:row;
flex-wrap: nowrap;
width:50%;
justify-content : center;
}
#aaa {padding:10px;
background:#f00;
width:50%;
justify-content : center;
}
#bbb {
background:#0f0;
width:80%;
}
#ccc {
width:50%;
cursor: pointer;
position: relative;
color: #fff;
font-size: 14px;
width: 100px;
height: 32px;
line-height: 32px;
text-align: center;
background: #0081E0;
border-radius: 2px;
margin-left: 14px;
}
</style>
</head>
<body>
<div id="main">
<div id="aaa">
aaa
</div>
<div id="bbb">
bbb
</div>
<div id="ccc">
ccc
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<title>flex的应用</title>
<style type="text/css">
#main {
background:#ff0;
display: flex;
flex-direction:row;
flex-wrap: nowrap;
width:50%;
justify-content : center;
}
#aaa {padding:10px;
background:#f00;
width:50%;
justify-content : center;
}
#bbb {
background:#0f0;
width:80%;
}
#ccc {
width:50%;
cursor: pointer;
position: relative;
color: #fff;
font-size: 14px;
width: 100px;
height: 32px;
line-height: 32px;
text-align: center;
background: #0081E0;
border-radius: 2px;
margin-left: 14px;
}
</style>
</head>
<body>
<div id="main">
<div id="aaa">
aaa
</div>
<div id="bbb">
bbb
</div>
<div id="ccc">
ccc
</div>
</div>
</body>
</html>
本站不提供讨论功能。
本站所有非新闻类文章均为原创,且禁止转载。
本站为了获得更多流量赚取广告费,难免会有以次充好的文章,望见谅,勿鄙视。
本站所有非新闻类文章均为原创,且禁止转载。
本站为了获得更多流量赚取广告费,难免会有以次充好的文章,望见谅,勿鄙视。