Help - Search - Members - Calendar
Full Version: background doesnt show up
HTMLHelp Forums > Web Authoring > Cascading Style Sheets
konqrr
I cant get my background image to display and my project is due in like 2 days. Could someone help me out? Here is the code:

CODE
<hmtl>

    <head>
        <title>The Best Site for...</title>
        <style type="text/css">
            body {
                background-image: url ('http://img147.imageshack.us/img147/9826/background3wu4.jpg');
                background-repeat: no-repeat;
                background-position: center;
            }
            img.leftmargin {
                    margin-left:px;
                    margin-top:px;
                }
            img.leftmargin2 {
                    margin-left:px;
                }
                              <!-- ok, so for "top"
                            margin value the greater
                            amount controls it. for ex.
                            the "0px" has no effect. so
                            only one top margin value
                            is needed. also,
                            for img2, the left margin controls
                            how far it is from the first pic,
                            not from the left of the browser...
                            unlike pic 1 where margin left
                            controls how far it is from the
                            left of the browser -->
            img.leftmargin3 {
                    margin-left:px;
                }
            img.leftmargin4 {
                    margin-left:px;
                }
            img.leftmargin5 {
                    margin-left:px;
                }
            img.leftmargin6 {
                    margin-left:px;
                }
        </style>

    </head>    

    <body>
<!-- <img class="leftmargin" src="xxx.jpg"> -->
<!-- <img class="leftmargin2" src="xxx.jpg"> -->
<!-- <img class="leftmargin3" src="xxx.jpg"> -->
<!-- <img class="leftmargin4" src="xxx.jpg"> -->
<!-- <img class="leftmargin5" src="xxx.jpg"> -->
<!-- <img class="leftmargin6" src="xxx.jpg"> -->


        
    </body>

</html>


PS, I tried hosting on photobucket too, it still doesnt work sad.gif
Christian J
CODE

background-image: url ('http://img147.imageshack.us/img147/9826/background3wu4.jpg');


There's a space after "url".

Some other issues:

CODE

margin-left:px;


No value before the px unit.

CODE

<!-- ok, so for "top"
....
left of the browser -->


Comments inside a style sheet should look like this:

CODE

/* comment */


Here are good tools for checking CSS errors:
http://jigsaw.w3.org/css-validator/
http://htmlhelp.com/tools/csscheck/
konqrr
QUOTE(Christian J @ Sep 26 2006, 10:33 AM) *

CODE

background-image: url ('http://img147.imageshack.us/img147/9826/background3wu4.jpg');


There's a space after "url".

Some other issues:

CODE

margin-left:px;


No value before the px unit.

CODE

<!-- ok, so for "top"
....
left of the browser -->


Comments inside a style sheet should look like this:

CODE

/* comment */


Here are good tools for checking CSS errors:
http://jigsaw.w3.org/css-validator/
http://htmlhelp.com/tools/csscheck/


OMG I love you. Thank you so much. I was asking my programming teacher all day about this and she didnt know what the problem was. You were a huge help, thank you soooo much biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.