
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1594 Articles for CSS

207 Views
Use the CSS : visited selector to style all visited links.ExampleYou can try to run the following code to implement the :visited selector:Live demo a:link, a:visited { background-color: white; color: black; border: 1px solid blue; padding: 30px 30px; text-align: center; text-decoration: none; display: inline-block; } a:hover, a:active { background-color: red; color: white; } Demo Link

191 Views
Use the CSS : valid selector to style all elements with a valid value .ExampleYou can try to run the following code to implement the :valid SelectorLive Demo input:valid { background: red; color: white; } Heading The style (red color background) appears if you type a relevant/ valid email address.

3K+ Views
To highlight active HTML anchor with CSS, use the :target selector.ExampleYou can try to run the following code to implement the :target Selector:Live Demo :target { border: 2px solid #D4D4D4; background-color: orange; color: white; } Click any of the subject below. Maths Java C++ C This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. Maths Tutorial Java Tutorial C++ Tutorial C Tutorial

141 Views
To style every element that is not the specified element, use the CSS :not(selector) selector.ExampleYou can try to run the following code to implement the :not selector:Live Demo p { color: red; } :not(p) { color: blue; } Heading 1 Heading 2 Heading 3 This is a paragraph. This is another paragraph.

274 Views
Use the CSS :target selector to highlight active HTML anchor with CSS.ExampleYou can try to run the following code to implement the :target SelectorLive Demo :target { border: 2px solid #D4D4D4; background-color: orange; color: white; } Click any of the subject below. Maths Java C++ C This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. Maths Tutorial Java Tutorial C++ Tutorial C Tutorial

419 Views
The position: sticky; property allows you to position an element based on scroll position. Set an element as sticky on the top when a user scrolls down.ExampleYou can try to run the following code to implement CSS position: sticky;Live Demo div.sticky { position: -webkit-sticky; position: sticky; top: 0; padding: 10px; background-color: orange; border: 1px solid blue; } Scroll and see the effect! Sticky! This is demo text. Scroll down to view the sticky div.