Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

CSS form styling question

Question posted by: donpro (Guest) on June 27th, 2008 07:19 PM
https://testbed.odysseyshipping.com/index.php

Thanks for all your help thus far. Now I'm trying to create a form
using CSS and not tables.

Please click on the "Contact Us" link. I'd like to get all the form
elements (input, textarea) left aligned.

I tried the following code but to no avail:

#formComments input.inputText {
text-align: left;
}

Please help.

Thanks,
Don
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
donpro's Avatar
donpro
Guest
n/a Posts
June 27th, 2008
07:19 PM
#2

Re: CSS form styling question
Correction. Code in use is:

#formComments input textarea{
width:auto;
text-align: left;
}

Roderik's Avatar
Roderik
Guest
n/a Posts
June 27th, 2008
07:19 PM
#3

Re: CSS form styling question
donpro schreef:
Quote:
Originally Posted by
https://testbed.odysseyshipping.com/index.php
>
Thanks for all your help thus far. Now I'm trying to create a form
using CSS and not tables.
>
Please click on the "Contact Us" link. I'd like to get all the form
elements (input, textarea) left aligned.
>
I tried the following code but to no avail:
>
#formComments input.inputText {
text-align: left;
}
>
Please help.
>
Thanks,
Don


You have to apply it to the containing element not to the element itself.
What you defined is to align text *in* that input element to the left.

--
http://www.archytas.nl/
webdesign, internet applicaties, internetgestuurde elektronica

donpro's Avatar
donpro
Guest
n/a Posts
June 27th, 2008
07:19 PM
#4

Re: CSS form styling question
You have to apply it to the containing element not to the element itself.
Quote:
Originally Posted by
What you defined is to align text *in* that input element to the left.
>
--http://www.archytas.nl/
webdesign, internet applicaties, internetgestuurde elektronica


Thanks!

Now I have a question about background colors. Is it possible to set
the background color of the form like this:

1. The form label column is all one background color
2. The form element (input, textarea) column is all another background
color
3. The row containing the Submit button is a third background color.

Thanks,
Don

Roderik's Avatar
Roderik
Guest
n/a Posts
June 27th, 2008
07:19 PM
#5

Re: CSS form styling question
donpro schreef:
Quote:
Originally Posted by
Quote:
Originally Posted by
>You have to apply it to the containing element not to the element itself.
>What you defined is to align text *in* that input element to the left.
>>
>--http://www.archytas.nl/
>webdesign, internet applicaties, internetgestuurde elektronica

>
Thanks!
>
Now I have a question about background colors. Is it possible to set
the background color of the form like this:
>
1. The form label column is all one background color
2. The form element (input, textarea) column is all another background
color
3. The row containing the Submit button is a third background color.
>
Thanks,
Don


That's possible. Although slightly different, A List Apart gives a nice
example on how to design a form (might be a good starting point):
http://www.alistapart.com/articles/practicalcss/

--
http://www.archytas.nl/
webdesign, internet applicaties, internetgestuurde elektronica

Johannes Koch's Avatar
Johannes Koch
Guest
n/a Posts
June 27th, 2008
07:19 PM
#6

Re: CSS form styling question
donpro schrieb:
Quote:
Originally Posted by
Correction. Code in use is:
>
#formComments input textarea{
width:auto;
text-align: left;
}


textarea elements can't be descendants of input elements., at least not
in (X)HTML. So this selector won't select anything.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

 
Not the answer you were looking for? Post your question . . .
184,185 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors