CSS :target Selector

You are Here:

CSS :target Selector

Example

HTML Online Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> :target{ border: 2px solid green; background-color: #bbd279; } h3{ border: 1px solid #000; background: #f2f2f2; padding: 75px 10px; } a{ display: block; padding: 20px 0; } </style> </head> <body> <h3 id="html">Learn HTML</h3> <h3 id="css">Learn CSS</h3> <h3 id="javascript">Learn Javascript</h3> <h3 id="jquery">Learn Jquery</h3> <h3 id="ajax">Learn AJAX</h3> <a href="#css">Move to CSS</a> <a href="#javascript">Move to Javascript</a> <a href="#html">Move to HTML</a> </body> </html>

Syntax

Using CSS

:target { color: red; }

Reminder

Hi Developers, we almost covered 98.7% of CSS Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in CSS.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author