SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Jul 2003
    Location
    USA
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile "DIV"?? Please help me with this n00b question

    Hello all

    I have a n00b question. I haev this big white area for content on one of my sites.. the problem is, whenever I write text in it touches the edges which I don't want happening. I once saw something about "DIVS" ect.. where you can just make something that tells the text to only go so far, then wrap? that'll stop it from touching the edges.

    Any help will be GREATLY appreciated!!

    Thanks

  2. #2
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just put your text in paragraphs:

    Code:
    <p>This is your text</p>
    And then add this to your CSS:

    Code:
    p { margin: 1em; }
    Douglas
    Hello World

  3. #3
    SitePoint Member
    Join Date
    Jul 2003
    Location
    USA
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your my hero!!!

    Thanks so much

  4. #4
    SitePoint Addict
    Join Date
    May 2003
    Location
    Auckland
    Posts
    309
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Although, if you wanted everything inside that space to only go 'so far' then you could wrap the whole space up in a div
    Code:
    <div class="something">
      <p>This is your text</p>
    </div>
    CSS:
    Code:
    div.something {
      padding : 10px;
    }

  5. #5
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This might even work

    Code:
    td * { padding: 10px; }
    td * * { padding: 0; }
    Douglas
    Hello World

  6. #6
    SitePoint Addict BenANFA's Avatar
    Join Date
    Apr 2003
    Location
    Bath, UK
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What makes you think tables are involved ?

  7. #7
    SitePoint Addict Tim_Rogovets's Avatar
    Join Date
    Aug 2003
    Location
    Odessa, Ukraine
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The 'padding' attribute is what you need:

    Padding is space that extends around the contecnt box of an element up to but not including any border that may be specified for an element.

    The number of values determines which sides receive the assigned values:

    1 value - all 4 sides

    2 values - top and bottom padding set to 1st value, left and right - to 2nd.

    3 values - top padding set to 1st value, left and right - to 2nd, bottom - to 3rd

    4 values - I think that is clear

    The values should be delimited by spaces.
    CEO of Grandiz! - a team based in Odessa, Ukraine.
    Designing and developing sophisticated web apps on CodeIgniter!

  8. #8
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BenANFA
    What makes you think tables are involved ?
    Because if the guy doesn't know what a div is, he sure won't know about CSS positioning [Edit: and shame on me for not bothering to pester the uneducated about learning CSS!]

    4 values - I think that is clear
    Remember that it goes clockwise, starting at the top.

    So: Top Right Bottom Left

    Douglas
    Last edited by DougBTX; Aug 29, 2003 at 15:58.
    Hello World

  9. #9
    SitePoint Addict Tim_Rogovets's Avatar
    Join Date
    Aug 2003
    Location
    Odessa, Ukraine
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DougBTX
    Remember that it goes clockwise, starting at the top.

    So: Top Right Bottom Left
    Yeah. Forgot to mention that
    CEO of Grandiz! - a team based in Odessa, Ukraine.
    Designing and developing sophisticated web apps on CodeIgniter!


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
  •