473,785 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trouble w/ clearing floated input fields in IE 7

I'm trying to create a tableless layout for a form. The following
markup works as intended in Firefox and Opera, but one of IE 7's bugs
ends up misplacing the floated input fields side-by-side even though I
have a "clear: left" declaration. I'd like to avoid changing the
markup itself, if possible, and find a pure-CSS means to fixing the
problem.

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
  2. www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>My Form</title>
  7. <style type="text/css">
  8.  
  9. label {
  10. float: left;
  11. width: 6em;
  12. clear: left;
  13. margin-right: 0.25em;
  14.  
  15. text-align: right;
  16. }
  17.  
  18. input[type="text"],
  19. input[type="password"],
  20. input[type="file"],
  21. textarea {
  22. float: left;
  23. width: 15em;
  24. }
  25.  
  26. </style>
  27. </head>
  28.  
  29. <body>
  30.  
  31. <form method="post">
  32. <label for="name" class="required">Name:</label><input type="text"
  33. id="name" name="name" />
  34. <label for="pw" class="required">Password:</label><input
  35. type="password" id="pw" name="pw" />
  36. <label for="prompt">Message:</label><textarea id="prompt"
  37. name="prompt"></textarea>
  38. <label for="file">File:</label><input type="file" id="file"
  39. name="file" />
  40.  
  41. </form>
  42. </body>
  43. </html>
Jun 27 '08 #1
0 1888

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5033
by: Charles Blaquière | last post by:
While noodling around, looking for a good layout for an "events calendar" page, I came upon a problem that has me stymied. Have a look at http://kpuc.org/events/upcoming-2.html . The basic structure of each event is: Event div Left-floated image Event header div
18
8089
by: Niels | last post by:
Hi group, I have some problems with clearing floated divs. My usual method works fine in Konqueror, but not in Firefox. Here's an example: <html><body> <div id='left' style='float:left; border:1px solid red;'>Floated left</div> <div id='right' style='float:right; border:1px solid blue;'>Floated right</div>
4
2404
by: LB | last post by:
Apologies if this sounds like a very newbie question. I'm putting together a 3 column layout at the moment, the left 2 columns are effectively menus and the third one is the 'content'. Now, the content within the third column is brought in via a database, and the problem I'm having is if an image file is 'taller' than the text, the following article also wraps around the image. What I would like to do is have that article, and its...
1
4255
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES is selected - enable a field to use the M$ Datepicker. Using the code below works for most of our fields, however the problem is that when the field is re-enabled - it remembers the original date or data prior to it being disabled - despite the...
2
2528
by: ed | last post by:
i'm having trouble with a form. I want to be able to type in the address of the form with the data for the form items in the URL (ie: http://somesite.com/formpage.html?field1=data1&field2=data2). It saves the data if I type it in manually to an html file. But it won't do that if I use the URL notation above. How do I get it to do this. The HTML for the form is below. Thank in advance, ed
6
4138
by: tshad | last post by:
I have an upload file input as: <input id="MyFile" style="width:300px" type="File" runat="Server"> This works fine, but I find that if my page doesn't pass validation during postback, the page comes back with all the data intact, except for the upload object. The text box for "MyFile" (my example) is always cleared. Why is that and is there a way to stop that from happening? Thanks,
1
4266
by: scprosportsman | last post by:
Please help guys, i am trying to set up a database here at work and im fairly new to access in terms of writing functions and queries and stuff. I have 2 different places on my design that will require checking a check box to tell which category something will pertain to. Well after each record is entered i want the check to remain with that record and auto clear when going to the next record so i can input something else if i have a...
2
2043
by: listerofsmeg01 | last post by:
I have the following code to align some form controls: <style type="text/css"> ..label {float:left; width:50%} ..input {width:40%} </style> <div> <div class="label">Enter your username:</div> <input type="text" name="username"/> </div>
3
1596
by: groups2 | last post by:
I have a floated column on the left and a left floated main section next to it. I have some left floated elements in the main section and sometimes I want to clear an element so that the subsequent elements will not be floated, but still remain floated next to the left hand column. . However, when I add "clear:both" to an element in the main section, it clears not only the other elements in the main section, but the left hand column too....
0
9647
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
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
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
5396
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...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
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.