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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Myspace coding help :[

    Code:
    <style>
    body {
    margin-top: 330px; 
      
     }
    
     div.topbanner {
     position: absolute;
     top: 0%; 
     left: 24%;
     width: 800px; <--- set your image width
     margin-left: -400px; <---- make this HALF your image width.
     height: 192px; set the height of the image. Should be less then the Margin height set in the body.
     }
    </style>
    
    
    
    <div class="topbanner">
    <img src="http://i43.tinypic.com/106y977.png" />
     </div>
    That's the code I use for the top banner on my myspace, it centers it on my computer but when i go on others it's not centered, what's the fix :[ anyone know please?


    www.myspace.com/imclintoncole

    also I want the background to start orange (the color of the lines on my myspace) and to fade into white && I Know how to do it if I were to just create a giant background but it never looks the same on other computers, someone help please :[

  • #2
    Regular Coder
    Join Date
    Mar 2009
    Location
    Troutdale, OR
    Posts
    145
    Thanks
    12
    Thanked 6 Times in 6 Posts
    To center something using CSS you need to add this into your CSS rule:
    Code:
     div.topbanner {
     position: absolute;
     margin-top: 0%; 
     margin-left: auto;
     margin-right: auto;
     width: 800px; 
     height: 192px;
    }
    
    margin-left: auto;
    margin-right: auto;
    You can find all needed info related to the CSS backgrounds here.

    I hope this help you out.
    Best regards.
    Last edited by RomanTaylor; 04-06-2009 at 02:10 AM.

  • #3
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <style>
    body {
    margin-top: 330px; 
      
     }
    
     div.topbanner {
     position: absolute;
     margin-top: 0%; 
     margin-left: auto;
     margin-right: auto;
     width: 800px; 
     height: 192px;
    }
    
    margin-left: auto;
    margin-right: auto;
    </style>
    
    
    
    <div class="topbanner">
    <img src="http://i43.tinypic.com/106y977.png" />
     </div>
    It shows the image under my "About me" after I changed the code to what you posted

  • #4
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Alright so I switched

    Code:
    margin-top: 0%;
    to
    Code:
    top: 0%;
    && now it's at the right position vertically, but not horizontally. Any ideas?

  • #5
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Got it, thanks guys


  •  

    Posting Permissions

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