Web Analytics Made Easy -
StatCounter Myspace coding help :[ - CodingForum

Announcement

Collapse
No announcement yet.

Myspace coding help :[

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    To center something using CSS you need to add this into your CSS rule:
    Code:
     div.topbanner {
     position: absolute;
     margin-top: 0%; 
    [COLOR="DarkRed"] [B]margin-left: auto;
     margin-right: auto;[/B][/COLOR]
     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; Apr 5, 2009, 09:10 PM.
    Validate CSS
    Try it
    Learn CSS
    ColorPicker
    Validate

    Comment


    • #3
      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

      Comment


      • #4
        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?

        Comment


        • #5
          Got it, thanks guys

          Comment

          Working...
          X