边框(border)和 text-decoration(css)

边框(border)

/*css*/
ul li {
      background-color: skyblue;
      padding: 10px;
      margin-bottom: 10px;
    }

    li:first-of-type {
      border-top: 2px solid #f00;
      /*实线*/
    }

    li:nth-child(2) {
      border-left: 2px double #f00;
      /*双线*/
    }

    li:nth-child(3) {
      border-right: 2px dotted #f00;
      /*点线*/
    }

    li:nth-child(4) {
      border-bottom: 2px dashed #f00;
      /*虚线*/
    }

    li:nth-child(5) {
      border-width: 2px;
      /*边框线宽度*/
      border-color: #f00;
      /*边框线颜色*/
      border-style: dotted dashed double;
      /*上 左右  下*/
    }

    li:nth-child(6) {
      border-width: 2px;
      /*边框线宽度*/
      border-color: #f00;
      /*边框线颜色*/
      border-style: solid dashed dotted double;
      /*上 右 下 左*/
    }

    li:nth-child(7) {
      border-width: 2px;
      /*边框线宽度*/
      border-color: #f00;
      /*边框线颜色*/
      border-style: dotted dashed;
      /*上下 左右*/
    }
    /*html*/
    <ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
  </ul>

效果图:
在这里插入图片描述

text-decoration

/*css*/
    a:first-child {
      /*文字下方有线*/
      text-decoration: underline;
    }

    a:nth-child(2) {
      /* 文字下方有链接 */
      text-decoration: overline;
    }

    a:nth-child(3) {
      /* 中间的线 */
      text-decoration: line-through;
    }

    a:nth-child(4) {
      text-decoration: overline underline;
    }

    a:last-child {
      text-decoration: overline line-through underline;
    }
 /*html*/
  <a>1234</a>
  <a>1234</a>
  <a>1234</a>
  <a>1234</a>
  <a>1234</a>

效果图:
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值