Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Transition button value change

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #43953
    whodunit
    Member

    So, I would like a button to change when hover but not the size or color but the value.

    You hover the button and it changes from eg. “EDIT” to “CLICK ME TO EDIT”. Another thing, how to do the same thing but wit ha glyph on the button, eg. there is an icon of a pen on the button and it changes to “CLICK ME TO EDIT”.

    I’ll buy a beer to anyone who could help me with it ;)

    #130984
    Kitty Giraudel
    Participant

    I’d go with JavaScript. You could also display content with CSS pseudo-elements, but it doesn’t sound like a good idea.

    #130985
    whodunit
    Member

    Yeah, I was wondering whether it is possible to do it with HTML/CSS only.

    #130986
    Senff
    Participant

    [edit]

    #130987
    pixelgrid
    Participant

    you can create an :before pseudo element and use the element:hover:before selector and either change the opacity of the pseudo element to 1 or display:none to display:block . :after would work the same . pseudo element has to be set to 100% width and height

    #130988
    Senff
    Participant

    Pure HTML/CSS solution (no pseudo elements): http://codepen.io/senff/pen/rbIJs

    #130992
    whodunit
    Member

    oh, thank you Senff. where Can I send the beer? :)))


    @pixelgrid
    . I’ll try to do it also. Thank you.

    #131006
    CrocoDillon
    Participant

    Slightly different version to Senff’s, because having multiple input elements feels weird to me:

    Same CSS :)

    #131007
    Senff
    Participant

    Thats even better.

    Mine actually used inputs because I started with a JQ solution and inputs (changing the value attribute), but in the end @CrocoDillon’s solution makes more sense. You can send the beer to him, @whodunit ! :)

    #131017
    whodunit
    Member

    Oh, brilliant! CrocoDillon’s one makes more sense to me. I owe you both a beer ;)

    #131018
    CrocoDillon
    Participant

    I just adapted your solution, you’ve earned that beer… judging by your avatar you’d enjoy it more then I’d anyway ;)

    (note to self, always refresh before posting)

Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘CSS’ is closed to new topics and replies.