第一个
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
#tbox {
display: flex;
width:300px;
margin:0;
padding: 0;
list-style:none;
flex-flow: column nowrap;
}
#cbox {
display: flex;
width: 100%;
height: 200px;
margin:0;
padding: 0;
list-style:none;
flex-flow: row nowrap;
}
li {
border: 1px solid #999;
}
#cbox li {
width: 100px;
}
</style>
</head>
<body>
<ul id="tbox">
<li>header</li>
<li>
<ul id="cbox">
<li>aaa</li>
<li>bbb</li>
<li>ccc</li>
</ul>
</li>
<li>footer</li>
</ul>
</body>
</html>
第二个
用@media screen
/*页面宽度>500的样式*/
#xxx {}
@media screen and (max-width: 500px) {
/*页面宽度<=500的样式*/
#xxx {}
}
媒体查询