css面试题积累

个人认为有意思的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。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值