• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

Vertically Fixed Position?

Is there a way to force an image to be vertically fixed but not horizontally?  I need this because i am creating a side scrolling web page and need an image to move up or down when a browser is re-sized.  If the position is fixed, the page does not scroll left or right so i just need it to be fixed vertically.  

Thanks in advance
0
Miles1317
Asked:
Miles1317
2 Solutions
 
quincydudeCommented:
do u mean something like the following

position:fixed;
left:50px;
top:50px;
0
 
AnimasuCommented:
If you know the size of the image it is simple, First you need to get the size and halve it, I'll use 500x500px for example
Make a div which will hold the image and position it like so
CSS //
.image{position:absolute;top:50%;margin-top:-250px;background:red;}
HTML//
<div class="image"> Place the image here </div>

Ignore the background red, its just to see where abouts it ends up. You can add widths & heights if you want to but its not nessecary

Regards
0
 
GaryCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now