Created
August 12, 2013 17:01
A CodePen by Arbaoui Mehdi. Responsive lists and images - Responsive list like Dribbble. Full preview: http://cdpn.io/kmcvE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="navbar navbar-inverse navbar-fixed-top"> | |
<div class="container"> | |
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse"> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</button> | |
<a class="navbar-brand" href="#">Responsive Image</a> | |
<div class="nav-collapse collapse"> | |
<ul class="nav navbar-nav"> | |
<li class="active"><a href="#">Home</a></li> | |
<li><a href="#about">About</a></li> | |
<li><a href="#contact">Contact</a></li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
<!-- Responsive Image --> | |
<div class="container"> | |
<div class="starter-template"> | |
<ul> | |
<li><img src="http://dribbble.s3.amazonaws.com/users/31348/screenshots/1185698/slightly_stoopid_teaser.jpg" alt=""></li> | |
<li><img src="http://dribbble.s3.amazonaws.com/users/12/screenshots/1185739/google_chromescreensnapz001_teaser.png" alt=""></li> | |
<li><img src="http://dribbble.s3.amazonaws.com/users/22225/screenshots/1185692/cooper_workshop_teaser.jpg" alt=""></li> | |
<li><img src="http://dribbble.s3.amazonaws.com/users/565/screenshots/1186432/kreyos_sport_mode_1x.jpg" alt=""></li> | |
<li><img src="http://dribbble.s3.amazonaws.com/users/6014/screenshots/1186351/oliver.jpg" alt=""></li> | |
<li><img src="http://dribbble.s3.amazonaws.com/users/93631/screenshots/1185715/drip-lion.jpg" alt=""></li> | |
<li><img src="http://dribbble.s3.amazonaws.com/users/104062/screenshots/1186702/pw_1x.png" alt=""></li> | |
<li><img src="http://dribbble.s3.amazonaws.com/users/7528/screenshots/1186361/genesisproject_1x.jpg" alt=""></li> | |
<li><img src="http://dribbble.s3.amazonaws.com/users/2896/screenshots/1186026/free_to_be_1x.png" alt=""></li> | |
<li><img src="http://dribbble.s3.amazonaws.com/users/2559/screenshots/1185760/screen_shot_2013-08-06_at_10.32.27_am.png" alt=""></li> | |
<li><img src="http://dribbble.s3.amazonaws.com/users/4737/screenshots/1178958/untitled-1_1x.png" alt=""></li> | |
<li><img src="http://dribbble.s3.amazonaws.com/users/4737/screenshots/1186176/site_1x.jpg" alt=""></li> | |
</ul> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
padding-top: 50px; | |
background: #f8f8f8; | |
} | |
img { | |
max-width: 100%; | |
max-height: 150px; | |
} | |
ul{ | |
padding: 0; | |
} | |
.content { | |
width: 970px; | |
margin: 0 auto; | |
} | |
.starter-template { | |
margin-top: 30px; | |
} | |
.starter-template li { | |
width: 20%; | |
position: relative; | |
float:left; | |
list-style: none; | |
background: #fff; | |
padding: 10px; | |
margin-bottom: 20px; | |
margin-right: 20px; | |
-webkit-border-radius: 3px; | |
-moz-border-radius: 3px; | |
border-radius: 3px; | |
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07); | |
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07); | |
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07); | |
} | |
@media (max-width: 315px) { | |
.starter-template li { | |
margin: 0 0 3px 3px !important; | |
} | |
} | |
@media (max-width: 735px) and (min-width: 450px) { | |
.starter-template li { | |
width: 30%; | |
margin-right: 0; | |
margin-left: 15px; | |
} | |
} | |
@media (max-width: 450px) { | |
.starter-template li { | |
width: 45%; | |
margin-right: 20px; | |
margin-left: 10px; | |
} | |
.starter-template li:nth-child(2n){ | |
margin-left: 0; | |
margin-right: 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment