Jump to content


a pic to the Top left


3 replies to this topic

#1 CornWheel

    Young Padawan

  • Members
  • Pip
  • 15 posts
  • Location:Vancouver Island, BC, Canada

Posted 07 February 2006 - 09:40 PM

Whats the code to get an image all the way to the top left of the page other then just leaving a little space?

and I have another question. how do I put a bg aligned to the left but make the image stack ontop of eath other other then tile it?

#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 07 February 2006 - 11:03 PM

First question:
Add the following to your CSS.
html,body { margin:0; padding:0; }
That won't move the picture itself, but it will remove the gap thus making the picture move.

Second question, needs a little more explaining, and maybe an example. Simple reason being, background images automatically tile themselves.

#3 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 08 February 2006 - 12:37 AM

body { margin:0; padding:0; }
its better to remove the html part, so this way, it appears the same in ie,ff,opera,etc. if you add html, in there, the entire margin becomes around -5 pixels in IE

and the 2nd question. use
body{
background:url(image.gif) repeat-y;
background-position:left;
}

or instead of using let, you can use pixels e.g. background-position:0 20px;
0 is the top and 20 is for the left side.

Edited by coolaid, 08 February 2006 - 12:38 AM.


#4 greg

    Jedi In Training

  • Members
  • PipPip
  • 499 posts
  • Location:New York City
  • Interests:Fine art, web and graphic design, naval architecture, chess, and sports.

Posted 08 February 2006 - 07:56 AM

Just a quick tip: You can just add "left" to the "background" attribute; there's no need for "background-position."

body {
background: url(image.gif) left repeat-y;
}






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users