Site logo

[Resolved] Change the CSS of the Links on focus

Home Forums Support [Resolved] Change the CSS of the Links on focus

Home Forums Support Change the CSS of the Links on focus

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #286554
    Amos

    Hello. i want to add borders to the items when they are on focus
    (when skip with the tab keyboard between the links).
    Thank You 🙂

    #286557
    Leo
    Staff
    Customer Support

    Hi there,

    For all links? Try this:

    a:focus {
        border: 2px solid #000000;
    }

    Let me know if this doesn’t work or if you only want border on specific links. A link to your page indicating which links might help 🙂

    #286560
    Amos

    Thank You. but i know this css and when i click on the links with the mouse the border is showing.
    i want the border only when i using the tab.

    #286565
    Leo
    Staff
    Customer Support

    Hmm I think that might be a accessibility thing. Will ask Tom to see how they did it 🙂

    #286635
    Tom
    Lead Developer
    Lead Developer

    Hmm, :focus is the way to go – not sure if you can make it so it doesn’t happen on click as well.

    You could try to overwrite it:

    a:focus {
        border: 2px solid #000000;
    }
    
    a:active {
        border: 0;
    }
    #286667
    Amos

    Ok i write this code – and it work for me.
    a:focus {
    outline: 5px auto -webkit-focus-ring-color;}

    #286669
    Tom
    Lead Developer
    Lead Developer

    Awesome! Thanks for sharing 🙂

    #383999
    Jörgen

    I´m using this code:

    :focus {
        color: #232525;
        outline: #ddd solid 1px;
    }
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.