+ Reply to Thread
Results 1 to 10 of 10

Thread: CSS / HTML Help

  1. #1
    lifebynate13 is offline x10Hosting Member lifebynate13 is an unknown quantity at this point
    Join Date
    Jul 2010
    Location
    Portland, OR
    Posts
    7

    CSS / HTML Help

    I'm Designing a site and I used width:100%; to Make the header Span the whole top of the page as was desired but now its overflowing and creating a scrollbar to the side which is undesired. How can i fix but keep it spanning 100%?

    The url is Lifebynate.pcriot.com
    Last edited by lifebynate13; 09-12-2010 at 06:50 PM.

  2. #2
    techairlines's Avatar
    techairlines is offline x10 Flyer techairlines has much to be proud oftechairlines has much to be proud of
    Join Date
    Jul 2009
    Location
    New York City
    Posts
    2,853

    Re: CSS / HTML Help

    The width:100% doesn't seem to necessary in div.head. You already specified that for the div.construction.
    Last edited by techairlines; 09-12-2010 at 07:04 PM.
    Best regards,
    Brian Yang - TechAirlines


    How am I doing? Click the star button at the bottom left to rate this post. Thanks.
    Terms of Service | Account Portal | Wiki

  3. #3
    lifebynate13 is offline x10Hosting Member lifebynate13 is an unknown quantity at this point
    Join Date
    Jul 2010
    Location
    Portland, OR
    Posts
    7

    Re: CSS / HTML Help

    div.Construction is simply a notice that is going to be removed after its done

  4. #4
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: CSS / HTML Help

    100% is the width of the content. Onto that, you have added a border and some padding, so the actual width of the box is 100% plus 4px for the borders plus 15px for the left-side padding. Just leave the 100% out of the deal, and any standards-compliant browser will do what it's supposed to do -- assume that the block-level element spans its entire container. It's only when you specify a width that it should act differently.
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

  5. #5
    lifebynate13 is offline x10Hosting Member lifebynate13 is an unknown quantity at this point
    Join Date
    Jul 2010
    Location
    Portland, OR
    Posts
    7

    Re: CSS / HTML Help

    Thanks Guys.
    I wanted to keep at least the bottom border so i replaced border with border-bottom and I nixed padding-left and it did the trick. If i feel the title needs to be moved over a little bit I'll use a Nbsp or two. Thanks for the Help!

  6. #6
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: CSS / HTML Help

    Quote Originally Posted by lifebynate13 View Post
    If i feel the title needs to be moved over a little bit I'll use a Nbsp or two.
    Bad idea. Don't add meaningless content to affect layout; use styling. Drop the "width: 100%" (as essellar suggests) and you can use padding. Also, use a heading element rather than a division for the heading. Headings are semantic, while divisions aren't.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  7. #7
    friendsplice83's Avatar
    friendsplice83 is offline x10Hosting Member friendsplice83 is an unknown quantity at this point
    Join Date
    Aug 2010
    Location
    Duluth, Minnesota
    Posts
    5

    Re: CSS / HTML Help

    Use...

    <div style="position:absolute; left: 0px; right: 0px;">

    Content.

    </div>

    ... to make content stretch across the whole page. You can customize the background, borders, etc.

    Check out w3schools.com

  8. #8
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228
    Quote Originally Posted by friendsplice83 View Post
    Use...



    Content.




    ... to make content stretch across the whole page. You can customize the background, borders, etc.

    Check out w3schools.com
    Bad idea. W3schools is outdated...

    Misson is correct in this, but also remember this:

    Real measure = size + padding + margin. It doesn't matter if you tell an element to be "100%", since that is a relative figure, it will simply expand to fill the content given.
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  9. #9
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: CSS / HTML Help

    Actually, real measure = content + padding + border + margin (forgetting the border will bite you every time).

    Good news, though -- CSS3 will probably allow us to get back to the intuitive border-box model (where the height and width denote the external dimensions of the content box plus the padding plus the border) if we want using

    Code:
    box-sizing: border-box;
    That's the way it should have been in the first place. No, MS didn't "do it wrong", they invented CSS. Netscape wanted to use JavaScript Style Sheets. Netscape lost, but they were influential enough to make sure that the CSS standard RFC didn't exactly match what Microsoft was doing. The content-box model has always been a disaster from a design/layout perspective, but it was easier to implement in the JSS-to-CSS translation layer in NSN 4.x since it cut down on the recursion. NS never did get CSS support right in Navigator 4.x (their recursion reluctance meant that a style for TABLE didn't apply to a TABLE in a DIV) but they did manage to screw up the standard AND get everybody cursing MS at the same time.
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

  10. #10
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: CSS / HTML Help

    Neither model is unconditionally wrong; they both have their place, depending on whether you're fitting stuff around content (NS's model), or content inside something else (IE's model); I've come across both situations. I'm just glad we will finally have a choice.
    Last edited by misson; 09-13-2010 at 04:52 PM.

+ Reply to Thread

Similar Threads

  1. Replies: 9
    Last Post: 06-25-2010, 12:47 AM
  2. Replies: 1
    Last Post: 05-08-2008, 04:40 PM
  3. Some HTML Help Please?
    By Kraze_T in forum Graphics & Webdesign
    Replies: 11
    Last Post: 03-28-2008, 05:42 AM
  4. Html Help!
    By Magicmac in forum Programming Help
    Replies: 5
    Last Post: 03-28-2008, 04:18 AM
  5. HTML ONLY or a CMS with NO EDITABLE HTML?
    By SykaX in forum Crossfire
    Replies: 7
    Last Post: 11-29-2007, 04:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers