CSS

余生长醉 提交于 2019-11-27 15:35:54

css总共有三种标签,非别是div、span、p

这三个元素的区别:

div和p是块级元素,独占一行,而span是行内元素,<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <title>css</title>
    </head>
    <body>
        
        <!--  geox给下面的div/span/p加上css样式 -->

    <!--sytle属性:
      border:边框 宽度
        solid:设置边框颜色
          font-size:字体大小
        font-family:字体属性
        font-style:是否为斜体
        font-weight:是否加粗
        background:底色
    -->

        <div id="" style="border: 2px solid red;font-size: 25px;
            font-family: '微软雅黑';font-style: italic;
            font-weight: bolder;">
            div111
        </div>
        <div id="" style="border: 2px solid red;font-size: 25px;
            font-family: '微软雅黑';font-style: italic;
            font-weight: bolder;">
            div111
        </div>
        
        <span style="border: 3px solid blue;
            font-size: 25px;font-style: italic;">
            span222
        </span>
        <span style="border: 3px solid blue;
            font-size: 25px;font-style: italic;">
            span222
        </span>
       
        <p style="background: blueviolet;font-size: 30px;
            font-style: italic;font-weight: bolder;">p333333</a></p>
        <p style="background: blueviolet;font-size: 30px;
            font-style: italic;font-weight: bolder;">p333333</a></p>
        
    </body>
</html>

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!