SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Non-Member MaxLax44's Avatar
    Join Date
    Sep 2005
    Location
    Rochester, NY
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Background Properties

    I've been graphic designing for a while but just started web design and am working on my own site. I made a background code to have an image centered and repeat only on the y axis with a black background. Is this the right way to write it?

    Code:
    		body {
    		background: black ("Background.jpg");
    		background-repeat: repeat-y;
    		background-position: 50% 0%;
    		}
    Also, how do I get it to work? Probably seems like a completely stupid question but that's it. The rest of my site is just HTML and JAVASCRIPT. Do i need to write something in the header to get CSS to work? Thanks in advance.

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,122
    Mentioned
    29 Post(s)
    Tagged
    2 Thread(s)
    Is this the right way to write it?
    Almost there..
    To make it work you need to include it into the page either in an external CSS file or embedded stylesheet, both are below and need to be placed in the head of your document.
    Embedded
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <style type="text/css">
    <!-- 
    body {
      background: black url("Background.jpg") repeat-y 50&#37; 0;
    }
    -->
    </style>
    </head>
    <body>
    </body>
    </html>
    External - You need to save a new text file called stylesheet.css with
    Code:
    body {
      background: black url("Background.jpg") repeat-y 50% 0;
    }
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <link rel="stylesheet" type="text/css" href="stylesheet.css">
    </head>
    <body>
    </body>
    </html>

  3. #3
    Non-Member MaxLax44's Avatar
    Join Date
    Sep 2005
    Location
    Rochester, NY
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perfect! Thanks!


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
  •