LinkedIn WordPress Skill Quiz Answers

You have a search bar on your site. You would like to use a <label> to make the word “Search” visible to screen readers, but you don’t want to display the word “Search” on the screen. How can you accomplish this?

Latest Update on 23rd January, 2022 by Certification Course Answers

You have a search bar on your site. You would like to use a

  1.  Assign an ARIA state of "hidden" to the label, like this: <label state="hidden">Search</label> <input type="text" name="search" id="search" />
  2.  Use the built-in WordPress CSS class .screen-reader-text to hide the text from screen, like this: <label class="screen-reader-text">Search</label> <input type="text" name="search" id="search" />
  3.  Create a custom CSS class to set a large negative value to the text-indent property to hide the text off screen, like this: <label class="hide-this">Search</label> <input type="text" name="search" id="search" />
  4.  The majority of users do not require a screen reader. Remove the label entirely.

Correct Answer:

  •  Use the built-in WordPress CSS class .screen-reader-text to hide the text from screen, like this: <label class="screen-reader-text">Search</label> <input type="text" name="search" id="search" />

Latest Updates

No posts found in this category.