Web前端学习笔记5:CSS3

1.span标签

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>一个网站</title>
    <style>
       #css{
           font-size: 50px;
       }
    </style>


</head>
<body>
欢迎学习<span id="css">CSS3</span>
</body>
</html>

这样css就会变成50b( ̄▽ ̄)d 字体了

2.字体样式

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>一个网站</title>
<!--   font-family 字体
        font-size 字体大小
        font-weight 字体粗细
        color 字体颜色
 -->
    <style>
        body{
            font-family: 楷体;
            color: coral;
        }
        h1{
            font-size: 50px;
        }
        .a{
            font-weight: bold;
        }
    </style>


</head>
<body>
<h1>标题</h1>
<p class="a">这是一段话</p>
</body>
</html>

效果如下:

3.文本样式

<style>

h1{
color:rgba(100,255,255,0.8);
text-align:center;
}
p{
text-indent:2em;
height:300px;
line-height:300px;
text-decoration:underline;
text-shadow:#000 10px 10px 2px;
} 
img,span{
vertical-align:middle;
}
</style>

rgba中的a为透明度,取值范围0~1;

text-indent:2em意为首行缩进两字符;

line-height:300px为行高,和块的高度一致就可以上下居中;

text-decoration:underline是给句子加线,underline是下划线,line-through是中间线,overline是上部的线;

vertical-align:middle意为让图片右边的文字上下居中;

text-shadow:#000 10px 10px 2px为字体阴影,四个值分别代表了字体颜色,水平偏移,垂直偏移,阴影半径

4.超链接伪类

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>一个网站</title>
<!--   font-family 字体
        font-size 字体大小
        font-weight 字体粗细
        color 字体颜色
 -->
    <style>
/*默认的颜色*/
a{
    text-decoration: none;
    color: #000;
}
/*鼠标按住未释放的状态(只需记住hover)*/
a:hover{
    color:blue;
    font-size: 50px;
}
    </style>


</head>
<body>
<a href="#">文本样式</a>

</body>
</html>

这样把鼠标悬停在文本上它就会变样子

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

杰涅斯

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值