Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8122375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:49:01+00:00 2026-06-06T05:49:01+00:00

Is there a way to add keyboard navigation to links with just css3, without

  • 0

Is there a way to add keyboard navigation to links with just css3, without js or any js library? specifically, I have created a pure css3 lightbox effect with a bunch of images but I want to navigate between images using left and right keys without clicking anywhere on the screen and use escape to get the effect of “cancel” button (similar to Close)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:49:03+00:00Added an answer on June 6, 2026 at 5:49 am

    What you are asking for is literally impossible with Cascading Style Sheets , You can animate your sequences for timing or do stuff like animating , transitions with CSS but you cannot do what you want to do with CSS only!.

    Reasons

    1. Cascading Style Sheets were made for making the visual elements of the page and not the UX
    2. Css has no method for interaction with Keyboard.

    You can either add a little bit of javascript for making this happen . But as you don’t wanna use javascript you are stuck !

    Checkbox hack

    With checkbox radio box something like this is attainable but then again the focus initially
    requires to be brought . which can be done using autofocus attribute ..

    So this fiddle should solve your issue.

    http://jsfiddle.net/darkyen/NUtnX/

    But i want to warn you before hand any “blur” will cause this to fail. so the better javascript code varient is listed below

    JavaScript Code

    The javascript code for achieving what you want will contain very minimal javascript
    Say your markup is

    So you can simply assign a lil javascript

    (function(){
     var slide = 0,  // Current slide 
         max   = 10, // Maximum Number of slides
     ele = document.getElementById("show");
         document.addEventListener('keydown',function(e){
              e.preventDefault();
              e.stopPropagation(); // To stop more event stuff and default behaviour
              key = e.keyCode; // To find out what key is this 
              if( key === 39 ){
                  // Right arrow 
                  // Aha we incremented the value!
                  slide++;
                  slide %= (max+1);
                  // Increase the value of slide by 1 and keep em in limits
              }else if( key === 37){
                  slide = (--slide >= 0)?slide: ( slide + max );
                  // Will decrement the slide value by 1 and if they are less then 0 then   will cycle it to the last slide 
              }  
    
              ele.className.replace(/slide[0-9]/gi,'slide'+slide);                 
              // wasn't hard now was it ?     
         });
     })();
    

    The minimal javascript above will do the task of changing your slides or you can always see the source code of impress.js

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created this regular expression to validate names: ^[a-zA-Z0-9\s\-\,]+.\*?$ Is there a way add
Is there any way to add a SQL Server Database Diagram to source control?
Is there any way to add validation (ie SSN) to a SharePoint field and
Is there any way to add fields to a DataSet which will be serialized
Is there any way to add a ActiveX control to a JPanel.
Is there a way to add new methods to a class, without modifying original
Just wanted to ask you if there is an easy way to add description
Is there any way to have two keyboards on the screen at once? I
Is there any way to add a photo to Twitter timeline using TWRequest or
Is there any way to add a window form into another form as control?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.