开发者社区> 问答> 正文

css中的一些不起作用,但放在HTML中起作用,为啥呢

@CHARSET "UTF-8";
h1{ background-color: #ADD8e6; color: #256579; font:18px Verdana,Geneva,Arial,Helvetica,sans-serif; padding:2px; border-bottom:1px solid #aaaaaa; } body{ background-color: #ffffff; background-image: url(images/sb.jpg); background-repeat: repeat-x; } .one{ font-family:隶书; font-size:24px; color:red; } .two{ font-family:宋体; font-size:18px; color:red; } .three{ font-family:宋体; font-size:12px; color:red; }

展开
收起
小旋风柴进 2016-03-12 13:56:36 2062 0
1 条回答
写回答
取消 提交回答
  • 诸多迹象表明,你的css文件中,在你所放的位置之后,还有关于body h1的定义,被覆盖了。

    而你放在html中应该是在css引用之后,优先级高,所以生效了

    2019-07-17 19:00:43
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
零基础CSS入门教程 立即下载
天猫 HTML5 互动技术实践 立即下载
天猫HTML5互动技术实践 立即下载