SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    May 2004
    Location
    Ireland
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Putting a border around two elements at once

    I need to create a 1px border around a header and a bulleted list so that they appear as if they are in a box. I'm not using tables, so can't border a td. When I tried to compromise and put the header outside the box, I still had a problem with the ul - if the position of the bullets is 'outside', they stay outside the border; if it is 'inside', the second line of two-line text begins under the bullet - messy!
    I would be glad of any help.

  2. #2
    SitePoint Addict jodmcc's Avatar
    Join Date
    Dec 2003
    Location
    Houston, Texas
    Posts
    227
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are using it in a form you can use < fieldset> and < legend>

    John

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2004
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it an option to encapsulate the two elements in an additional <div>, to which you then add the border?

  4. #4
    SitePoint Member
    Join Date
    May 2004
    Location
    Ireland
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jodmcc
    If you are using it in a form you can use < fieldset> and < legend>

    John
    No its not a form, I am trying to replicate a print layout that has text enclosed in boxes that fit into the flow of the rest of the text.

  5. #5
    SitePoint Member
    Join Date
    May 2004
    Location
    Ireland
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Claymore
    Is it an option to encapsulate the two elements in an additional <div>, to which you then add the border?
    Thanks for that. What a relief! It works! I'm new to Css and hadn't set up a <div> before.

  6. #6
    SitePoint Enthusiast
    Join Date
    May 2004
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem. To be honest, in CSS, when doing tableless designs, I think <div>'s are the most used elements. It might be an idea to have a closer look at what you can achieve with them, since you might need them a lot more if you decide to continue designing with CSS.


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
  •