个人认为有意思的css相关面试题总结。。
1.display 的属性有几种,分别是什么?
常见的有:none、block、flex、默认inherit。。。
额。。竟然有这么多,原谅我这只小菜鸟没用过。。。
2.list-style的属性有几种,分别是?
list-style:square inside url('1.jpg');
- list-style-type :disc(默认实心圆点)、circle(空心圆)、square(实心方块)、decimal(数字)。。。
太多了看网址:https://www.w3school.com.cn/cssref/pr_list-style-type.asp - list-style-position:inside、outside、inherit
- list-style-image:url、none、inherit
3.写样式,box_l和box_r 平行且没有边距,有几种写法
<div class="box">
<div class="box_l"></div>
<div class="box_r"></div>
</div>
我先简单写两种吧。。
1.
.box {
position: relative;
display: flex;
width: 200px;
height: auto;
}
.box div {
width: 100px;
height: 100px;
}
.box_l {
background: red;
}
.box_r {
background: yellow
}
.box {
position: relative;
width: 200px;
height: auto;
}
.box div {
float: left;
width: 100px;
height: 100px;
}
.box_l {
background: red;
}
.box_r {
background: yellow
}
相关代码、截图来自:https://www.w3school.com.cn/cssref/pr_class_display.asp
持续更新ing。。。