Rahul Singh
Rahul Singh

Reputation: 1632

Issue of display in css

I have following CSS and I want all my three select box in one line.Though I have implemented display as inline but its not working in div..

.block_feedback .field select { color: #FFF; width:375px; height:20px; line-height:17px; margin-left:13px; margin-top:4px; display:none; background-color:#00A2B1; border:0px; font-family:Arial, Helvetica, sans-serif; font-size:16px; }

 <div class="field" >
            <select name="dobmonth" id="dobmonth" class="w_def_text" style="width:150px;">
              <?php getmonth(); ?>
            </select>
            <select name="dobdate" id="dobdate" class="w_def_text" style="width:80px;">
              <?php getbirthdate(); ?>
            </select>
            <select name="dobyear" id="dobyear" class="w_def_text" style="width:80px;">
              <?php getyear(); ?>
            </select>
 </div>

Upvotes: 1

Views: 71

Answers (3)

G.G.
G.G.

Reputation: 674

Considering that select is an inline element, you don't need to float them. When rendered visually, inline elements do not usually begin on a new line.

http://jsfiddle.net/qByj4/

Also I would avoid the inline CSS. You can use its id to set a width.

Upvotes: 0

MCSI
MCSI

Reputation: 2894

Use float:left to the select's as motoxer4533 said, and in ".field" add float:left; and a specific width

Upvotes: 1

Damon Bauer
Damon Bauer

Reputation: 2726

Add float:left to the select in your css, like so: http://jsfiddle.net/YXNAH/5/

Upvotes: 1

Related Questions