Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: div problem

  1. #1
    Regular Coder
    Join Date
    May 2006
    Posts
    107
    Thanks
    1
    Thanked 0 Times in 0 Posts

    div problem

    if i use following code its creates problem
    I want it like:
    Radio button then text, radio button then text etc

    Code:
    <style type="text/css">
    #outpsp{margin:0px auto; width:330px;padding:2px;background:#FFE5E5;border: 1px solid #FFB2E5;}
    .rad1{	width:30px; float:left; height:25px;}
    .rad2{	width:30px;float:left;height:25px;}
    
    </style>
    
    
    <div id="outpsp">
    00
    	<div class="rad1"><input name="radiobutton" type="radio" value="1" /></div>
    	<div class="rad2"><input name="radiobutton" type="radio" value="2" /></div>
    
    </div>
    But when i remove the radiobutton it works fine

    like:
    Code:
    <style type="text/css">
    #outpsp{margin:0px auto; width:330px;padding:2px;background:#FFE5E5;border: 1px solid #FFB2E5;}
    .rad1{	width:30px; float:left; height:25px;}
    .rad2{	width:30px;float:left;height:25px;}
    
    </style>
    
    
    <div id="outpsp">
    00
    </div>

    I don't know what's the problem
    Last edited by dizyn; 11-19-2008 at 11:25 AM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    You should at least tell us what's the issue that you are facing, rather than letting us to guess.

    Any improvements by clearing your floats like

    Code:
    .clear{
    clear:both;
    }
    Code:
    <div id="outpsp">
    00
    	<div class="rad1"><input name="radiobutton" type="radio" value="1" /></div>
    	<div class="rad2"><input name="radiobutton" type="radio" value="2" /></div>
    	<div class="clear"></div>
    </div>
    Last edited by abduraooft; 11-19-2008 at 11:29 AM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    May 2006
    Posts
    107
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I want it like:
    Radio button then text, radio button then text etc

    But radio buttons are coming down

  • #4
    Regular Coder
    Join Date
    May 2006
    Posts
    107
    Thanks
    1
    Thanked 0 Times in 0 Posts
    the problem is only with FF, its ok in IE

  • #5
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Radio button then text, radio button then text etc
    Where is your text?
    Do you mean
    Code:
    <div class="rad1">
    	<input name="radiobutton" type="radio" value="1" /> text1
    	<input name="radiobutton" type="radio" value="2" /> text2
    	</div>
    ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #6
    Regular Coder
    Join Date
    May 2006
    Posts
    107
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I want it like "Radio button, some text, radio button, some text" All this in one row

    Its ok in IE but in FF its not working and parent div is not coming all along.

    <div class="rad1">
    <input name="radiobutton" type="radio" value="1" /> text1
    </div>
    <div class="rad2">
    Some Text
    </div>

    <input name="radiobutton" type="radio" value="2" /> text2

  • #7
    Regular Coder
    Join Date
    May 2006
    Posts
    107
    Thanks
    1
    Thanked 0 Times in 0 Posts
    got the solution

    I think it will work with:

    overflow:hidden;

  • #8
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Then why do you need two divs there? div is a block level element and push the successive elements to the next line.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •