Jump to content

Quick Question about Classes in Styled Forms


drbigfresh

Recommended Posts

I have a form that looks like this:

 

<form method="POST"  id="aligned"  />

<label for="state">State:</label>

<select name="state" >

<option value="  ">-Unspecified-</option>

</select> 

 

<select name="country"  class="forminline" >

<option value="1"></option>

</select>

 

Now what I am trying to do is to display the country drop down directly after the state, but I can't seem to over ride the default settings for my form css. My css looks like this:

 

#aligned label { position: absolute; text-align:right; width:165px; }

#aligned input, #aligned textarea, #aligned select { margin-left: 185px; }

#aligned label.check, #aligned label.radio { position:relative; text-align:left; }

 

.forminline {

margin-left: 5px;

background:#ccc;

}

 

Now no matter what I do the Country drop down has the 185px left margin, even though the .forminline tries to over ride it. What am I doing wrong?

 

Thanks!

 

Link to comment
Share on other sites

 

Take this out "#aligned select" and then you should not have that problem; it should then look like this:

 

#aligned label { position: absolute; text-align:right; width:165px; }
#aligned input, #aligned textarea { margin-left: 185px; }
#aligned label.check, #aligned label.radio { position:relative; text-align:left; }

.forminline {
margin-left: 5px;
background:#ccc;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.