CSS form styling question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • donpro

    CSS form styling question



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

    #2
    Re: CSS form styling question

    Correction. Code in use is:

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

    Comment

    • Roderik

      #3
      Re: CSS form styling question

      donpro schreef:

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

      --
      Web development en webhosting

      webdesign, internet applicaties, internetgestuur de elektronica

      Comment

      • donpro

        #4
        Re: CSS form styling question

        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, internetgestuur de 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

        Comment

        • Roderik

          #5
          Re: CSS form styling question

          donpro schreef:
          >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, internetgestuur de 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):
          Think you need HTML tables to craft complex liquid layouts? Not so! In this tip-packed tutorial, Mark Newhouse shares advanced yet practical CSS techniques any working web designer can use.


          --
          Web development en webhosting

          webdesign, internet applicaties, internetgestuur de elektronica

          Comment

          • Johannes Koch

            #6
            Re: CSS form styling question

            donpro schrieb:
            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.)

            Comment

            Working...