Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 67069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:12:08+00:00 2026-05-10T19:12:08+00:00

Hopefully a picture is worth a thousand lines of code because I don’t want

  • 0

Hopefully a picture is worth a thousand lines of code because I don’t want to have to strip down all of the ASP.Net code, HTML, JavaScript, and CSS to provide an example (but I’ll supply what I can upon request if someone doesn’t say ‘Oh, I’ve seen that before! Try this…’) [Actually, I did post some code and CSS – see bottom of question].

Here is a portion of a form page being displayed in Firefox: alt text

The blue boxes are temporary stylings of a <label> tag and the orange lines are temporary border styles of the <div> tags (so I can see where they extend and break). The <label>‘s are styled to float: left as are the <div‘s on the right. In addition, the descendant controls of the <div> are also float:left purely so they will line up on the top of the <div> (since there are some taller controls like multiline textboxes down below).

The radio buttons are generated by an ASP control, so they are wrapped in a <span> – also floated left since it is a descendant of the <div>.

Here is the same portion of the screen rendered in IE7: alt text

There are a few minor rendering differences, but the big one that’s driving me crazy is the extra white space beside the <input> controls! Note that the <span>‘s around the radio buttons and checkboxes line up correctly.

Although they aren’t shown, the same thing happens with drop-down lists and list boxes. I haven’t tried wrapping the input controls in a <span>, but that might work. It’s an ugly hack, though.

I’ve tried several of the IE7 workarounds for box issues and I’ve edited the CSS until I’m in pure voodoo mode (i.e., making random changes hoping something works). Like I said, I hope someone will look at this and say, ‘I’ve seen that before! Try this…’

Anyone?

Followup 1:

I’m using the XHTML 1.0 Transitional <DOCTYPE>, so I should be in standards mode.

Followup 2:

Here is a small snippet of the generated code for the above (the first control and the last control). Note that this code was generated by ASP.Net and then dynamically edited by JavaScript/jQuery.

 <fieldset id='RequestInformation'>    <legend>Request Information</legend>    <ol>      <li>        <label id='ctl00_ContentPlaceHolder1_txtRequestDate_L' class='stdLabel'           for='ctl00_ContentPlaceHolder1_txtRequestDate'>Request Date:</label>        <div class='FormGroup'>          <input id='ctl00_ContentPlaceHolder1_txtRequestDate' class='RSV DateTextBox hasDatepicker'             type='text' value='10/05/2004' name='ctl00$ContentPlaceHolder1$txtRequestDate'/>          <img class='ui-datepicker-trigger' src='/PROJECT/images/Calendar_scheduleHS.png' alt='...' title='...'/>          <span id='txtRequestDate_error'/>        </div>      </li>      --STUFF DELETED HERE--      <li>        <label id='ctl00_ContentPlaceHolder1_chkAppealed_L' class='stdLabel'           for='ctl00_ContentPlaceHolder1_chkAppealed'> Request Appealed?</label>        <div class='FormGroup'>          <span class='stdCheckBox'>            <input id='ctl00_ContentPlaceHolder1_chkAppealed' type='checkbox' name='ctl00$ContentPlaceHolder1$chkAppealed'/>          </span>        </div>      </li>    </ol>  </fieldset> 

Here is the relevant portion of the CSS (I double checked to make sure this duplicates the problem):

div {     border-style: solid;     border-width: thin;     border-color:Orange; }  label {     border-style: solid;     border-width: thin;     border-color:Blue; }  .FormGroup {     float:left;     margin-left: 1em;     clear: right;     width: 75em; }  .FormGroup > * {     float:left;     background-color: Yellow; }  fieldset ol {     list-style: none; }   fieldset li {     padding-bottom: 0.5em; }   li > label:first-child {     display: block;     float: left;     width: 10em;     clear: left;     margin-bottom: 0.5em; }  em {     color: Red;     font-weight: bold; } 

Solution!

Matthew pointed me to this page on IE/Win Inherited Margins on Form Elements and that was the problem. The input boxes were inheriting the left margins of all of their containing elements. The solution I chose was to wrap each <input> element in an unstyled <span>. I’ve been trying to keep the structure of the HTML as semantically sound as possible, so I solved it using a jQuery command in the $(document).ready() function:

//IE Margin fix:  //  http://www.positioniseverything.net/explorer/inherited_margin.html jQuery.each(jQuery.browser, function(i) {     if($.browser.msie){         $(':input').wrap('<span></span>');     } }); 

Note that this will only add the stupid <span>‘s on IE…

StackOverflow to the rescue again!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:12:08+00:00Added an answer on May 10, 2026 at 7:12 pm

    The input is inheriting the margins from the surrounding div and the ol. If you surround it with another tag like a span or a div, it should solve your problem.

    Edit: You can find more information and workarounds at http://www.positioniseverything.net/explorer/inherited_margin.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 74k
  • Answers 74k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer How about this? It causes the test to block for… May 11, 2026 at 2:15 pm
  • added an answer The sorting algorithm is correct: 0.01 is 0.01. Unless there's… May 11, 2026 at 2:15 pm
  • added an answer I've been working it out, and I have managed to… May 11, 2026 at 2:15 pm

Related Questions

Hopefully a picture is worth a thousand lines of code because I don't want
Hopefully a nice simple one. I've got a php3 website that I want to
Hopefully a simple question. Take for instance a Circularly-linked list: class ListContainer { private
This is a (hopefully) really simple question - I have been told recently that
This should hopefully be a simple one. I would like to add an extension
I'm working on a personal project and I'd love to be able to say
Final question for the night. And apologies for the complete noobness of this. I
I am looking to use a PHP library for uploading pictures to a web

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.