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 to the CF scene
    Join Date
    May 2012
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    When I center background image, it moves down

    Trying to set up wordpress blog page here: http://www.solarallianceofamerica.com/blog/

    Trying to make a background image with white in the middle for the blog text. Here's the code for the image:

    Code:
    body {
        margin:0;
    	padding:0;
    	font-family:Arial, Helvetica, sans-serif;
    	font-size:14px;
    	line-height:12pt; 
    	background:url(http://www.solarallianceofamerica.com/images/bgimg-blog.jpg) center repeat-x;
    	}
    Here's an image of it centered:



    Here's an image of it not centered (Varies depending on resolution, obviously not what I want):



    I have no idea why it moves down. Thanks for any help.

    fourfins

  • #2
    New Coder
    Join Date
    Nov 2010
    Location
    Virginia,USA
    Posts
    36
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Try this in your background rule:

    Code:
     background:url(http://www.solarallianceofamerica.com/images/bgimg-blog.jpg) top center repeat-x;

  • Users who have thanked badwolf for this post:

    fourfins (05-19-2012)

  • #3
    New to the CF scene
    Join Date
    May 2012
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks, that worked.

  • #4
    New Coder
    Join Date
    Nov 2010
    Location
    Virginia,USA
    Posts
    36
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by fourfins View Post
    Thanks, that worked.
    Your welcome! Good luck with the project.


  •  

    Posting Permissions

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