SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Nov 2012
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I stop the text going to the edge of the container

    This is the page:

    http://www.c5d.co.uk/coursehistoryfour.php

    As can be seen the text goes right to the very edge of the container.

    How can I put a margin there ?

    Thanks

    Antony

  2. #2
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,819
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    several ways to answer this question.
    looking at your code i will assume : .entry is your container
    1) .entry p, .entry table {margin-right: somevalue;}
    2) .entry p, .entry table {margin-right: somevalue;}
    3) .entry {padding-right: somevalue;} /* do keep in mind that if you declared a specific width for .entry, you need to reduce it by the amount of padding;you are adding.


    which is the best choice depends on what you have already coded and what you intend to add.


    for example , if your container is a fixed width, and/or you had needed to add padding to it to pull of some trick, and your inner element have no b/gs adding padding to the inner element works nicely.

    if you inner element will get some sort of background adding margin works ( fortunately horizontal margins behave simpler than vertical margins)

    But if you THINK out your layout in ADVANCE, an you have control over the width of your container, the easiest way is to add the padding to the container (as said before, taking account how it will affect the calculated width).

    I hope that helps

  3. #3
    SitePoint Addict
    Join Date
    Nov 2012
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It works perfectly thanks.

    I have used padding-right: 10px;

    Thanks very much

    Antony


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •