Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fixed Position in responsive design

I am using responsive framework 1140px. In the mobile version I have to fix the position of a logo but not have it overlap the content on scroll. Basically fix the position but don't fix the image on scroll, can this be achieved?

like image 386
User_coder Avatar asked Sep 27 '26 01:09

User_coder


2 Answers

You want to use position:absolute

  • position:fixed fixes the element to the screen, so it will not move when you scroll (it's fixed to the window).

  • position:absolute fixes the element based on the closest ancestor that is not position:static, so it will move when you scroll the page (it's fixed to the page).

like image 72
Daniel Imms Avatar answered Sep 28 '26 21:09

Daniel Imms


It appears that you want is position: absolute, the difference being that absolute images do not move while scrolling.
http://www.impressivewebs.com/absolute-position-css/

It's worth taking a look at this link in order to see the differences between relative, absolute, and fixed positioning:
http://css-tricks.com/absolute-relative-fixed-positioining-how-do-they-differ/

like image 26
Bernie Avatar answered Sep 28 '26 21:09

Bernie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!