Solved

float word wrap problem in internet explorer

Posted on 2004-10-17
2
1,457 Views
Last Modified: 2008-02-01
http://www.soloenterprises.org/testcss.php
http://www.soloenterprises.org/solostyle1.css

My borders break in IE when using a nested float to word wrap images.  I would like to know if there is a workaround for this as it displays perfectly in FF et all.  I would rather not import different style sheets by browsers.

Some good links on this problem would be great.  

thanks

0
Comment
Question by:livegirllove
2 Comments
 
LVL 3

Accepted Solution

by:
Kupi earned 500 total points
ID: 12334294
Hi livegirllove,
when you use floating divs you have to add a clearing element to prevent visualization errors, for detailed info please see:
http://www.positioniseverything.net/easyclearing.html

To fix the problem, replace your code with the following:

<div class="content">
  <div style="float: left; margin: 0px 10px 0px 0px; width: 60px;"><img src="images/serviceimage.gif" alt="Orange County Computer Service" width="58" height="66" style="display: block;"></div>
  <h2>Orange County Computer Service</h2>
  microsoft certified<br>
  14 years exp.<br>
  guaranteed work
</div>
<div class="content">
  <div style="float: left; margin: 0px 10px 0px 0px; width: 60px;"><img src="images/webdesignimage.gif" width="62" height="65" alt="Orange County Web Design" style="dispaly: block;"></div>
  <h2>Orange County Web Design</h2>
  high quality<br>
  ease of use<br>
  lowest prices
</div>
<div class="content">
  <div style="float: left; margin: 0px 10px 0px 0px; width: 60px;"><img src="images/hostingimage.gif" width="34" height="83" alt="Orange County Web Site Hosting" style="display: block;"></div>
  <h2>Orange County Web Site Hosting</h2>
  99.999% uptime<br>
  linux/redhat<br>
  daily backups
</div>

And in the CSS:

.content {
  clear: both;
  position:relative; /* Position is declared "relative" to gain control of stacking order (z-index). */
  width:auto;
  min-width:120px;
  margin:0px 210px 20px 170px;
  border:1px solid black;
  background-color:white;
  padding:10px;
  z-index:3; /* This allows the content to overlap the right menu in narrow windows in good browsers. */
  height: 1%;
}

.content:after {
  display: block;
  visibility: hidden;
  clear: both;
  content: ".";
  height: 0px;
}

Kupi
0
 
LVL 1

Author Comment

by:livegirllove
ID: 12334370
Perfect!!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

760 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

24 Experts available now in Live!

Get 1:1 Help Now