CSS button in form

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

    CSS button in form

    Oh ye Gods of Style, I have been having fun making buttons with CSS:
    <div class='cssnav2' >
    <a href='#'
    onClick="docume nt.location.hre f='/catalog/index.php?brand =94'">
    <img src='images/Scart_buttonl.j pg' alt='Continue Shopping' />
    <span>Continu e Shopping</span>
    </a>
    </div>

    ..cssnav2{
    background-image:url(image s/Gcart_buttonl2. jpg);
    width: 180px;
    }
    ..cssnav2 a:hover img{visibility: hidden}
    ..cssnav2 span {
    position: relative;
    float: left;
    left: 5px;
    top: -22px;
    margin: 0px;
    padding: 0px;
    cursor: pointer;
    width: 190px;
    height: 14px;
    text-align:center;
    }




    Now I want to use this technique for form submit buttons. Is this
    possible ? How do I do it ?

    Here is the button I want to replace:

    <input type='hidden' name='login_cre ate' value='yes'/>
    <input type='image' src='images/Scart_create.jp g' name='login_new '>

    When the user hits the button, the next page looks for 'login_create' to
    equal 'yes'
  • David Dorward

    #2
    Re: CSS button in form

    meltedown wrote:
    [color=blue]
    > Oh ye Gods of Style, I have been having fun making buttons with CSS:
    > <div class='cssnav2' >
    > <a href='#'
    > onClick="docume nt.location.hre f='/catalog/index.php?brand =94'">[/color]

    Ye gads. What's wrong with href="/catalog/index.php?brand =94"?

    And image replacement techniques have accessibility issues. You have an
    image, it has alt text, what's wrong with that?
    [color=blue]
    > Now I want to use this technique for form submit buttons. Is this
    > possible ? How do I do it ?[/color]
    [color=blue]
    > <input type='hidden' name='login_cre ate' value='yes'/>[/color]

    This is XHTML which doesn't conform to Appendix C and shouldn't be served as
    text/html.
    [color=blue]
    > <input type='image' src='images/Scart_create.jp g' name='login_new '>[/color]

    This is HTML.
    [color=blue]
    > When the user hits the button, the next page looks for 'login_create' to
    > equal 'yes'[/color]

    What's wrong with the existing code? It works, its not presentational junk.
    There is no need to move it into a stylesheet and have some people be
    unable to access the content (and I mean the information, not any
    particular rendering of it).

    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    • Antoine Polatouche

      #3
      Re: CSS button in form

      David Dorward wrote:[color=blue][color=green]
      >><input type='hidden' name='login_cre ate' value='yes'/>[/color]
      >
      >
      > This is XHTML which doesn't conform to Appendix C and shouldn't be served as
      > text/html.[/color]

      I don't understand this.
      Which Appendix C?
      Do you mean it's not valid XHTML?

      Comment

      • meltedown

        #4
        Re: CSS button in form

        David Dorward wrote:[color=blue]
        > meltedown wrote:
        >
        >[color=green]
        >>Oh ye Gods of Style, I have been having fun making buttons with CSS:
        >><div class='cssnav2' >
        >> <a href='#'
        >> onClick="docume nt.location.hre f='/catalog/index.php?brand =94'">[/color]
        >
        >
        > Ye gads. What's wrong with href="/catalog/index.php?brand =94"?[/color]

        Good Point. I didn't write it, I'm using some one else's atrocious code,
        and sometime they have javascript for reqasons I don't understand, so I
        generally don't mess with it. But this deserves fixing. Thanks for the
        tip. Thank for the tip.[color=blue]
        >
        > And image replacement techniques have accessibility issues. You have an
        > image, it has alt text, what's wrong with that?[/color]

        Well I'm making many many websites with the same code, and the buttons
        need to be different for each website. If I have 10 buttons with 2
        versions each for in and out states, that makes 20 buttons per website.
        If I use replacement images I only need 2 buttons per website, one
        foreach state. It works well except in forms. I'm tired of making
        buttons, and I'm not aware of any problems. Besides, the CSS butotns
        look better.[color=blue]
        >
        >[color=green]
        >>Now I want to use this technique for form submit buttons. Is this
        >>possible ? How do I do it ?[/color]
        >
        >[color=green]
        >><input type='hidden' name='login_cre ate' value='yes'/>[/color]
        >
        >
        > This is XHTML which doesn't conform to Appendix C and shouldn't be served as
        > text/html.
        >
        >[color=green]
        >><input type='image' src='images/Scart_create.jp g' name='login_new '>[/color]
        >[/color]
        Right Again
        I combined them as
        <input type='image' src='images/Scart_login.jpg ' name='login_ret urn'
        value='yes'>
        I see so much bogus code its hard to beleive the programmers were that
        bad. The real bummer is it was written by people who make twice as much
        as I do.
        [color=blue]
        >
        > This is HTML.
        >
        >[color=green]
        >>When the user hits the button, the next page looks for 'login_create' to
        >>equal 'yes'[/color]
        >
        >
        > What's wrong with the existing code? It works, its not presentational junk.
        > There is no need to move it into a stylesheet and have some people be
        > unable to access the content (and I mean the information, not any
        > particular rendering of it).
        >[/color]
        Are you talking about pre-ie5 ? I'm not worried about that.

        Comment

        • meltedown

          #5
          Re: CSS button in form

          meltedown wrote:[color=blue]
          > David Dorward wrote:
          >[color=green]
          >> meltedown wrote:
          >>
          >>[color=darkred]
          >>> Oh ye Gods of Style, I have been having fun making buttons with CSS:
          >>> <div class='cssnav2' >
          >>> <a href='#'
          >>> onClick="docume nt.location.hre f='/catalog/index.php?brand =94'">[/color]
          >>
          >>
          >>
          >> Ye gads. What's wrong with href="/catalog/index.php?brand =94"?[/color]
          >
          >
          > Good Point. I didn't write it, I'm using some one else's atrocious code,
          > and sometime they have javascript for reqasons I don't understand, so I
          > generally don't mess with it. But this deserves fixing. Thanks for the
          > tip. Thank for the tip.
          >[color=green]
          >>
          >> And image replacement techniques have accessibility issues. You have an
          >> image, it has alt text, what's wrong with that?[/color]
          >
          >
          > Well I'm making many many websites with the same code, and the buttons
          > need to be different for each website. If I have 10 buttons with 2
          > versions each for in and out states, that makes 20 buttons per website.
          > If I use replacement images I only need 2 buttons per website, one
          > foreach state. It works well except in forms. I'm tired of making
          > buttons, and I'm not aware of any problems. Besides, the CSS butotns
          > look better.
          >[color=green]
          >>
          >>[color=darkred]
          >>> Now I want to use this technique for form submit buttons. Is this
          >>> possible ? How do I do it ?[/color]
          >>
          >>
          >>[color=darkred]
          >>> <input type='hidden' name='login_cre ate' value='yes'/>[/color]
          >>
          >>
          >>
          >> This is XHTML which doesn't conform to Appendix C and shouldn't be
          >> served as
          >> text/html.
          >>
          >>[color=darkred]
          >>> <input type='image' src='images/Scart_create.jp g' name='login_new '>[/color]
          >>
          >>[/color]
          > Right Again
          > I combined them as
          > <input type='image' src='images/Scart_login.jpg ' name='login_ret urn'
          > value='yes'>
          > I see so much bogus code its hard to beleive the programmers were that
          > bad. The real bummer is it was written by people who make twice as much
          > as I do.
          >[color=green]
          >>
          >> This is HTML.
          >>
          >>[color=darkred]
          >>> When the user hits the button, the next page looks for 'login_create' to
          >>> equal 'yes'[/color]
          >>
          >>
          >>
          >> What's wrong with the existing code? It works, its not presentational
          >> junk.
          >> There is no need to move it into a stylesheet and have some people be
          >> unable to access the content (and I mean the information, not any
          >> particular rendering of it).
          >>[/color]
          > Are you talking about pre-ie5 ? I'm not worried about that.[/color]
          Also, the exisiting code has no up and down state. The rest of the page
          has buttons with up and down states and I want them to match.

          Comment

          • Alan J. Flavell

            #6
            Re: CSS button in form

            On Thu, 29 Sep 2005, Antoine Polatouche wrote:
            [color=blue]
            > David Dorward wrote:[color=green][color=darkred]
            > >><input type='hidden' name='login_cre ate' value='yes'/>[/color]
            > >
            > > This is XHTML which doesn't conform to Appendix C and shouldn't be
            > > served as text/html.[/color]
            >
            > I don't understand this.
            > Which Appendix C?[/color]

            If you don't know what's meant by "Appendix C" (of XHTML/1.0) then
            what on Earth persuaded you to use XHTML in the first place? You'd be
            far safer staying with HTML/4.01, unless and until you have an
            overwhelming reason to use XHTML and understand clearly its
            implications in a web situation.

            IMHO, anyway. Oh, http://www.w3.org/TR/xhtml1/#guidelines


            Comment

            • Norman L. DeForest

              #7
              Re: CSS button in form


              On Thu, 29 Sep 2005, meltedown wrote:
              [color=blue]
              > David Dorward wrote:[color=green]
              > > meltedown wrote:
              > >
              > >[color=darkred]
              > >>Oh ye Gods of Style, I have been having fun making buttons with CSS:
              > >><div class='cssnav2' >
              > >> <a href='#'
              > >> onClick="docume nt.location.hre f='/catalog/index.php?brand =94'">[/color]
              > >
              > >
              > > Ye gads. What's wrong with href="/catalog/index.php?brand =94"?[/color]
              >
              > Good Point. I didn't write it, I'm using some one else's atrocious code,
              > and sometime they have javascript for reqasons I don't understand, so I
              > generally don't mess with it. But this deserves fixing. Thanks for the
              > tip. Thank for the tip.[/color]

              This should do the same as the original for those with JavaScript support
              (and have it turned on) and still work for those with JavaScript turned
              off or with no JavaScript support at all:

              <a href='/catalog/index.php?brand =94'
              onClick="docume nt.location.hre f='/catalog/index.php?brand =94';return false">

              Actually they should both do the same thing but it's remotely possible
              that the JavaScript version is treated differently in some browsers'
              history files.
              [color=blue][color=green]
              > > And image replacement techniques have accessibility issues. You have an
              > > image, it has alt text, what's wrong with that?[/color]
              >
              > Well I'm making many many websites with the same code, and the buttons
              > need to be different for each website. If I have 10 buttons with 2
              > versions each for in and out states, that makes 20 buttons per website.
              > If I use replacement images I only need 2 buttons per website, one
              > foreach state. It works well except in forms. I'm tired of making
              > buttons, and I'm not aware of any problems. Besides, the CSS butotns
              > look better.[/color]

              Try them with Lynx.
              [color=blue][color=green][color=darkred]
              > >>Now I want to use this technique for form submit buttons. Is this
              > >>possible ? How do I do it ?[/color]
              > >
              > >[color=darkred]
              > >><input type='hidden' name='login_cre ate' value='yes'/>[/color]
              > >
              > >
              > > This is XHTML which doesn't conform to Appendix C and shouldn't be served as
              > > text/html.
              > >
              > >[color=darkred]
              > >><input type='image' src='images/Scart_create.jp g' name='login_new '>[/color]
              > >[/color]
              > Right Again
              > I combined them as
              > <input type='image' src='images/Scart_login.jpg ' name='login_ret urn'
              > value='yes'>
              > I see so much bogus code its hard to beleive the programmers were that
              > bad. The real bummer is it was written by people who make twice as much
              > as I do.
              >[color=green]
              > >
              > > This is HTML.
              > >
              > >[color=darkred]
              > >>When the user hits the button, the next page looks for 'login_create' to
              > >>equal 'yes'[/color]
              > >
              > >
              > > What's wrong with the existing code? It works, its not presentational junk.
              > > There is no need to move it into a stylesheet and have some people be
              > > unable to access the content (and I mean the information, not any
              > > particular rendering of it).
              > >[/color]
              > Are you talking about pre-ie5 ? I'm not worried about that.[/color]

              If content is moved into a stylesheet it's inaccessible to Lynx users.

              --
              ``Why don't you find a more appropiate newsgroup to post this tripe into?
              This is a meeting place for a totally differnt kind of "vision impairment".
              Catch my drift?'' -- "jim" in alt.disability. blind.social regarding an
              off-topic religious/political post, March 28, 2005

              Comment

              Working...