Hi everyone,
I just wanted to check if someone might have and idea how to serve different sized background image on a page depending on the screen size (media query).
So basically I have created one cms image field with different thumbnail sizes which I want to be used for corresponding screen width as you would with media query as I can't use the <cms:show blog_image /> in the css right? I hope this makes sense lol..
and the tag where I define above image:
Many thanks!
I just wanted to check if someone might have and idea how to serve different sized background image on a page depending on the screen size (media query).
So basically I have created one cms image field with different thumbnail sizes which I want to be used for corresponding screen width as you would with media query as I can't use the <cms:show blog_image /> in the css right? I hope this makes sense lol..
- Code: Select all
<cms:editable name='blog_image'
crop='1'
width='1920'
height='1080'
type='image'
quality='55'
/>
<cms:editable
name='blog_image_mid'
label='Blog Image 1440 mid'
desc='Mid res of main blog image'
width='1440'
quality='60'
show_preview='1'
preview_width='175'
assoc_field='blog_image'
type='thumbnail'
/>
<cms:editable
name='blog_image_small'
label='Blog Image 700 small'
desc='Small res of main blog image'
width='700'
quality='60'
show_preview='1'
preview_width='175'
assoc_field='blog_image'
type='thumbnail'
/>
and the tag where I define above image:
- Code: Select all
<div class="page-header full-screen table overlay" style="background-image: url(<cms:show blog_image />);">
Many thanks!