Jump to content

Image resizing for different screen resolutions


wow

Recommended Posts

Hi all,

 

I'm setting up an artist page on myspace and am having a hard time trying to keep my top image fixed with different screen resolutions. I'm working in the standard 1024x768 and when I change resolution my top banner image shifts to the left of the screen and does not resize to fit screen resolution.

 

I'm learning myspace css as I go...

 

Can any help?

 

My codes are as follows:

 

 

body{

background-position:top center;margin-top: ;}

 

div.topbanner {

top: 0;

left: 20%;

margin-left: -200px;

width: 100%;

height: px;

position: absolute;

}

 

MY PIC URL IN HERE

 

body{background:url("MY 2ND PIC URL IN HERE") left repeat-y;}

 

 

Body{margin-top: 300; background-color:black; background-attachment: fixed; background-position: top center; background-repeat: no-repeat; scrollbar-track-color:v; scrollbar-face-color:000000; scrollbar-highlight-color:abaaaa ; scrollbar-base-color:000000; scrollbar-DarkShadow-color:red; scrollbar-Shadow-color:white; scrollbar-arrow-color:red; cursor: url(http://www.fileden.com/files/2009/1/22/2279715/ND.cur); a:hover{cursor:url(CURSOR PIC URL HERE);}

 

 

Thank you

Link to comment
Share on other sites

The position: absolute method of centering is to use left: 50%; margin-left: negative half the div or image width; so edit:-

body{

background-position:top center;margin-top: ;}

 

div.topbanner {

top: 0;

left: 50%;/*was 20%;*/

margin-left: -200px; /*edit to - half the width*/

width: 100%;

height: px;

position: absolute;

}

 

 

You should not have a div in between style tags in the head section, move it into the body section.

Link to comment
Share on other sites

  • 3 weeks later...

Hey Wickham or anyone else

 

Your good advice has solved part of my problem.

 

My top banner image now stays fixed on different screen resolutions when viewed on my pc and monitor BUT when viewed on an apple with a 22 or 24 inch screen the image shifts to the right!!!

 

Can you help me with me with keeping this image fixed on bigger monitors?

 

Cheers

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...