CSS文本颜色等常用样式

常用字体属性
font-family :指定字体类型
font- size:指定文本的字体大小
font-style:指定文本的字体样式
font-weight:指定文本的字体粗细
         font:在一个声明中设置所有的字体属性

注意:font: font-style | font-weight | font-size | font-family;

1.必须按照上面书写的顺序书写,不能更换顺序,并且各个属性之间用空格隔开。

2.必须保留font-size和font-family属性,否则font不生效

字体图标
字体图标展示的是图标,本质属于字体。主要用于显示网页中通用、常用的一些小图标。

字体图标的优势:

一个图标字体要比一系列的图像要小。一旦字体加载了,图标就会马上渲染出来,减少了服务器请求。

字体图标本质是文字,可以随意的改变颜色、产生阴影、透明效果、旋转等

常用文本属性
color:设置文本颜色
text-align:对齐元素中的文本
text-decoration:向文本添加修饰
line-height:设置行高
文本的外观,比如文本颜色,对齐文本等等;行间距=上间距+文本高度+下间距

其他常用样式
width:元素的宽度
height:元素的高度
background:背景颜色
opacity:元素透明度
           overflow:指定内容溢出一个元素的框

案例应用:

<!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>baidu</title>

    <style>

      .images{
        text-align:center ;

      }

      .group{
        text-align:center ;

      }

      .under{
        font-size: 10px;

       

         width: 100%;

        height: 60px;

        position: fixed;

         bottom: 0;

       

      }

      .pro{
        font-size: 10px;

        opacity: 0.5;

        position: absolute;

        bottom: 0;

        width: 100%;

      }

    </style>

</head>

<body>

    <div class="images">

        <img  src="../css/image/bdlogo.gif">

    </div>

   

    <div class="group">

        <a href="http://news.baidu.com/">新闻</a>

        &nbsp;

        <a href="">网页</a>

        &nbsp;

        <a href="https://tieba.baidu.com/index.html">贴吧</a>

        &nbsp;

        <a href="https://tieba.baidu.com/index.html">知到</a>

        &nbsp;

        <a href="https://tieba.baidu.com/index.html">音乐</a>

        &nbsp;

        <a href="https://tieba.baidu.com/index.html">图片</a>

        &nbsp;

        <a href="https://tieba.baidu.com/index.html">视频</a>

        &nbsp;

        <a href="https://tieba.baidu.com/index.html">地图</a><br>

        <br>

        <input type="text" name="text1" size="50" maxlength="60" width="50">

        <input type="submit" name="提交" value="百度一下"><br>

        <br>

        <a href="https://tieba.baidu.com/index.html">百科</a>

        <a href="https://tieba.baidu.com/index.html">文库</a>

        <a href="https://tieba.baidu.com/index.html">贴吧</a>

        <a href="https://tieba.baidu.com/index.html">hao123</a>

        <span>|</span>

        <a href="https://tieba.baidu.com/index.html">更多>></a>

        <br>

        <br>

        <br>

        <div class="under">

            <a href="https://tieba.baidu.com/index.html">把百度设为主页安装百度浏览器</a><br>

            <a href="https://tieba.baidu.com/index.html">加入百度推广|</a>

            <a href="https://tieba.baidu.com/index.html">搜索风云榜|</a>

            <a href="https://tieba.baidu.com/index.html">关于百度|</a>

            <a href="https://tieba.baidu.com/index.html">About Baidu</a>

        </div>

        <div class="pro">

            <p>2013 Bai du 使用百度前必读 京ICP证030173号</p>

        </div>

       

    </div>

   

</body>

</html>

案例效果:

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值