Results 1 to 9 of 9

Thread: Help with backround in html

  1. #1
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with backround in html

    Ok, I have been having problems with html background. I have made two files the index and the style.css. I am just confused all around. Please help. I would like the background not just over the text in the body but that is what is happening. Please help.

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Please post a link to the page on your site that contains the problematic script or attach your code so we can check it out and help you.
    And also, please try to explain your question again, I don't really understand what you want.

  3. #3
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok here are my two files. I have the gradient that i made also posted. Right now the gradient goes over the text in the body, but i would like it to be the background and the content area where the text goes still white.

  4. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    The background doesn't go over the text, it's just that it's almost black at the top and since the text is also black you can't see it. You can make the text white to see that the text is indeed on top:
    Code:
    #body {
    	text-align: center;
    	width: 700px;
    	background: #115c2b url(background.png) repeat-x;
    	color: #fff;
    }
    What you can do is position the background from the bottom so the lighter part is showing instead:
    Code:
    #body {
    	text-align: center;
    	width: 700px;
    	background: #115c2b url(background.png) bottom repeat-x;
    }
    Good luck!

  5. #5
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok i see what u r saying. But, i would like the gradient picture to be the backround around the 700px center. And then i would want the text area to be white.

  6. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    At the top of your style file add:
    Code:
    body {
      background: url(background.png) repeat-x;
    }
    And change your #body to:
    Code:
    #body {
    	text-align: center;
    	width: 700px;
    	background: #FFF;
    }
    Jeremy | jfein.net

  7. #7
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I don't understand you. #body is getting an element with the id of body. Body is getting the body tag.

    Your css should look like this:
    Code:
    body
    {
     background: url(background.png) repeat-x;
    }
    #nav
    {
     height: 30px;
     margin: 0px auto;
     width: 700px;
    }
    #nav ul
    {
     list-style: none;
     margin: 0px;
     padding: 0px;
    }
    #nav li
    {
     display: inline;
    }
    #nav a
    {
     background: #cac8c8;
     color: #000000;
     display: block;
     float: left;
     font-weight: bold;
     padding: 7px 0px;
     text-align: center;
     text-decoration: none;
     text-transform: uppercase;
     width: 140px;
    }
    #nav a:hover
    {
     background: #7e7e7e;
    }
    #body
    {
     background: #FFF;
     text-align: center;
     width: 700px;
    }
    Jeremy | jfein.net

  8. #8
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok thank you so much for all of ur help that is exactly what i meant!
    But i have one more thing, the background looks to choppy with the black lines. Is there anyway to change anything to blend the background more like the background of www.scriptcore.net

    I have attached the files so you can see what i mean

  9. #9
    Join Date
    Feb 2009
    Posts
    159
    Thanks
    60
    Thanked 3 Times in 3 Posts

    Default

    Your poblem if it is choppy is because of the resolution of the image you are using. you need to create a higher end image so that this dose not occer. Go with a jpeg and set the settings of the image to the maximum quality. This will improve the image and should sharpen up the image perfectly.

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
  •