前端HTML+CSS学习第一天

    技术2022-07-17  75

    记录前端学习中的新知识点 1.需求:h2中上边框宽度和文字保持一致 解: div>h2>a{ /* 为了边框和文字宽度一样,h2转换为行内块元素 / display: inline-block; height: 42px; line-height: 42px; / 字体加粗 / font-weight:bold; font-size: 20px; color: black; / 去除下划线 / text-decoration: none; border-top: 1px red solid; / 通过margin-top将整个元素上衣一个像素 */ margin-top: -1px; }

    2./* 使用before伪元素在列表每一行前方添加字符 */ .gym .item-list li::before{ content:"~" } 3.元素阴影表示:box-shadow:10px 10px 10px rgba(0,0,0,0.5) 第一个值:水平方向偏移量 第二个值:垂直方向偏移量 第三个值:模糊度 第四个值:阴影颜色

    4.圆角 border-radius:50% border-radius:10px border-radius:10px 20px 30px 40px 从左上开始,顺时针,零国外还可以写成 boeder-radius:20px/30px border-top-left-radius

    5.检查网页源码时,可通过选中像素通过按动上下键对像素值进行修改

    Processed: 0.020, SQL: 9