We help IT Professionals succeed at work.

Vertically Fixed Position?

Miles1317
Miles1317 asked
on
Medium Priority
321 Views
Last Modified: 2013-07-29
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
Comment
Watch Question

do u mean something like the following

position:fixed;
left:50px;
top:50px;

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Commented:
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
CERTIFIED EXPERT
Expert of the Year 2014
Top Expert 2014

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.