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 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS background position when repeating

    Hello,

    I am having problems with this code:

    Code:
    #mainContent {
    
    	background: url(../images/brown-line.jpg) repeat-y right 200px;
    	padding-top: 15px;
    
    }
    I want to position the image 200px down from top right. This is easy if you are not repeating the image also but this seems impossible!

    Basically it's a brown line running down the right side of the div starting 200px from the top.

    Really stuck.

    Ferellie

  • #2
    Regular Coder
    Join Date
    Mar 2008
    Posts
    235
    Thanks
    6
    Thanked 21 Times in 20 Posts
    Quote Originally Posted by ferellie View Post
    Hello,

    I am having problems with this code:

    Code:
    #mainContent {
    
    	background: url(../images/brown-line.jpg) repeat-y right 200px;
    	padding-top: 15px;
    
    }
    I want to position the image 200px down from top right. This is easy if you are not repeating the image also but this seems impossible!

    Basically it's a brown line running down the right side of the div starting 200px from the top.

    Really stuck.

    Ferellie
    Perhaps try this:

    Code:
    #mainContent {
    
    	background: url(../images/brown-line.jpg) repeat-y right 200px;
    	padding-top: 15px;
            margin-top:200px;
    
    }
    depending on your surrounding CSS/HTML this might not work. but margin will be placed outside of the background color/image whereas padding will not.

    hope that helps!
    Andrew Sharman
    Web designer, developer and programmer.

    If you found my post helpful, why not give thanks! :)

  • #3
    New Coder
    Join Date
    Mar 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks but this would move all my content down inside mainContainer, which isn't what I want.


  •  

    Posting Permissions

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