SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard Another Designer's Avatar
    Join Date
    May 2005
    Posts
    1,370
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Is it neccessary to use div sizes?

    Is it necessary to use a size for a div when it's around a banner?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,112
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    You probably need to give more info about what you mean by "size". A containing div will expand to width: 100% unless told otherwise.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Wizard Another Designer's Avatar
    Join Date
    May 2005
    Posts
    1,370
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    You probably need to give more info about what you mean by "size". A containing div will expand to width: 100% unless told otherwise.
    Okay. I have a Div that is holding a banner that is 800 px wide. It is not wrapped around the width of the banner. The div goes from one end of the interface to the other.

  4. #4
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,656
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    I'll assume the banner is an img. Therefore the image will be left aligned. The div will go 100% width by default. If you want it left aligned then no a width is not necessary. If you want the img centered the width is still not necessary.

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,112
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Another Designer View Post
    The div goes from one end of the interface to the other.
    Yes, that's what I meant by it stretching to width: 100% by default. There are various things you could do, like giving the div a width of 800px or perhaps even floating it, but we'd really need to see this in context to know what will work best in this case, as there are quite a few variables involved.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  6. #6
    SitePoint Wizard Another Designer's Avatar
    Join Date
    May 2005
    Posts
    1,370
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Yes, that's what I meant by it stretching to width: 100% by default. There are various things you could do, like giving the div a width of 800px or perhaps even floating it, but we'd really need to see this in context to know what will work best in this case, as there are quite a few variables involved.
    Thanks. I'll PM it to you. I just want it centered on the page.


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
  •