+ Reply to Thread
Results 1 to 4 of 4

Thread: How can i increase the width of both left/right padding of website

  1. #1
    ataarticles is offline x10Hosting Member ataarticles is an unknown quantity at this point
    Join Date
    Jun 2010
    Posts
    45

    Question How can i increase the width of both left/right padding of website

    Hello,

    How can i increase the width of both left/right padding of website?

    http://www.ataarticles.com

    I tried the following code:

    #container {
    width: 100%;
    background: url(i/dots.gif) 550px 0 repeat-y;
    margin-bottom: 10px;
    padding: 0 8px;
    }


    after asking about this before on this thread:
    AtaArticles.com

    It didn't work for some odd reason.
    Last edited by ataarticles; 06-18-2010 at 10:21 AM.

  2. #2
    farscapeone's Avatar
    farscapeone is offline Community Advocate farscapeone is on a distinguished road
    Join Date
    Dec 2008
    Location
    Србија (Serbia)
    Posts
    1,166

    Re: How can i increase the width of both left/right padding of website

    It's because the width of your container div. You see, when you put left and right padding on an element it's actual width is calculated as a sum of width + padding-left + padding-right. So if you put 8px padding to left and right side of your dive and you set it's width to 100% it's actual width is 100% + 16px. That's why your whole container div is wider the it should be and you don't get the right effect. Just use inspect tools that almost every browser has and see for yourself. To make it more clear I made a screenshot in Chrome (image below). You can see that the padding is added correctly but it's the width of the div that's cosing the problem.

    How can i increase the width of both left/right padding of website-.png

  3. #3
    ataarticles is offline x10Hosting Member ataarticles is an unknown quantity at this point
    Join Date
    Jun 2010
    Posts
    45

    Re: How can i increase the width of both left/right padding of website

    Quote Originally Posted by leviathon View Post
    It's because the width of your container div. You see, when you put left and right padding on an element it's actual width is calculated as a sum of width + padding-left + padding-right. So if you put 8px padding to left and right side of your dive and you set it's width to 100% it's actual width is 100% + 16px. That's why your whole container div is wider the it should be and you don't get the right effect. Just use inspect tools that almost every browser has and see for yourself. To make it more clear I made a screenshot in Chrome (image below). You can see that the padding is added correctly but it's the width of the div that's cosing the problem.

    Attachment 4980
    Hi, thanks for your response.

    I have been experimenting with the padding before and noticed that if i increase the padding, the right side increases while the left decreases.
    Now i made changes after referring to your image capture:

    /* Content
    -----------------------------------------------------------------------------*/
    #container {
    width: 990%;
    background: url(i/dots.gif) 550px 0 repeat-y;
    margin-bottom: 10px;
    padding: 0 5px;

    The right side has increased slightly but the left side has not.

    Is there a way to increase both left and right side padding including the text about an extra inch in width?

    Or is that not possible with the current theme?

    By the way, which software did you use to capture website image?

    Thanks

  4. #4
    farscapeone's Avatar
    farscapeone is offline Community Advocate farscapeone is on a distinguished road
    Join Date
    Dec 2008
    Location
    Србија (Serbia)
    Posts
    1,166

    Re: How can i increase the width of both left/right padding of website

    Quote Originally Posted by ataarticles View Post
    Hi, thanks for your response.

    I have been experimenting with the padding before and noticed that if i increase the padding, the right side increases while the left decreases.
    Now i made changes after referring to your image capture:

    /* Content
    -----------------------------------------------------------------------------*/
    #container {
    width: 990%;
    background: url(i/dots.gif) 550px 0 repeat-y;
    margin-bottom: 10px;
    padding: 0 5px;

    The right side has increased slightly but the left side has not.
    First of all you set the width to 990%. I guess you wanted to make it 990px not %. On the other hand I played with your width to make it work but there is a problem somewhere else because when I changed the width to compensate for the paddings I lost the three column content layout and everything went into the first column leaving others empty. I guess you'll have to change the width of each column to make it work.

    Quote Originally Posted by ataarticles View Post
    Is there a way to increase both left and right side padding including the text about an extra inch in width?
    Like I said before, you added the padding correctly to both sides. The problem is you have to adjust the width to compensate for that padding.

    Quote Originally Posted by ataarticles View Post
    By the way, which software did you use to capture website image?
    I don't quite understand your question. I used Print Screen key and pasted it in Adobe Fireworks to add padding arrows. Browser is Chrome and I used it's element inspector that highlighted the container div and it's padding.

+ Reply to Thread

Similar Threads

  1. Ways to increase web traffic website
    By johxdi in forum Review My Site
    Replies: 2
    Last Post: 05-17-2010, 11:34 PM
  2. How to Increase Website Traffic
    By sunils in forum Tutorials
    Replies: 14
    Last Post: 05-14-2009, 01:24 PM
  3. Website page width
    By taekwondokid42 in forum Programming Help
    Replies: 3
    Last Post: 01-23-2008, 10:23 AM
  4. border padding problem
    By ZeptOr in forum Scripts & 3rd Party Apps
    Replies: 6
    Last Post: 12-23-2006, 02:59 PM
  5. { width:95%; min-width:IE SUCKS !important; }
    By DecemberGuild in forum Scripts & 3rd Party Apps
    Replies: 4
    Last Post: 11-01-2006, 02:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers