Forums

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

Home Forums CSS Link styling

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #246993
    Ayala
    Participant

    In this case:
    http://codepen.io/una/pen/jrxbZq

    …can I change for example the color of the buttons (#slide-1, #slide-2) while it is target?
    I want to show which button I am on.

    #247000
    Shikkediel
    Participant

    This would be a solution if I could figure out how to make the link inside the label trigger :checked on the radio input…

    Nearly working demo

    #247001
    Ayala
    Participant

    Thank you!
    The radio buttons was my plan-B :)

    Like this: https://codepen.io/arjancodes/pen/PwZppQ

    Just I don’t know yet how it is working.
    I am trying to figure it out.

    #247004
    Shikkediel
    Participant

    I’m not sure why the anchor link inside the label is “swallowing” the click on the input element. If someone could explain it to me that would be great. But here’s a version that uses the checkbox hack only:

    Working demo

    #247005
    Ayala
    Participant

    Thank you for you demo! Nice! :)

    #247006
    Ayala
    Participant

    I’ve heard that the id is not useful today, because it is not dinamic.
    It could be made with classes and :nth-child selectors as well, right?

    #247040
    Shikkediel
    Participant

    Sure, the slides don’t really need any unique identifiers but they are required for the inputs though so the for attribute of the labels can refer to them…

    #247047
    Shikkediel
    Participant

    I kinda overlooked that it would quite easy to address the ul sibling and it’s children here, going on the original pen. I’m not a big fan of :target though because it messes with the browser history. Maybe that caused my tunnel vision.

    Of course your initial example won’t function without using an id on the slides…

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