Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Div and background repeat

    Code:
    <style>
    #bottombar{
    	background-color: #0ff000;
        position:fixed;
        top:92%;
        left:0;
    	width:100%;
    	z-index:10;
    }
    #topbar {
        background-color: #0ff000;
        position:fixed;
        bottom:93%;
        top:0;
        left:5px;
        width:100%;
        z-index:10;
    }
    #loading {
        position:fixed;
        top:50%;
        left:25%;
    	width:100%;
    	z-index:10;
    }
    
    </style>
    <div id="topbar"><img align="middle" src="top.jpg" /></div>
    <div id="bottombar"><img align="middle" src="bottom.jpg"/></div>
    <div id="loading"><img align="middle" src="loading.gif"></div>
    Right now I have the above to create a bar at the top and a bar at the bottom of the screen. However my bar currently is a jpg that is 400px long and doesnt go across the top from left to right fully on all screens.

    What I want instead is a 1px jpg that is repeated in the x direction across the screen at the top and bottom of the screen.

    How owuld I go about this using divs. I've tried the usual backround image and background repeat code but it doesnt seem to work.

    HELP!

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello HIPPY,
    Right now your images are not background images so you would not be able to repeat them.

    Try one like this instead -
    Code:
    #bottombar{
    	background: #0ff000 url(bottom.jpg) repeat-x;
        position:fixed;
        top:92%;
        left:0;
    	width:100%;
    	z-index:10;
    }
    and
    Code:
    <div id="bottombar"></div>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I tried that, nothing shows up at all.

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    You'd need to set some height values in CSS for your empty divs!
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •