Solved

responsive DIV columns

Posted on 2014-03-30
1
306 Views
Last Modified: 2014-05-02
i am building a new site and a sample page with the issue at hand on the dev url is http://serv7wkdcxic.sn.sourcedns.com/~yacht/wpsite/listings/royal-princess.

The site overall is responsive, but I put in a DIV with two columns and the second column, when it shrinks down, doesn't drop below the first but moves on top of it.  In this case it is text running over a picture.

What do I do so the text would drop below the image?

The css is below.

.yacht-details {

	background-color: #f5f5f5;

	font-size: 16px; 
	
	line-height: 2em ; 

	overflow: hidden;

	margin: 0 0 30px;

	padding: 15px 20px 0;

}



.yacht-details-col1,
.yacht-details-col2{

	float: left;

	margin: 0;

	padding: 0 0 15px;

	width: 50%;

}

Open in new window

0
Comment
Question by:dougfosterNYC
1 Comment
 
LVL 5

Accepted Solution

by:
Neil_Bradley earned 500 total points
ID: 39965441
Hi Doug,
you could simply write a media query to counteract the floating nature of your 2 divs when the screen soze drops below a certain size. Something like this
@media only screen and (max-width: 960px)
.yacht-details-col1, .yacht-details-col2 {
float: none;
width: 100%;
}
}
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question