Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Responsive site li maintaining contents height

Featured Replies

I'm trying to keep this site responsive and have all the images you see on the landing page scale down with the browser, As a test I have set the li's containing the images at 40% width and the images inside 100% with auto height, but i can't figure out why this is not working and it's overflowing.

 

I figured that setting the li height to auto would automatically fill according to the image, but it just goes mental.

 

Any help would be greatly welcomed!

 

http://dev.lecollective.co.uk/clients/2013/Pollyking/

Ive only had a quick look, see if this helps on the #brand ul li change overflow to hidden and add position relative

  • Author

Ive only had a quick look, see if this helps on the #brand ul li change overflow to hidden and add position relative

 

Thanks for your reply, I have updated this, It has helped, but the images are being cropped because of the hidden overflow and still doing some weird things. Also, the height of the li needs to be responsive along with the width, if i change this to auto then there is no height at all

Give this a try it needs a few more tweaks but should get you on your way sorry I forgot to comment on the changes

 

/*
Theme Name: Polly King
Author: Le Collective / Utile Creative
Author URI: http://www.lecollective.co.uk
Description: Theme for Polly King by LeCollective, Designed by Utile Creative.
Version: 1.0
*/


/* =Reset
-------------------------------------------------------------- */

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	vertical-align: baseline;
}
body {
	line-height: 1;
}
ol,
ul {
	list-style: none;
}
blockquote,
q {
	quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
caption,
th,
td {
	font-weight: normal;
	text-align: left;
}
h1,
h2,
h3,
h4,
h5,
h6 {
	clear: both;
}
html {
	overflow-y: scroll;
	font-size: 100%;
	-webkit-text-size-adjust: 100%;
	-ms-text-size-adjust: 100%;
}
a:focus {
	outline: thin dotted;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
	display: block;
}
audio,
canvas,
video {
	display: inline-block;
}
audio:not([controls]) {
	display: none;
}
del {
	color: #333;
}
ins {
	background: #fff9c0;
	text-decoration: none;
}
hr {
	background-color: #ccc;
	border: 0;
	height: 1px;
	margin: 24px;
	margin-bottom: 1.714285714rem;
}
sub,
sup {
	font-size: 75%;
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}
sup {
	top: -0.5em;
}
sub {
	bottom: -0.25em;
}
small {
	font-size: smaller;
}
img {
	border: 0;
	-ms-interpolation-mode: bicubic;
}

/* Clearing floats */
.clear:after,
.wrapper:after,
.format-status .entry-header:after {
	clear: both;
}
.clear:before,
.clear:after,
.wrapper:before,
.wrapper:after,
.format-status .entry-header:before,
.format-status .entry-header:after {
	display: table;
	content: "";
}


/* Base Classes
-------------------------------------------------------------- */

body {
	  font-family: "p22-underground",Arial, Helvetica, sans-serif;
	  color:#0f0f0f;
}

a, a:visited {
    color: #0f0f0f;
    text-decoration: none;
	-webkit-transition: all 0.5s ease-in-out;
  -moz-transition: all 0.5s ease-in-out;
  -o-transition: all 0.5s ease-in-out;
  transition: all 0.5s ease-in-out;
}
a:hover {
	-webkit-transition: all 0.5s ease-in-out;
  -moz-transition: all 0.5s ease-in-out;
  -o-transition: all 0.5s ease-in-out;
  transition: all 0.5s ease-in-out;	
}

h1 {
	font-weight:normal;
}
li {
	list-style:none;
}
/* Theme Ids & Classes
-------------------------------------------------------------- */


#page {
    max-width: 1100px;
    margin: auto;
    padding: 0px 10px;
}

/*#header {
    text-align: center;
    padding: 25px 10px 0px 10px;
	background-image:url(img/opac-80.png);
    position: fixed;
    max-width: 100%;
    margin: auto;
    z-index: 9;
}*/

#header {
	width: 100%;position: fixed;left: 50%;
	
	background-image:url(img/opac-80.png);
	margin: 0 0 0 -50%;
    z-index: 9;
	text-align: center;
	padding: 25px 0 0 0;
}

#header h1 {
    font-size: 31px;
    text-transform: uppercase;
	font-weight:normal;
    margin-bottom: 10px;
}
#header .line1,
#header .line2,
#header .line3 {
    letter-spacing: 28px;
    display: block;
    height: 15px;
}
#header .line1 {
    font-size: 0.6em;
    font-weight: 600;
    margin-bottom: 20px;
}
#header .line2 {
    font-size: 0.5em;
	
    margin-bottom: 20px;
}
#header .line3 {
    font-size: 0.5em;
}
.menu-header-container {
	display:none;
}
#navigation {
    padding-top: 30px;
    margin-left: -5px;
}
#navigation .header-menu ul li {
    display: inline-table;
    padding: 0px 3.4% 1% 3.4%;
    text-transform: uppercase;
    font-size: 12px;
}
#navigation .header-menu ul li a:hover, li.current_page_item a {
	color:#999;
}
.menu-header-container select {
    background: transparent;
    width: 45%;
    padding:6px 35px 6px 5px;
    font-size: 15px;
   line-height: 1;
   border: 0;
   border-radius: 0;
   height: 34px;
   -webkit-appearance: none;
   background-image:url(img/arrow.svg);
   background-position:right center;
   background-repeat:no-repeat;
   vertical-align:bottom;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-align: right;
	margin:auto;
}
#brand {
	padding: 20px 0px;
	overflow: auto;
	min-height:360px;
}
#brand ul li {
	float: left;
	padding-right: 10px;
	margin-bottom: 20px;
	width: 360px;
	height: auto;
	cursor:pointer;
	
}
#brand ul li.third-post {
	padding-right: 0px;
}

.brand-thumbnail:hover .attachment-post-thumbnail {
    opacity: 0.7;
	-webkit-transition: all 0.5s ease-in-out;
  -moz-transition: all 0.5s ease-in-out;
  -o-transition: all 0.5s ease-in-out;
  transition: all 0.5s ease-in-out;
	background-color:#FFF;
}
.brand-thumbnail .attachment-post-thumbnail {
	width:300px;
	height:auto;
	
	opacity: 1;
	-webkit-transition: all 0.5s ease-in-out;
  -moz-transition: all 0.5s ease-in-out;
  -o-transition: all 0.5s ease-in-out;
  transition: all 0.5s ease-in-out;

}
.brand-content .brand-thumbnail img {
    width: 360px;
    height: auto;
	
}
.brand-thumbnail .hide {
	display: none;
	margin: auto;
}
.brand-thumbnail .show {
	display:inline-table;
	height:auto;
	z-index:999;
	width:340px;
	padding:172px 10px;
	position:absolute;
	background-image:url(img/opac60.png);
}
h1.brand-title {
	text-align:center;
	vertical-align: middle;
}
#main {
	padding-top: 175px;
}
#content {
	padding-top:20px;
}
#primary {
    margin: auto;
}
#page-content {
	padding-top:20px;
	opacity:0;
	margin-bottom: 20px;
	position: relative;
}
#page-title {
	width: 80%;
	text-align:center;
	padding: 40px 10% 25px 10%;
	text-transform: uppercase;
	letter-spacing: 2px;
	opacity:0;
}
/*
--------------Generic Page---------
*/

#page-content.page {
    margin: auto;
    text-align: center;
    max-width: 950px;
}


/*
--------------About Page---------
*/
.about {
	width:80%;
	margin:auto;
}
#abt-copy{
	width: 45%;
	vertical-align: top;
	padding-left: 2%;
	font-size: 13px;
	display: inline-block;
	right: 0;
	position: absolute;
}
#abt-copy p {
	margin-bottom: 20px;
	line-height: 20px;
}
#abt-img{
    display: inline-block;
    width: 50%;
}

#abt-img img {
    height: auto;
    width: 90%;
}

/*
----------Single Page (Brand)-------
*/


#header-image img{
    width: 100%;
}
#content.single {
    margin: auto;
    text-align: center;
    max-width: 1100px;
}
#header-image {
	max-height:400px;
	overflow:hidden;
}
#header-image, #single-content {
	opacity:0;
	margin-bottom: 50px;
}
#post-title {
    text-transform: uppercase;
    font-size: 22px;
    letter-spacing: 4px;
    padding: 20px 10px;
    text-align: center;
}
#single-copy {
    width: 67%;
    margin: auto;
    font-size: 13px;
}
#single-copy p {
    margin-bottom: 20px;
    line-height: 25px;
    color: #666;
}
ul.snapshots {
    max-height: 410px;
    overflow: hidden;
    vertical-align: top;
}

ul.snapshots li{
    display: inline-table;
    margin-left: 2%;
    width: 32%;
    vertical-align: top;
}
ul.snapshots li:first-child{
	margin-left:0;
}
ul.snapshots li img{
    width: 100%;
    height: auto;
}
#lookbook-link {
	margin-bottom:20px;
	text-transform:uppercase;
	font-size:14px;
}
#brand ul {
    overflow: auto;
    margin: auto;
}
/*
----------News Page--------
*/
#page-content.news {
	margin: auto;
	text-align: center;
	max-width: 1100px;
	margin-bottom: 50px;
}
#news-img {
	overflow:hidden;
	max-height:400px;
	margin-bottom: 20px;
	text-align: center;
}
#news-copy {
    width: 67%;
    margin: auto;
    font-size: 13px;
    text-align: center;
}
#news-copy p {
    margin-bottom: 20px;
    line-height: 25px;
    color: #666;
}
#news-title {
    padding: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
}
.news-links {
	text-align:center;
}
.news-links a{
	font-size:12px;
	cursor:pointer;
}
.news-links span {
    font-size: 13px;
    padding: 0px 5px;
}
.view-more{}
.share{}
.article {
	margin-bottom:50px;
}
.social-cont {
  height: auto;
  padding:10px;
  display:none;
 
}
.social-cont ul li {
	font-size:12px;
}
/*
---------Contact Page------
*/

#page-content.contact {
	margin: auto;
	text-align: center;
	max-width: 1100px;
	margin-bottom: 50px;
}
#contact-image {
	overflow:hidden;
	max-height:400px;
	margin-bottom: 20px;
}

/*
---------Social Page----------
*/

#social-content {
	padding: 20px 0px 20px 0px;
	text-align: center;
}
#instagram-feed {
	width:101%;
	text-align:left;
}
#instagram-feed li a{
    margin: 0px 10px 20px 0px;
	display:inline-table;
}
#instagram-feed li:third-child a{
    margin: 0px 10px 20px 0px;
}
#instagram-feed li a img{
	opacity:1;
	-webkit-transition: all 0.5s ease-in-out;
	-moz-transition: all 0.5s ease-in-out;
	-o-transition: all 0.5s ease-in-out;
	transition: all 0.5s ease-in-out;
}
#instagram-feed li a img:hover{
	opacity:0.5;
	-webkit-transition: all 0.5s ease-in-out;
	-moz-transition: all 0.5s ease-in-out;
	-o-transition: all 0.5s ease-in-out;
	transition: all 0.5s ease-in-out;
}

/*
------Pop Up Gallery-----------
*/
#lookbook-button {
	cursor:pointer;
}

#lookbook {
	display:none;
}

.prev, .next {
	position: relative; 
	padding: 3px; 
	font-size:24px; 
	color:#333; 
	cursor:pointer;
	font-family:Arial, Helvetica, sans-serif;
}

.gallery li{
	display:none; 
	list-style:none;
}
.gallery li:first-child {
	display:block;
}

.gallery img {
	width:95%;
	height:auto;
}
.slideButtons {
    bottom: 0;
    width:100%;
    font-weight:normal;
    font-family:Arial, Helvetica, sans-serif;
    position: absolute;
    margin-bottom: -40px;
}
.b-close {
	cursor:pointer;
	font-size: 20px;
	float:right;
	z-index: 10000;
	position: absolute;
	right: 0;
	padding-right: 25px;
	padding-top: 2px;
	top: 0;
}
.b-close:hover {
	color:#000;
}
.slideButtons span {
	display:inline-table;
	font-weight:normal;
	font-size:24px;
	color:#999;
}
.slideButtons .next {
    float: right;
}
.slideButtons .prev {}

span.lookbook-title {
	text-align:center;
	font-size:12px;
	width: 85%;
	margin: auto;
	text-transform:uppercase;
	vertical-align:middle;
}

/*
---------Content Page---------------
*/

.col {
	width:32%;
	display:inline-table;
	text-align:center;
	line-height: 20px;
}

.content-title {
	text-transform:uppercase;
	color: #1b1b1b;
	font-size: 16px;
	margin-bottom: 10px;
}
#show-copy {
    padding: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #1b1b1b;
}

/*
---------Showroom Page---------------
*/

ul.showroom {
	width:100%;
}

ul.showroom li{
	width:32%;
	display:inline-table;
	text-align:center;
	line-height: 20px;
	font-size:14px;
	color:#666;
}

.showroom h3 {
	text-transform:uppercase;
	color: #1b1b1b;
	font-weight:normal;
	font-size: 16px;
	margin-bottom: 10px;
}
@media only screen and (max-width: 1120px) {
  /* rules that only apply for canvases narrower than 720px */
	
	
#brand ul li {
    width:32%;
	display: inline;
    zoom: 1;
	overflow:hidden;
	position:relative;
}
.brand-thumbnail {
    margin: auto;
    
    height: auto;
    clear: both;
}
.brand-content {
	
}
.brand-content .brand-thumbnail  {
    
}
.brand-content .brand-thumbnail img {
    width: 100%;
}

}
@media only screen and (max-width: 720px) {
  /* rules that only apply for canvases narrower than 720px */
	
	
#brand ul li {
    width: 40%;
    display: inline;
    zoom: 1;
}
.brand-thumbnail {
    margin: auto;
    
    height: auto;
    clear: both;
}
.brand-content .brand-thumbnail img {
    
}
}

@media only screen and (max-device-width: 720px) {
  /* rules that only apply for canvases narrower than 720px */

#abt-img {
	display: inline-block;
	width: 100%;
	}
#abt-img img {
	height: auto;
	width: 100%;
}
#abt-copy {
	width: 100%;
	position: relative;
	text-align:center;
}
#page-content.news, #page-content.contact {
	width:80%;
}
#news-img {}
#contact-image img, 
#news-img img{
	width: 100%;
	height: auto;
	}
ul.showroom li {
    width: 90%;
    margin-bottom: 20px;
}
.col {
	width: 90%;
	margin-bottom:20px;
}
}

/*------------------------------------*/


@media screen and (max-width: 480px){
    /*--- iPhone only CSS here ---*/
#header {
	left:none;
	position:relative;
}
#header h1 {
	padding-left:25px;
}
#primary {}
#content {
	padding:0px 10px;
	}
#brand {
	overflow:auto;
	}
#navigation {
	display:none;
}
.menu-header-container {
	display:block;
	position:fixed;
	margin: auto;
	width: 100%;
	text-align: center;
	z-index: 9;
	background-image:url(img/opac-80.png);
	top: 86px;
}
#brand ul {
	width: auto;
	margin: auto;
	padding: 0px 10px;
}

#brand ul li {
	width:130px;
	height: 130px;
	cursor: pointer;
	float: left;
	margin-bottom: 10px;
	padding-right: 10px;
	white-space: nowrap;
}
#brand ul li.third-post{
	padding-right:10px;
}
#brand ul li:nth-child(even) {
	padding-right: 0px;
}
.brand-thumbnail .hide { display: none; width: 130px; } .brand-thumbnail .hide { width: 130px !important; }

.brand-content .brand-thumbnail img { height: auto; width: 130px; }

#main {
	padding-top:0px;
}
#page {
	padding:0px;
}
#single-copy {
	width: 100%;
}

ul.snapshots {
	max-height:none;
}
	
ul.snapshots li {
	display: block;
	margin-left: 0;
	width: 100%;
	margin-bottom:25px;
}
.b-close {
font-size: 30px;
padding-right: 25px;
padding-top: 4px;
}
span.lookbook-title {
	width: 80%;
}
#page-content {
	overflow:auto;
}
#header .line1,
#header .line2,
#header .line3 {
	letter-spacing:15px;
	margin-bottom:10px;
}
#header .line1 {
    font-size: 0.4em;
}
#header .line2,
#header .line3 {
    font-size: 0.3em;
}

}

@media only screen and (min-width: 480px) and (max-width: 767px) {
	
	#brand ul li.third-post{
	padding-right:0px;
}
#brand ul li:nth-child(even) {
	padding-right: 10px;
}



} 

/* iPhone 4 (landscape) ----------- */
@media only screen and (min-width: 480px) and (max-width: 767px) {{
/* Styles */

#brand ul {}

}

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.