#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0

    Unhappy Need Help with CSS Backgrounds


    Hey guys, I'm in the process of creating a website. On my index page I'm including 3 pictures. A Background, two images with hrefs to Login and Signup.

    So I got everything to work all fine, but because I'm trying hard not to work with position: (don't ask why) I am left with a massive white area if someone is zoomed in or out too far or have a different monitor size. I want to fill this white area with a color, but how would I do so?

    I have set:
    Code:
    body{
        background-image:url(background.png);
    	background-size:1300px;
    	background-repeat:no-repeat;
    }
    
    #create{
    	margin-top:400px;
    	margin-left:490px;
    }
    
    #login{
    	margin-top:1px;
    	margin-left:490px;
    }
    That's all the CSS. As you can see I have positioned things with pixels, so I can use the body as a ratio.

    The HTML goes along the lines of:
    Code:
    	<body>
    		<div id="create">
    			<a href="create.html"><img src="create.png"></img></a>
    		</div>
    		
    		<div id="login">
    			<a href="login.html"><img src="login.png"></img></a>
    		</div>
    	</body>
    So basically I have an area, the whole body, that's one picture and I can only work inside this area. However the outside of the body is just plain white, is there a way I can set this white to a color of my choice? I tried editing the HTML but it just screws it all up..


    If I'm not clear enough, just say.

    thanks for anyone that helps - I'll check here regularly for replies.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0
    Doesn't {background-color: } do the trick?

    Code:
    body{
        background-image:url('mockup.png');
    	background-size:1300px;
    	background-repeat:no-repeat;
    	background-color: blue;
    }
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0

    Yup


    Originally Posted by bradix_14
    Doesn't {background-color: } do the trick?

    Code:
    body{
        background-image:url('mockup.png');
    	background-size:1300px;
    	background-repeat:no-repeat;
    	background-color: blue;
    }
    I had tried stuff, nothing had worked.

    Don't worry anyway, thanks for the help.

    If a Mod stumbles upon this thread, it may be closed!

    I started a whole new design for it.

IMN logo majestic logo threadwatch logo seochat tools logo