20070401

Add Image to Top of MySpace Page

Adding an image to the top of your myspace page, above the ad banner

For a longer article on this subject, with more examples go here:
Adding Custom Banner to Top of Myspace Band Page
I wrote it for the band page, but all but one of the examples works on the regular page as well.

Note: I have read, in a popular myspace forum, that it is against the Terms of Service to move the ad banner down. However, I did not find this in the terms when I read them. No one has been able to tell me where, in the terms of service, this information resides. The Terms of Service do state that it is against the rules to OBSCURE the ad banner. Read the rules yourself and use your own judgement.

Instructions for Placing your own image banner above the Ad Banner:

First move down the rest of the page by adding a top margin:
<style type="text/css">
{!- Move Profile down to accommodate banner above profile -!}
body {margin-top: 90px;}
{!- below line is for profiles which have rendered div img hidden or display none -!}
div.myBannerClass img {display:inline; visibility:visible};
</style>
(adjust px value as needed based on the height of your picture)

Next I create a div for my picture.
As an example I will use this banner.
test banner
To find my banner size I use it as the url and open the page:
mouse-right-click -> properties.
A small popup will tell me the width and height.
For this one it is 729 x 90
Half of 729=364.5

So my code to place the banner looks like this:
<div class="myBannerClass" style="position:absolute;left:50%; 
top:0px; margin-left: -364.5px; width: 729px; height: 90px; visibility:visible;">
<img src="http://i178.photobucket.com/albums/w275/madeline_fogg/smiley-banner2.jpg" border="0">
</div>

Just replace with your own px values (based on your picture size) and the location of your own picture.

Turning the image into a link
If you want your image to act as a link, use this code instead of the above block.
<div class="myBannerClass" style="position:absolute;left:50%; 
top:0px; margin-left: -364.5px; width: 729px; height: 90px; visibility:visible;">
<a href="http://spiff-myspace.blogspot.com">
<img src="http://i178.photobucket.com/albums/w275/madeline_fogg/smiley-banner2.jpg" border="0"></a>
</div>

For band (or other artist) profile add code to the bio section
For standard profile, you can add the code to the about me section.

[note: there are other locations the code can be added to as well, the best location depends on what else you are doing on your page and how the rest of your customizing code is (or is not) organized]

You can also utilize the navigationBar as a means of getting accurate placement of a banner.
By using the navigationBar, and the background-image property, we can get accurate placement without any reliance on absolute positioning.
IF you are keeping the google search, or placing the banner below the top navigationBar, this method has much better accuracy then the the above method.

<span class="off">!-START Block to Place Custom Banner at top of navigationbar. 
This works for Artist/Band page and Standard Page-!</span>
<style>
{!-make room for banner-!}
div table.navigationBar table {margin-top:100px;}
{!-place image as background to outer table of navigationbar-!}
div table.navigationBar {background-image: url(http://i10.tinypic.com/639n3br.jpg) !important;
background-repeat: no-repeat !important;
background-position: top center !important; width:800px !important}
{!-allow image to show through td coloring-!}
div table.navigationBar td {background-color:transparent !important}
{!-restore or custom set background color to navigationbar-!}
div table.navigationBar table {background-color:lightblue}
</style>
<span class="off">!-END Block to Place Custom Banner top of navigationBar -!</span>

Replace my url with the url of your image.
If you want to put the banner below your navigationbar, change top to bottom (in both places).

Blog Archive

About This Blog

I am in the process of moving my myspace content to this blog.
Right now it is split between 4 different blogs.
I started playing with myspace code customization in late February 2007 after my niece convinced me to get a page.
When I first started writing code for people, I had no intent of publishing any of it, or even writing as much as I did.

I do not claim that all of my code is better than anything else out there. I have come across a few pages with some pretty good code on them. But for the most part, the same exact codes, with the same side effects and same lack of comments exists on many many pages.
My code is my own. Only the very simple routines (those where the best solution is obvious) are the same as the masses. If I find something good out there, that I did not write myself, I will link to it instead of re-creating it.
First I will test it.