Having trouble with floats

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmorand
    New Member
    • Sep 2007
    • 219

    Having trouble with floats

    I'm having a problem where my submit button isn't floating over to the right inside of the div. It's supposed to be inside of the "test" div, but it's just below it. What am I missing? This is just a test snippet I was working with to get this functionality to work correctly.

    [CODE=html]
    <div id="mainT">
    <div id="test">
    <h4>Enter New Values and Submit</h4>
    <label>ID: </label>#URL.syst em#
    <input class="submitT" type="Submit" value="Submit">
    </div>
    </div>
    [/code]

    [code=css]
    div#mainT{
    border:1px solid #CCC;
    margin-bottom:25px;
    width:600px;
    padding:10px;
    font-size:10px;
    color:#000;
    background-color:#EEE;
    }
    div#mainT input.submitT{
    /*margin:0 0 0 15px;*/
    float:right;
    }
    div#mainT label{
    width:120px;
    float:left;
    /*margin:0 0 0 15px;*/
    }
    div#test{
    border:1px solid red;
    }
    [/code]
    Last edited by dmorand; Oct 5 '07, 08:41 PM. Reason: Messed up code tags
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    And it should not. Parent elements are never to expand to contain floated elements. (IE will but this is a bug in IE). to get the parent to contain the content "overflowin g" out of the div, add 'overflow:auto' to the containing div.

    Comment

    • dmorand
      New Member
      • Sep 2007
      • 219

      #3
      Originally posted by drhowarddrfine
      And it should not. Parent elements are never to expand to contain floated elements. (IE will but this is a bug in IE). to get the parent to contain the content "overflowin g" out of the div, add 'overflow:auto' to the containing div.
      What would be the alternative to get this to work? I was under the impression that the parent element would expand, damn.

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        I already showed you.

        Comment

        • dmorand
          New Member
          • Sep 2007
          • 219

          #5
          Originally posted by drhowarddrfine
          I already showed you.
          Ok, I just wasn't sure if there was a different way I should be doing this rather than using floats. Thanks though!

          Comment

          Working...