web (3)

行块元素分类

.行级元素:(css的display:iline)

    内容决所占位置,不可通过css改变行高

     span/strong/em/a/del

     块状元素:(css:block)

     独占一行,可以通过css改变行高

     p/div/ul/li/ol/from/address

     行级块元素:(css:inline-block)

     <img src="  ">

    !!!!!!将其css属性给改了,也就不具有

    本来原有的行/块属性)

以上属性及个别其他属性比如斜体加粗都可以用css的通配符消除,再自己建立。

操作:

html:

<!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>

    <link rel="stylesheet" type="text/css" href="行级元素_字体_颜色.css"/>

</head>

<body>

    <!-- 1. -->

    <span>你好,明天</span>

    <span class="demo">goodnight</span>

    <!-- 2.颜色...... -->

    <span class="taobao">天猫超市</span>

    <div class="demo" id="id">你好呀</div>

</body>

</html>

css:

span{

    background-color: aqua;

}

p.demo{

    display: block;

    background-color: beige;

}

span.taobao{

    background-color:crimson ;

    border-radius: 20px;

    color : #fff;/*字体颜色  */

    font-size: 20px; /* 字体大小 */

    height: 30px;

    font-weight: bold; /* 字体粗细 */

    font-style: normal; /* 字体类型 */

}

*{

    display:block;

    width:100px;

    font-style: normal;

}/*通配符使用*/

span{

    background-color: aqua;

}

p.demo{

    display: block;

    background-color: beige;

}

span.taobao{

    background-color:crimson ;

    border-radius: 20px;

    color : #fff;/*字体颜色  */

    font-size: 20px; /* 字体大小 */

    height: 30px;

    font-weight: bold; /* 字体粗细 */

    font-style: normal; /* 字体类型 */

}



 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值