I am developing a website for a client based upon Google material design (i.e. heavy use of cards).
What I am wanting is to have the first card of the page be constantly peeking just above the bottom of the screen at the half way point of the floating action button like in the image below.
My problem is that this does not work well when the site is being viewed on different devices with screen resolutions. I have tried using percentage and em's to pad this card from the top but these have failed and the card changes position. My remaining option would be to use media queries but this would potentially prove to be convoluted.
The following is the CSS for the card as it currently exists:
box-shadow: 0px 0px 15px 0px rgba(0,0,0,0.3);
Use vw (viewport width) instead of percentage. 1vw = 1/100th of the viewport width - regardless of device PPI, etc. So, if you want the div to remain proportionally fixed regardless of device size and scren resolution - set your horizontal axis position with VW.