CSS and formating form elements

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

    CSS and formating form elements

    Hi,

    I want to format buttons and textfields with css.
    I've done it the following way in a css-file:

    ..button {background-color:black;
    color:white;
    height:20px;}

    and used it with class="button" in the input tag. It only worked in
    Opera, but not in the IE, Firefox and Netscape. It worked in all
    browsers as I wrote the style definition directly in the html tag:
    <input style="backgrou nd-color:black;">. ..

    Where is the problem? Why does it not work when I use the in an extern
    css file.

    Thanks
    Mario

  • Lauri Raittila

    #2
    Re: CSS and formating form elements

    in comp.infosystem s.www.authoring.stylesheets, Mario Ospelt wrote:[color=blue]
    > Hi,
    >
    > I want to format buttons and textfields with css.
    > I've done it the following way in a css-file:
    >
    > .button {background-color:black;
    > color:white;
    > height:20px;}
    >
    > and used it with class="button" in the input tag. It only worked in
    > Opera, but not in the IE, Firefox and Netscape. It worked in all
    > browsers as I wrote the style definition directly in the html tag:
    > <input style="backgrou nd-color:black;">. ..
    >
    > Where is the problem? Why does it not work when I use the in an extern
    > css file.[/color]

    URL?

    --
    Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>

    Comment

    • Steve Pugh

      #3
      Re: CSS and formating form elements

      On Mon, 20 Dec 2004 22:44:12 +0100, Mario Ospelt
      <mospelt@studen t.ethz.ch> wrote:
      [color=blue]
      >I want to format buttons and textfields with css.
      >I've done it the following way in a css-file:
      >
      >.button {background-color:black;
      > color:white;
      > height:20px;}
      >
      >and used it with class="button" in the input tag. It only worked in
      >Opera, but not in the IE, Firefox and Netscape. It worked in all
      >browsers as I wrote the style definition directly in the html tag:
      ><input style="backgrou nd-color:black;">. ..
      >
      >Where is the problem? Why does it not work when I use the in an extern
      >css file.[/color]

      Normally you can, so you must be doing something out of the ordinary.
      Can't tell what unless you post a URL.

      Steve

      Comment

      • Mario Ospelt

        #4
        Re: CSS and formating form elements

        Sorry,

        I had to put it online at first:



        Steve Pugh schrieb:
        [color=blue]
        > On Mon, 20 Dec 2004 22:44:12 +0100, Mario Ospelt
        > <mospelt@studen t.ethz.ch> wrote:
        >
        >[color=green]
        >>I want to format buttons and textfields with css.
        >>I've done it the following way in a css-file:
        >>
        >>.button {background-color:black;
        >> color:white;
        >> height:20px;}
        >>
        >>and used it with class="button" in the input tag. It only worked in
        >>Opera, but not in the IE, Firefox and Netscape. It worked in all
        >>browsers as I wrote the style definition directly in the html tag:
        >><input style="backgrou nd-color:black;">. ..
        >>
        >>Where is the problem? Why does it not work when I use the in an extern
        >>css file.[/color]
        >
        >
        > Normally you can, so you must be doing something out of the ordinary.
        > Can't tell what unless you post a URL.
        >
        > Steve
        >[/color]

        Comment

        • Steve Pugh

          #5
          Re: CSS and formating form elements

          On Mon, 20 Dec 2004 23:00:58 +0100, Mario Ospelt
          <mospelt@studen t.ethz.ch> wrote:[color=blue]
          >Steve Pugh schrieb:[color=green]
          >> On Mon, 20 Dec 2004 22:44:12 +0100, Mario Ospelt
          >> <mospelt@studen t.ethz.ch> wrote:
          >>[color=darkred]
          >>>and used it with class="button" in the input tag. It only worked in
          >>>Opera, but not in the IE, Firefox and Netscape. It worked in all
          >>>browsers as I wrote the style definition directly in the html tag:
          >>><input style="backgrou nd-color:black;">. ..
          >>>
          >>>Where is the problem? Why does it not work when I use the in an extern
          >>>css file.[/color]
          >>
          >> Normally you can, so you must be doing something out of the ordinary.
          >> Can't tell what unless you post a URL.
          >>[/color]
          >Sorry,
          >
          >I had to put it online at first:
          >
          >http://n.ethz.ch/student/mospelt/Igel7/index.html[/color]

          Please don't top post, round here people prefer well trimmed inline
          quoting and you'll get much better responses if you go with the flow.

          You have an error in your CSS. A quick check with the validator would
          have revealed this:


          It may or may not be the cause of your problem but until you fix it
          there's no reason for other people to spend time tracking down the
          error.

          Likewise there are errors in your HTML:



          Steve


          Comment

          • Mario Ospelt

            #6
            Re: CSS and formating form elements



            Steve Pugh schrieb:
            [color=blue]
            > On Mon, 20 Dec 2004 23:00:58 +0100, Mario Ospelt
            > <mospelt@studen t.ethz.ch> wrote:
            >[color=green]
            >>Steve Pugh schrieb:
            >>[color=darkred]
            >>>On Mon, 20 Dec 2004 22:44:12 +0100, Mario Ospelt
            >>><mospelt@stu dent.ethz.ch> wrote:
            >>>
            >>>
            >>>>and used it with class="button" in the input tag. It only worked in
            >>>>Opera, but not in the IE, Firefox and Netscape. It worked in all
            >>>>browsers as I wrote the style definition directly in the html tag:
            >>>><input style="backgrou nd-color:black;">. ..
            >>>>
            >>>>Where is the problem? Why does it not work when I use the in an extern
            >>>>css file.
            >>>
            >>>Normally you can, so you must be doing something out of the ordinary.
            >>>Can't tell what unless you post a URL.
            >>>[/color]
            >>
            >>Sorry,
            >>
            >>I had to put it online at first:
            >>
            >>http://n.ethz.ch/student/mospelt/Igel7/index.html[/color]
            >
            >
            > Please don't top post, round here people prefer well trimmed inline
            > quoting and you'll get much better responses if you go with the flow.
            >
            > You have an error in your CSS. A quick check with the validator would
            > have revealed this:
            > http://jigsaw.w3.org/css-validator/v...el7/index.html
            >
            > It may or may not be the cause of your problem but until you fix it
            > there's no reason for other people to spend time tracking down the
            > error.
            >
            > Likewise there are errors in your HTML:
            > http://validator.w3.org/check?uri=ht...set=iso-8859-1
            >
            >
            > Steve[/color]

            OK, Thanks a lot, I'll take care about these things in the future!!!
            The css error was also responsible for my problem!

            Mario

            Comment

            Working...