How to add padding to divs without using internal div with 960gs?

I am using 960gs and trying to add an add-on to divwithout using internal div.

You see that if you add the add-on to the actual one div, it will break the layout created by 960gs, and the only way I found for this is to create another one divinside and apply the add-on to it.

I assume that there is no problem with this method, I just think that the second is divnot needed, and I would prefer not to use it ... any ideas?

+3
source share
2 answers

Does box size work?

https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing

div {
    width: 100px;
    box-sizing: border-box;
}

-      , . , Internet Explorer Quirks.

+3

. , , , . , div ( grid_xx).

, ( ), padding . :

<div class="grid_12">
 <div class="inner_div" style="padding:10px">
  <p>This is some sample text</p>
 </div>
</div>

div , :

<div class="grid_12">
 <p style="padding:10px">This is some sample text</p>
</div>

, CSS CSS, :)

, .

Blueprint YUI CSS, , .

+1

Source: https://habr.com/ru/post/1777619/


All Articles