开发者

Why is this simple CSS definition not working?

开发者 https://www.devze.com 2023-04-13 06:25 出处:网络
HTML <div class=\"span-24 last\"> Blah </div> Some of you might recognize that I\'m using a grid system ( defined by my blueprint\'s grid.css)

HTML

<div class="span-24 last">
     Blah
</div>

Some of you might recognize that I'm using a grid system ( defined by my blueprint's grid.css)

Not working

div
{
    border: 1px solid black;
}

Working

.last
{
    border: 1px solid black;
}

What could be the problem, have I missed something important in my CSS learning ?

Anser Wiki

I got the answer to the question, I know it sounds stupid but there it is ->

I was using Eric Meyer's Reset.css, and it overrides the div's开发者_开发技巧 border property to 0.

You can solve this by making sure that reset.css is the first stylesheet that gets loaded.


I got the answer to the question, I know it sounds stupid but there it is ->

I was using Eric Meyer's Reset.css, and it overrides the div's border property to 0.

You can solve this by making sure that reset.css is the first stylesheet that gets loaded.


Here is a demo: http://jsfiddle.net/yzjJn/. Maybe some CSS is overriding its class...

div {
  border: 1px solid red;
}
<div class="span-24 last">
  Blah
</div>

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号