Excuse my ignorance and let me explain.
I would like a div to be always fully visible in a web-page. Its a div that contains a random picture and after that is a "Read more" button . So it would be nice if the image fits the div and the div and the button are always visible, when the page is fully scrolled up.
So, its the header and then the "container div". Inside the "container div", the first thing on top is that "read more" div. Not position : fixed
cause this does not work well in mobiles. I guess I have to do something like
width : 50%
height :
get the current height of the screen - height of the header = this is where it begins
get the current height of the screen - height of the footer - height of a text - height of a button = this is where it stops
But how do I do this? The height to be a result of the screen's dimensions, and based on percent rates, so its also responsive design
Also, the div contains a random image that have to be automatically resized to fit and not get stretched.
By random I mean its maybe "portrait shaped" or maybe "landscape shaped". I read this article but setting only width:100%
stretches "portrait shaped" images.
How can I fix this?
Thanks in advance
Sorry for my english.