/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] aligning elements / floats

Hi, I’ve been working on two parts of my site that I just can’t get to align correctly.

Here’s the URL: [url]http://www.foremostgroups.com/dev/2007corporate/corporate_information3.html[/url]

1) I’m trying to get all of the text to wrap around the two images on the page. Here’s the code I’ve been working with:

[CODE]<div id=”main_content”>
<h2>Corporate Information</h2>
<p>
<img src=”images/featured_product.jpg” alt=”Corporate Information” hspace=”20″ vspace=”3″ style=”float:right” class=”border9ab3bc” />
<img src=”images/floattext.gif” alt=”Globe Image” hspace=”10″ vspace=”15″ style=”float:right” />
Paragraph 1</p>
<p>Paragraph 2</p>
<p>Paragraph 3</p>
<p>Paragraph 4</p>
</div>[/CODE]

In my CSS, I have * {float: left;}

I’d like all three paragraphs to wrap around the images but can’t get it to work. I’ve tried wrapping them in other divs (in several different ways) and can’t figure it out.

My second problem is:
2) I’m trying to make the footer text stretch 100% the length of the footer and to be centered (it’s in a UL). My code:

[CODE]<div id=”footer_div”>
<ul id=”footer”>
<li><a href=”legal_notice.html” class=”bottom”>Legal</a> <span class=”bottom”>/</span> <a href=”privacy_notice.html” class=”bottom”>Privacy Notice</a></li>
<li><span class=”copyright”>Copyright &copy; 2007 Foremost Groups Inc. All rights reserved.</span></li>
<li><a href=”site_map.html” class=”bottom”>Site Map</a></li>
</ul>
</div>[/CODE]

I want ‘Legal/Privacy Notice’ on the left side, copyright info centered, and ‘site map’ on the right. Again, I’ve tried this a countless number of ways and can’t get it.

Any help or ideas are greatly appreciated. Thank you.

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@WebJoelSep 07.2007 — That first problem is that the height of the tallest image exceeds the height of the text in the "<p>".

One solution, -albeit a bit ugly, is to make all the content be one "<p>" and use non-semantic <br />s to 'seperate' sentences.

<div id="main_content" style="width:600px; padding:10px; margin:10px; border:1px solid black">

<h2>Corporate Information</h2>

<p>

<img src="images/featured_product.jpg" alt="Corporate Information" style="float:right; width:200px; margin-left:10px; " class="border9ab3bc" />

<img src="images/floattext.gif" alt="Globe Image" style="float:right; width:100px;" />

Foremost Groups is a home furnishings manufacturer that markets and sells its products worldwide.<br /><br />

Our products are made through four groups, the Indoor Division (computer desks, tables, entertainment centers), Kitchen &amp; Bath (cabinets and fixtures), Outdoor Division (patio furniture, outdoor fireplaces) and OEM Division. The company has some two dozen global manufacturing facilities in Asia and North America.<br /><br />

With over 23 facilities worldwide Foremost Groups Inc. is a leader in manufacturing and global sourcing. Headquartered in East Hanover New Jersey, Foremost Groups leverages an unrivaled global supply chain to provide our customers with high quality products at competitive prices.<br /><br />

The company was established in 1987 as a privately held business in Newark, New Jersey, and began its business as an importer for leading retailers around the country. We have achieved continued sales growth each year by providing well-designed, quality products coupled with service that exceeds that of our customers’ expectations.</p>

</div>[/QUOTE]
Here, I gave your DIV a width and your images width as well for demonstration purposes. And a border for the container, to show where it is. These would of course, need to be removed, but this shows how this might be solveable..

I also replace your "vspace" and "hspace" on bothimages with a simple margin-left, to seperate the images. This could be made simpler with a CSS margin to all img. ([B]img {margin:10px;}[/B])The images are going to 'flow upwards' to the top of the "<p>" anyway, and the header text provide the 'top margin', thus, making the vspace & hspace not necessary.
Copy linkTweet thisAlerts:
@dtm32236authorSep 07.2007 — Hi WebJoel,

I've tried it using BR's, and it worked fine in IE, but firefox 2 doesn't seem to recognize the breaks. I'm on Windows PC if that makes any difference.
Copy linkTweet thisAlerts:
@ray326Sep 07.2007 — Get rid of that float:left.
Copy linkTweet thisAlerts:
@dtm32236authorSep 10.2007 — thanks ray and joel,

taking out the float:left worked. the paragraphs wrap around the images perfectly.

now I'm working on the footer - centering it, and having the legal/privacy notice to the left, the copyright text centered, and and site map to the right.

I can't get it layed out properly, so if anyone has any ideas, please let me know. I'll be trying to get it working in the mean time.


The HTML:
[CODE]<div id="footer_div">
<ul id="footer">
<li><a href="legal_notice.html" class="bottom">Legal</a> <span class="bottom">/</span> <a href="privacy_notice.html" class="bottom">Privacy Notice</a></li>
<li><span class="copyright">Copyright &copy; 2007 Foremost Groups Inc. All rights reserved.</span></li>
<li><a href="site_map.html" class="bottom">Site Map</a></li>
</ul>
</div>[/CODE]



and the CSS:
[CODE]#footer_div {width: 100%; background-image:url(../images/footer/bottom.jpg);}
#footer {width:100%; height:18px; top:3px;}[/CODE]



The link, again, is http://www.foremostgroups.com/dev/2007corporate/corporate_information3.html


Thanks again, guys!
Copy linkTweet thisAlerts:
@dtm32236authorSep 10.2007 — Why wouldn't this work?:

HTML:
[CODE] <div id="footer_div">
<ul id="footer">
<li><div style="width:200px; text-align:left"><a href="legal_notice.html" class="bottom">Legal</a> <span class="bottom">/</span> <a href="privacy_notice.html" class="bottom"> Privacy Notice</a></div></li>
<li><div style="width:350px; text-align:center"><span class="copyright">Copyright &copy; 2007 Foremost Groups Inc. All rights reserved.</span></div></li>
<li><div style="width:200px; text-align:right"><a href="site_map.html" class="bottom">Site Map</a></div></li>
</ul>
</div>[/CODE]


with this CSS:
[CODE]#footer_div {width: 100%; background-image:url(../images/footer/bottom.jpg);}
#footer {width:100%; height:18px; top:3px;}[/CODE]


(the bounding box is 750px)

it's so close, but not there yet.
Copy linkTweet thisAlerts:
@ray326Sep 11.2007 — Looks ok to me. I guess you figured it out.
Copy linkTweet thisAlerts:
@dtm32236authorSep 11.2007 — Thanks a lot Ray, I got it figured out... WebJoel was able to help me out.

Thanks again, I appreciate your help.
×

Success!

Help @dtm32236 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...