The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Page width – cant get normally paddings

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #41025

    Hello and sorry. Question is really easy, but after reading your web site and book, i did not get answer for it. So..
    I want to make web site which have in psd file width – 1024 and left&right paddings – 38..
    But after a lot of trying i cant to make relative design, where in size of window (1024px) will be same paddings..

    My CSS:
    #page {
    width: 92,578125%; (948/1024)
    margin: 20px auto; – is it just editing top margin?)
    background: #ff00ff;

    What i have-

    Padding looks like-

    Sorry for my english and hope you understood what i meant ;)


    Firstly, you should probably be using a reset or normalise css.

    For a width as specified for the ‘page’ you should have

    page {
    padding:0 38px;

    However, you should be aware that **normally** padding is ADDED to a specified width so the ACTUAL width will be 1100px.

    To get round this you have to use change the way this is done with

    * {
    -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
    -moz-box-sizing: border-box; /* Firefox, other Gecko */
    box-sizing: border-box; /* Opera/IE 8+ */


    I didn’t understand your issue correctly, but I believe, adding the float property may solve your issue. It will force layout to take padding or margin whatever you want to add.


    You wouldn’t float a whole page!

    And in any case…I don’t think that’s his issue.

    Here’s an example of the difference:

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.