html - How to make images appear side by side on one row on desktop, but responsive and centered above each other on mobile? -
we have 2 pages we're trying have images appear in 1 row side-by-side when viewing on desktop , tablet, responsive , centered above 1 on mobile. it's working on 1 page , not on other-- i'm assuming because images wide on pages breaks, makes me think entire code faulty. tips? suggestions?
the pages are--
http://www.vaporfresh.com/pages/retailers
the css--
div.jumbo { background-color: #fff; width: 100%; margin: 6px auto; padding: 2px; text-align: center; } .jumbo img { padding: 8px; display: inline; } @media (max-width: 768px) { .jumbo img { display: block; margin: 5px auto; } }
the html--
<div class="jumbo"> <a href="http://www.amazon.com/gp/aag/main/ref=as_li_ss_tl?ie=utf8&asin=&camp=1789&creative=390957&isamazonfulfilled=1&iscba=&linkcode=ur2&marketplaceid=atvpdkikx0der&orderid=&seller=a1zsbt0hod7th4&sshmpath=&tag=rawathletics-20&linkid=l74xryus7rojtoxl" target="_blank" rel="nofollow"><img src="//cdn.shopify.com/s/files/1/0943/1886/files/rsz-amazon-logo.jpeg?11379810593739760604" /></a> <a href="http://www.soap.com/buy/brand=vapor+fresh" target="_blank" rel="nofollow"><img src="//cdn.shopify.com/s/files/1/0943/1886/files/soap_logo_cmyk.jpg?14350831404106169407" /></a> <a href="http://www.vinemarket.com/buy/brand=vapor+fresh" target="_blank" rel="nofollow"><img src="//cdn.shopify.com/s/files/1/0943/1886/files/vinemarket_logo_cmyk.jpg?14350831404106169407" /></a> <a href="http://www.roguefitness.com/catalogsearch/result/?q=vapor+fresh" target="_blank" rel="nofollow"><img src="//cdn.shopify.com/s/files/1/0943/1886/files/roguefitness-vapor-fresh.jpg?14350831404106169407" /></a> </div>
https://jsfiddle.net/juk6ynd4/
your code correct, work fine. looking @ site you're using
width: 100%;
however images in grid, you'll need through , limiting sizes. example you've this:
#div1 { width: 50%; } #div2 { width: 100%; }
then
<div id="div1"> <div id="div2"> div not bigger 50% due scaling of div1! </div> </div>
Comments
Post a Comment