CSS常用属性汇总0724

文章目录

CSS15种常用属性汇总


前言

总结一下目前学到的15种常用的CSS属性的汇总,只是目前学到的哈,以后会有更多😀


color         前景色
background-color      背景色
font-size          字体大小
font-weight        字体粗细
text-algin        文本居中
line-height        垂直居中和高度
width height        宽高       

display里面又分为:
inline        行内元素相当于span
block        块元素相当于div
inline-block        行内块,既不会换行又可以给宽高
none        不显示


margin         外边距
padding        内补
border        边框     书写样式:border:1px solid red
border-radius        图片圆角
text-decoration  none        超链接去除下划线
list-style none        去除列表样式

使用大多数属性做了一个简易导航栏

代码如下

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0px;
            margin: 0px;
            font-size: 0px;
          }

        .ceshi1 {
            width: 1000px;
            background-color: aqua;
            border-radius: 20px;
            height: 50px;
            border: 2px solid slateblue;
               }

        .ceshi2 {
            background-color: burlywood;
            height: 100%;
            line-height: 50px;
            margin: 0px 10% 0 10%;
               }

        a {

            color: blue;
            display: inline-block;
            text-decoration: none;
            text-align: center;
            width: 20%;
            font-size: 16px;
        }
    </style>
</head>

<body>
    <div class="ceshi1">
        <div class="ceshi2">
            <a href="">1</a>
            <a href="">2</a>
            <a href="">3</a>
            <a href="">4</a>
            <a href="">5</a>
        </div>
    </div>
</body>

</html>

效果如下


 

总结

这里对文章进行总结:以上就是今天总结的知识点,目前学到的15种常用的CSS样式属性,大家一起沟通学习!😊
 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值