Solved

Elements not floating next to one another, despite adequate space

Posted on 2013-06-28
3
201 Views
Last Modified: 2013-06-28
Test page:
http://partnersdesign.net/test

Please click "Partners Design, Inc." at the top. The block with the gray, yellow, blue and green backgrounds should be aligning to the right of the red background. It looks like there is enough space. This was working previously, but I messed something up. I am having trouble seeing what is wrong, I would really appreciate another set of eyes.

HTML:

<ul id="nav2" class="nomobile">
			<li id="nav2bt1" class="nav2hl">ABOUT</li>
			<li id="nav2bt2">PARTNERS</li>
			<li id="nav2bt3">AWARDS</li>
			<li id="nav2bt4">STUDIO</li>
		</ul>

		<div id="contentarea1" class="contentarea">
			<div class="contentquotetag nomobile">01.<br />
				LAURETTA DIVES<br />
				Owner<br />
				<i>The Picture Desk</i></div>
			<div class="contentquote nomobile clearfix">
				<i>&ldquo;The branding has been extremely successful and, although it was created some years back, we have not felt the need to update it significantly, as the look is so classic.&rdquo;</i>
			</div>

			<img class="closebutton yesmobile" src="img/gr_x.png" border="0" />

			<h3>WHO BETTER TO START A GREAT PARTNERSHIP THAN IDENTICAL TWIN BROTHERS?</h3>

			<p>text...</p>
		</div>

Open in new window


CSS:

ul#nav2{float:left;margin:0;padding:12.6em 0 0 0;background-color:#c00;}
ul#nav2 li{display:block;width:116px;height:26px;margin:0;padding:4px 0 0 36px;font-family:'alternate_gothic_fs_no_2Rg',Arial,Helvetica,sans-serif;font-size:1.3em;letter-spacing:1px;cursor:pointer;}
ul#nav2 li.nav2hl{background:transparent url('../img/gr_btbg.png') no-repeat top left;}
ul#nav2 li.nav2mouseover{background:transparent url('../img/gr_btbg.png') no-repeat top left;}

div.contentquote{width:530px;height:7em;padding:1em 40px 9px 24px;margin:0 0 3em -1em;background:transparent url('../img/gr_quotebg.png') no-repeat top left;color:#000;font-size:1.1em;line-height:2;text-indent:-0.5em;background-color:#00c;}
div.contentquotetag{float:right;margin-top:2.3em;font-size:0.7em;line-height:1.6;text-indent:0;width:156px;letter-spacing:1px;background-color:#0c0;}

div.contentarea{float:right;width:52em;margin:0 10em 0 0;background-color:#ccc;}

Open in new window


Thank you!
0
Comment
Question by:bbdesign
3 Comments
 
LVL 21

Accepted Solution

by:
Kim Walker earned 500 total points
Comment Utility
The 10em right margin for class contentarea is pushing contentarea1 away from the right side. (Line 222 of main.css) You need to either remove that margin or set contentarea1 to zero right margin.
0
 
LVL 51

Expert Comment

by:Julian Hansen
Comment Utility
main.css line 222 is where the problem is
div.contentarea {
  background-color: #CCCCCC;
  float: right;
  margin: 0 10em 0 0;
  width: 52em; /* <=== TOO MUCH HERE */
}

Open in new window


em is proportional so you might have changed something higher up the hierarchy which caused the div to be wider.
0
 

Author Comment

by:bbdesign
Comment Utility
Ah, thank you so much!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now