...

View Full Version : div problem



dizyn
11-19-2008, 12:22 PM
if i use following code its creates problem
I want it like:
Radio button then text, radio button then text etc



<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:

<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

abduraooft
11-19-2008, 12:25 PM
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


.clear{
clear:both;
}

<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>

dizyn
11-19-2008, 12:30 PM
I want it like:
Radio button then text, radio button then text etc

But radio buttons are coming down

dizyn
11-19-2008, 12:31 PM
the problem is only with FF, its ok in IE

abduraooft
11-19-2008, 12:33 PM
Radio button then text, radio button then text etc Where is your text?
Do you mean

<div class="rad1">
<input name="radiobutton" type="radio" value="1" /> text1
<input name="radiobutton" type="radio" value="2" /> text2
</div> ?

dizyn
11-19-2008, 12:38 PM
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

dizyn
11-19-2008, 12:42 PM
got the solution

I think it will work with:

overflow:hidden;

abduraooft
11-19-2008, 12:44 PM
Then why do you need two divs there? div is a block level element and push the successive elements to the next line.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum