如何让css样式失效


当前第2页 返回上一页

使用!important提升样式优先级。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 <html xmlns="http://www.w3.org/1999/xhtml"

<head> 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

<title>Untitled Document</title> 

<style type="text/css"

.aa{ 

        font-family: Verdana, Arial, Helvetica, sans-serif; 

        font-size: 12px; 

        background-color: #FF0000 !important 

.bb{ 

        font-family: Verdana, Arial, Helvetica, sans-serif; 

        font-size: 12px; 

        background-color: #FF0000; 

</style> 

</head> 

<body> 

<div class="aa" style="background-color:#cc6600;font-size:16px;">中Class中包括:!important的样式

</div> <div class="bb" style="background-color:#cc6600">不包括的样式</div> 

</body> 

</html>

效果图:

11c0cc75a70f2bec7d93f6df2e77c5d.png

相关教程推荐:CSS视频教程

以上就是如何让css样式失效的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

css的含义是什么

css link与import的区别是什么

浅谈css的background背景属性

html中表单的相关知识总结(代码实例)

css text-outline属性怎么用

css怎么设置无边框

css怎么设置不显示文字

html中设置字体的属性有哪些

css中的内联元素是什么

css圆角属性是什么

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...