CSS3 > Selectors

Active selector in CSS3

How to apply active links of the web page in CSS3?


By using Active selector we can select and style the active links and elements.

<style>
        p:active {
        color:red;
        background-color:lightblue;
        }
        a:active {
            background-color:orange;
        }
</style>

<body>
    <h3>This is H3, This is Not active</h3>
    <br />
    <p>This is P. This is Active.</p>
    <br />
    <a href="http://www.techfunda.com">Active Link</a>
    <br />
    <br />
    <b>This is B. This is Not Active.</b>
    <br />
    <br />
    <strong>Note:</strong> Click on the Content in the page, to know the Output.
</body>

In the above code snippet, we given active property to the <p> tag and <a> tag. 

OUTPUT

 Views: 4198 | Post Order: 7



Write for us






Hosting Recommendations