html - Line-break after 3 images with css? -
i have 6 icons on website. want 3 of them on 1 line , others on second only when media screen 400px.
should @media screen , (max-width: 400px)
. main problem dont know how make line break 3 icons in first line , next 3 in second line.
.icon { display: inline-block; } #line-break {}
<div class="icon"> <img src="https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/home.png" /> </div> <div class="icon"> <img src="https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/home.png" /> </div> <div class="icon"> <img src="https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/home.png" /> </div> <div id="line-break" class="icon"> <img src="https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/home.png" /> </div> <div class="icon"> <img src="https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/home.png" /> </div> <div class="icon"> <img src="https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/home.png" /> </div>
fiddle: https://jsfiddle.net/ayf8u5s9/
you can insert <br>
tag after third icon , hide when viewport wider 400px media query: @media screen , (min-width: 400px)
demo :
.icon { display: inline-block; } @media screen , (min-width: 400px) { br { display: none; } }
<div class="icon"> <img src="https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/home.png" /> </div> <div class="icon"> <img src="https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/home.png" /> </div> <div class="icon"> <img src="https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/home.png" /> </div> <br> <div class="icon"> <img src="https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/home.png" /> </div> <div class="icon"> <img src="https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/home.png" /> </div> <div class="icon"> <img src="https://cdn4.iconfinder.com/data/icons/24x24-free-pixel-icons/24/home.png" /> </div>
Comments
Post a Comment