css设置html中部分标签的样式

最近在练习html语句的时候遇到了很多需要修改默认样式的地方,整理在此,方便以后使用。

a标签部分

/*      none :  无装饰
        blink :  闪烁
        underline :  下划线
        line-through :  贯穿线
        overline :  上划线 */
/*设置a标签的下划线*/
a {
	text_decoration: none;

}
/*设置未被访问的a标签的下划线*/
a:link {
	text_decoration: none;
}
/*设置已经被访问过的a标签的下划线*/
a:visited {
	text_decoration: none;
}
/*设置鼠标悬停时的a标签的下划线*/
a:hover {
	text_decoration: none;
}
/*设置正在点击的a标签的下划线(鼠标按下,尚未松开)*/
a:active {
	text_decoration: none;
}
/*设置获得焦点的a标签的下划线(被鼠标点击过)*/
a:focus {
	text_decoration: none;
}

文本css的样式

/*color 设置文字和颜色*/
div{
    color:"red";
}
/*font-size 设置文字的大小*/
div{
    font-size: 20px;
}
/*font-family 设置文字的字体*/
div{
    font-family:"微软雅黑";
}
/*font-style 设置字体是否倾斜*/
font-style:’normal’;设置不倾斜,font-style:’italic’;设置文字倾斜
div{
    font-style:"normal"; //不倾斜
    font-style:"italic"; //倾斜
}
/*font-weight设置文字是否加粗*/
div{
    font-weight:bold;//加粗
    font-weight:normal;//不加粗
}
/*line-height 设置文字的行高,设置行高相当于在每行文字的上下同时加间距*/
div{
    line-height:24px;
}
font 同时设置文字的几个属性,写的顺序有兼容问题,建议按照如下顺序写:
1.font:是否加粗 字号/行高 字体;  如:font:mormal 12px/36px "微软雅黑";
2.text-decoration 设置文字的下划线,如:text-decoration:none; 将文字下划线去掉
3.text-indent 设置文字首行缩进,如:text-indent:40px; 设置文字首行缩进40px一般一个中文是20px
4.text-align 设置文字水平对齐方式,如:text-align:center 设置文字水平居中

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值