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
To style document’s root element, use the CSS: root selector.ExampleYou can try to run the following code to implement the: root SelectorLive Demo :root { background: blue; color: white; } Heading This is demo text.
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.
Use the CSS : required selector to style elements with a "required" attribute.ExampleYou can try to run the following code to implement the :required SelectorLive Demo input:required { background-color: orange; } Subject: Student:
Use the CSS :required selector to style <input> elements with a "required" attribute. You can try to run the following code to implement the :required selector:ExampleLive Demo input:required { background-color: orange; } Subject: Student:
Use the CSS: read-write selector to select elements with no "readonly" attribute.ExampleYou can try to run the following code to implement the: read-write selectorLive Demo input:read-write { background-color: blue; color: white; } Subject: Student:
The HTML DOM input number placeholder property returns and modify the value of the placeholder attribute of number input field.SyntaxFollowing is the syntax −Returning placeholderobject.placeholderModifying placeholderobject.placeholder = “text”ExampleLet us see an example of HTML DOM input number placeholder property − Live Demo html{ height:100%; } body{ text-align:center; color:#fff; background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat; height:100%; } p{ font-weight:700; font-size:1.1rem; } input{ display:block; ... Read More
Use the CSS :read-write selector to select elements that are ‘readable’ and ‘writable’.ExampleYou can try to run the following code to implement the :read-write selector:Live Demo input:read-write { background-color: blue; color: white; } Subject: Student:
To select elements that are read-only, use the CSS :read-only selector.ExampleYou can try to run the following code to implement the :read-only selectorLive Demo input:read-only { background-color: blue; color: white; } Subject: Student:
Use the CSS :read-only selector to select elements that are read-only.ExampleYou can try to run the following code to implement the :read-only selector:Live Demo input:read-only { background-color: blue; color: white; } Subject: Student:
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP