[resolved] Controlling text width inside a box (4 posts)

  1. iyamdman
    Posted 4 years ago #

    Alright, let's try this again.

    If you look at my test site, the test post in the main content area – ‘Home Posted on August 30th, 2011’ post – the text (post content) goes all the way to the left or right red boarder.


    Below is the code from the style.css:

    #content {
    width: 757;
    height: 523;
    border-top: 2px #FF0033 solid;
    background: url("images/content-lt-blue-background-1-j.jpg") no-repeat center top transparent;
    float: right;

    I tried addling padding and margin, but the padding was added to the outside of the image creating a gap between the background image and the red boarder - and it made the content area bigger and screwed up the layout.

    How can I make the post’s "text" (content) stay within (less than) 10px of each wall/boarder of the content area?

  2. tyler_durdin
    Posted 4 years ago #

    umm try floating it left adding a margin-left:10px; and change the width so it's the distance you want away from the other border

  3. Michael
    Part-Time Forum Moderator
    Posted 4 years ago #

    if you use padding, you need to reduce the width by the same amount to keep the total the same
    ( http://www.w3schools.com/css/css_boxmodel.asp )

  4. iyamdman
    Posted 4 years ago #

    Thanx - all this helped, and I was finally able to get it to work right.

Topic Closed

This topic has been closed to new replies.

About this Topic