Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4

Thread: css won't work

  1. #1
    Member ravage's Avatar
    Join Date
    Apr 2011
    Posts
    92
    Member #
    27355
    Liked
    2 times
    Hi,

    I'm getting back into web coding and I'm doing some work on a project site of mine. My problem is I'm trying to create a box that spans the entire height of a page and has some bit of a margin so that the background color can be seen on the right/left margins. For some reason I can't get the box to show up. I've inserted filler text into the div on the pages code so I can see how things change when I manipulate the code. I've even tried copying some css from another site and using that as the id code and that still does not work. The page I'm working on is located at http://www.atrociousallurement.com/receats.html and the css file for this page is located at http://www.atrociousallurement.com/i...receatsCSS.css .Both the html and css files validate against w3schools standards. Can someone please help?

    Thanks!
    -Ravage

  2.  

  3. #2
    Member ravage's Avatar
    Join Date
    Apr 2011
    Posts
    92
    Member #
    27355
    Liked
    2 times
    oh, and the id in the css file is #vertical_background

  4. #3
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    First of all, your div id in your stylesheet is just a bit off - check your spelling of backg[COLOR=rgb(255, 0, 0)]r[/COLOR]ound :

    And to fix the problem, you need to understand that in your CSS if you specify the width as 100%, you will get no space on either side.

    [COLOR=rgb(0, 0, 0)]What you have is this:[/COLOR]
    [COLOR=rgb(0, 0, 0)]#vertical_backgound {[/COLOR]
    [COLOR=rgb(0, 0, 0)] height: 100%; [/COLOR]
    [COLOR=rgb(0, 0, 0)] [COLOR=rgb(255, 0, 0)]width: 100%;[/COLOR] [/COLOR]
    [COLOR=rgb(0, 0, 0)] background-color: #fbeb96; [/COLOR]
    [COLOR=rgb(0, 0, 0)] margin-left: 0px 50px 0px 50px; [/COLOR]
    [COLOR=rgb(0, 0, 0)] }[/COLOR]

    [COLOR=rgb(0, 0, 0)]What you need is this:[/COLOR]
    [COLOR=rgb(0, 0, 0)]#vertical_background { [/COLOR]
    [COLOR=rgb(0, 0, 0)] height: 100%;[/COLOR]
    [COLOR=rgb(0, 0, 0)] width: 80%; /*or whatever percentage you want*/ [/COLOR]
    [COLOR=rgb(0, 0, 0)] background-color: #fbeb96;[/COLOR]
    [COLOR=rgb(0, 0, 0)] margin: auto[/COLOR]
    [COLOR=rgb(0, 0, 0)] }[/COLOR]

    [COLOR=rgb(0, 0, 0)]Check it out here - use that as a starting point and play with it from there.[/COLOR]
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  5. #4
    Member ravage's Avatar
    Join Date
    Apr 2011
    Posts
    92
    Member #
    27355
    Liked
    2 times
    Thanks, I had an inkling that it was someone small (like a mis-spelling) that was causing it not to work.
    Much obliged for your help!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:58 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com