Jump to content

float: right makes everything go away?


daytona10

Recommended Posts

Hello,I am making a container that is 800px wide, but with no height defined in the css,this is because The content within will not always be the same height, so I want thecontainers background to adjust accordingly to the content, right now I'm just testingthe bottom, and this is the html I have so far.

<div id="container"> <!--This adjust its height according to how much content will be in here-->		 		<!--A bunch of content will go here (images/text/ect), wont always be the same height-->	 	<div class="bottom"> <!--This is going to be at the bottom of the containers everytime-->		<p class="float">Author: <a href="#">John Smith</a> | January 1, 2011 | <a href="#">Comments (83)</a></p>	</div></div>

and now for the css

/*CSS 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%;}#container {	width: 800px;	margin: 20px auto;	background-color: #fff;}body {	background-color: #eee;}.bottom {	margin-top: 30px;	margin-bottom: 30px;}

Now with the css code above the content so far is put within the div, and the height is adjust accordingly and the background is white,but when I add float: right; to the class .bottom and preview, it floats to the right and does not have the background. and does not appear to be within the divI'm previewing this is safari 4.1any idea's why this happens?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...