473,769 Members | 2,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

floating divs

3 New Member
I'm having trouble between IE and FF. For once, IE behaves as I would expect, but FF doesn't.

Basically I have a container with two floating DIVs in it. One floats left and the other right. I then have a table which should fill between the two floating DIVs if there is space. If there's not space, it should push down and display as a separately centered table. IE (7) behaves as I would expect, but FF seems to overlay the right side of the table into the right-floated DIV causing garbled text.

Any insights would be greatly appreciated. Html follows.
link to page: http://www.ez-order-manager.com/y.php

[html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test Div</title>
<style type="text/css">
#divPage div, #divPage p {
margin: 5px;
}
.fullPage {
width:98%;
/* z-index:0; */
margin: 5px 5px 5px 5px;
padding: 1px 1px 1px 1px;
border: 1px solid black;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10pt;
}
.alignRight {
text-align:right;
font-weight:bold;
}
.alignCenter {
text-align:center;
}
.alignLeft {
text-align:left;
font-weight: normal;
margin: 5px 5px 5px 20px;
}
div.clear {
clear: both;
height: 1px;
margin: 0;
padding: 0;
line-height: 1px;
font-size:1px;
}
.divOrderDetail {
text-align:center;
width:98%;
margin: 5px;
padding: 5px;
border: 1px solid #FFCC00;
color:#990000;
}
.orderDetail th {
background-color:#F4F2F3;
font-size:larger;
font-weight:bold;
color:#990000;
}
.divOrderDetail table, .orderDetail table {
margin-bottom:0;
padding-bottom:0;
margin-left:auto;
margin-right:auto;
border:0;
font-size: 8pt;
}
.orderDetail {
font-size:8pt;
}
.orderDetail td.alignLeft, .orderDetail td.alignCenter, .orderDetail td.alignRightNo Bold {
color:blue;
}
.alignRightNoBo ld {
text-align:right;
}

</style>
</head>

<body>
<div id="divPage" class="fullPage ">

<div class="divOrder Detail">
<div id="anchorEditN ames" class="orderDet ail" align="left" style="float:le ft;color:blue;" >

<span id="anchorPayIn fo" style="backgrou nd-color:#F4F2F3;t ext-align:center;fo nt-weight:bold;col or:#990000;widt h:50%;">Bill To</span><br/>
Some Guy's Name<br/> Maybe a Company<br/> 123 SomeStreet Which is a loooonnnnnggggg addresss<br/> Apt ABC<br/> SomeCity<br/> SomeState<br/> (503) 123-4567<br/> <a href="mailto:fo o@example.com"> foo@example.com </a> </div>

<div align="left" class="orderDet ail" style="float:ri ght;color:blue; ">
<span style="backgrou nd-color:#F4F2F3;t ext-align:center;fo nt-weight:bold;col or:#990000;widt h:50%;">Ship To</span><br/>
Some Guy's Name<br/> Maybe a Company<br/> 123 SomeStreet Which is a loooonnnnnggggg addresss<br/> Apt ABC<br/> SomeCity<br/> SomeState<br/> (503) 123-4567<br/> <a href="mailto:fo o@example.com"> foo@example.com </a> </div>

<table class="orderDet ail cardInfoTab" border="0" cellpadding="0" cellspacing="0" style="margin-left:auto;margi n-right:auto;bord er:1px solid #FFCC00;" >
<tr>
<td colspan="6">
<span style="backgrou nd-color:#F4F2F3;t ext-align:center;fo nt-weight:bold;col or:#990000;widt h:50%;">
Card Info
</span>
</td>
</tr>
<tr>

<td class="alignRig ht">Method:</td>
<td class="alignLef t">A Payment method</td>
<td class="alignRig ht">Card #:</td>
<td class="alignLef t">123456789012 345</td>
<td class="alignRig ht">Exp.:</td>
<td class="alignLef t">03/2008</td>

</tr>
<tr>
<td class="alignRig ht">Auth:</td>
<td class="alignLef t">Some Authorization Code</td>
<td class="alignRig ht">AVS:</td>
<td class="alignLef t">YYY</td>
<td class="alignRig ht">CVV:</td>

<td class="alignLef t">666</td>
</tr>
<tr>
<td colspan="6">
<span style="backgrou nd-color:#F4F2F3;t ext-align:center;fo nt-weight:bold;col or:#990000;widt h:50%;">
Pay Provider Info
</span>
</td>
</tr>

<tr>
<td class="alignRig ht">Auth:</td>
<td class="alignLef t">Provider Specific Auth Code</td>
<td class="alignRig ht">Tx ID:</td>
<td class="alignLef t">Some Really Long Transaction ID 1234567890</td>
<td class="alignRig ht">Merch. ID:</td>

<td class="alignLef t">123-0987</td>
</tr>
<tr>
<td class="alignRig ht">Status:</td>
<td class="alignLef t">Charged</td>
<td class="alignRig ht">BuyerID:</td>
<td class="alignLef t">Some Buyer ID</td>

<td colspan="2">&nb sp;</td>
</tr>
<tr>
<td colspan="6" class="editLink ">
<a class="editLink " href="#">edit - not here</a>
</td>
</tr>
</table>

<div class="clear">& nbsp;</div>
</div>
</div>
</body>
</html>

[/html]
Apr 22 '07 #1
4 2932
drhowarddrfine
7,435 Recognized Expert Expert
Your markup is far more difficult than it needs to be and combining css in the head with inline styles and deprecated markup complicates debugging further. In addition, IE, all versions, has issues with floats and margins set to auto (and floats in general). On top of that, you set some elements to a width of 98% and 50% but a browser would not know what that is a percent of; iow, you have no reference for those percentages.

Am I correct that you designed this using IE first and then tested in Firefox? Since IE7 is nine years behind web standards, that would be the backwards thing to do. Always test in a modern browser first, such as Firefox or Opera or anything but IE, then we can adjust for IEs quirks and bugs.
Apr 22 '07 #2
tbirnseth
3 New Member
I have not been able to get FF to behave correctly at all. The only way I can keep it from creating a mess is to enclose the table in a floated left div. Then, it always pushes down regardless of whether the table/div will fit in the space (not what I would like nor what I'd expect correct behavior to be).

Regarding the widths... Since they are all percentages, I'd assumed the browsers could accurately calculate the absolute widths based on the size of the window.

How would you structure this so the table lies betwen the two divs (centered) when it fits and pushes down (centered) when it doesn't. If I put a div around the table and give it an absolute width, IE then behaves the same as FF when the div/table won't fit. I.e. the right side of the table overlays the right-floated div.

Like to get some consistency. Is that possible?
Apr 22 '07 #3
drhowarddrfine
7,435 Recognized Expert Expert
I have not been able to get FF to behave correctly at all.
But it is FF, or any standards compliant browser, you should be working with first. Getting it to work in IE first but not FF just tells us something is wrong with the markup. But if it works in FF then it likely works everywhere and we only have to make adjustments for IE.
I'd assumed the browsers could accurately calculate the absolute widths based on the size of the window.
Widths are based on the size of the parent. The parent is not always the window or viewport. In some browsers, the window size must also be set. In others, they ignore it or guess at a number. IE guesses but that isn't what it's supposed to do.

If I had more time today I'd play with this but I'm in and out.
Apr 22 '07 #4
tbirnseth
3 New Member
If I had more time today I'd play with this but I'm in and out.
Usually I work strictly in FF. I was surprised this time (since I use this approach on other pages too) that I couldn't get this one to behave as I'd expect.

Any help you could provide would be appreciated. But I did want it to remain relative (to browser window) widths versus fixed.

Let me know if you come up with something that will have the table stay between the floated divs (if it fits) and will push down (centered) if it doesn't. Trying to utilize the real estate as much as possible.

Again, I appreciate any help you can provide.
Apr 23 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2230
by: Olly | last post by:
I am using the following pure css layout with a header and footer: http://www.fu2k.org/alex/css/layouts/3Col_NN4_FMFM.mhtml The left column floats to the left of the main content (middle column). In the middle column I have 3 divs on top of each other, each of which needs to have a border. To get the borders to display correctly in Netscape 6 and ie5 (windows) I have to put a <br style="clear:both">
18
5727
by: day | last post by:
I know I've seen this issue described before, but I can't find it, or the solution now that I need it. I have some css-specified floating divs that contain images or text. The text divs have a background color and text color that differ from the rest of the page, and I'd like them to be positioned from the right edge of the rightmost image div, to the right edge of the browser window. In other words, if the browser window is 800 pixels...
6
10922
by: veerleverbr | last post by:
Hi, I have the following html: <div id="content"> <div id="leftpart">...</div> <div id="rightpart">...</div> </div> leftpart en rightpart are in the css set to float left. The content of leftpart and rightpart div is so that both divs have different height.
12
2821
by: meltedown | last post by:
I would like the floating divs to float and then the header to come after them , on the left. That's what I thought clearing the floats was for, but in this example, the header is to the right of the floating divs, nothing is cleared. What am I doing wrong ? Here is the url:http://www.reenie.org/test/test5.php Here is the code: <html> <head>
1
1972
by: StevePBurgess | last post by:
I have a website which, on the main page, has two floating divs. One contains a list of navigation menu items and the other is themain content of the page. Occasionally that div that contains the menu is longer than the div that contains the main content. This displays perfeclty well on Firefox but on internet explorer the bottom bit of the navigation div is chopped off so that it is the same height as the (smaller) main content div.
2
3979
by: Arnost Sobota | last post by:
Hello, Suppose I want to play with DIVs as if they were type characters. I have a series of fixed-height (width is of no importance) blocks which must follow one another from left to right, with a small margin between them. This is easily done with the CSS float:left property. But in this context, what is the proper way to do a Line Feed/Carriage Return? Take a look at the code below for example's sake. I have 8 DIVs and I want to...
3
4264
by: kent | last post by:
Hi, For the code below, only "aaa" has a red background but "bbb" and "ccc" don't have it: <div style="background: red">aaa <div style="float:left">bbb</div> <div style="float:left">ccc</div> </div>
2
2940
by: Gary | last post by:
I am new at this, css, and am having trouble doing what I want to do. I want div columns on the left and right that have a background image. Then I want a div in the center, of fixed width, with my content. I want the left and right divs to expand or contract to fill the space when the browser is resized. Alternately I want the center div to float over the side divs when the browser's width is less than the width of the three div's...
11
5411
by: yawnmoth | last post by:
How do you get both of these div's to have a 100% width? (1): <div style="float: left; background: black; color: white">Hello, world! </div> <div style="clear: both; background: blue; color: white">Hello, world! </div> You could set the width inside the floated div to 100% but if you do that and if you have a floated fixed width div, the 100% width div will appear on a new line, as demonstrated (2):
4
32613
dlite922
by: dlite922 | last post by:
This is just barely above my head when it comes to css. I have a div that needs to contain rows of floating divs, but I need each row not to wrap on to the next one and continue to go right. The user will use a overflow: auto scroll to scroll to see the rest of the divs. illustration: # = === = = === === # = == = = # == ================== # =========
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9987
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9857
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.