Sideway
output.to from Sideway
Draft for Information Only

CSS Selectors

In Cascading Style Sheet, every CSS rule consists of a selector and a declaration, The declaration is the rendering information to be applied to the selected elements while the selector is the pattern used to select the matched elements to be applied.

The CSS Selectors in alphabetic order

Property NameDescriptionCSS LevelRefRemark #idto match all elements with an "id" id1,2.1last updated 11 Jan 2019*to match all elements2.1last updated 11 Jan 2019.classto match all elements with a "class" class1,2.1last updated 11 Jan 2019::after (:after)Insert something after the content of each <p> elementlast updated 11 Jan 2019::before (:before)Insert something before the content of each <p> elementlast updated 11 Jan 2019::cue (:cue)last updated 11 Jan 2019::grammar-errorlast updated 11 Jan 2019::markerlast updated 11 Jan 2019::placeholderto select input elements with placeholder textlast updated 11 Jan 2019::selectionto select the portion of an element that is selected by a userlast updated 11 Jan 2019::slotted()last updated 11 Jan 2019::spelling-errorlast updated 11 Jan 2019:activeto select the active link1,2.1last updated 11 Jan 2019:any-linklast updated 11 Jan 2019:backdroplast updated 11 Jan 2019:blanklast updated 11 Jan 2019:checkedto select every checked <input> elementlast updated 11 Jan 2019:currentlast updated 11 Jan 2019:defaultto select the default <input> elementlast updated 11 Jan 2019:definedlast updated 11 Jan 2019:dir()last updated 11 Jan 2019:disabledto select every disabled <input> elementlast updated 11 Jan 2019:droplast updated 11 Jan 2019:emptyto select every <p> element that has no children (including text nodes)last updated 11 Jan 2019:enabledto select every enabled <input> elementlast updated 11 Jan 2019:firstlast updated 11 Jan 2019:first-childto select every <p> element that is the first child of its parent2.1last updated 11 Jan 2019:first-letter (::first-letter)to select the first letter of every <p> element1,2.1last updated 11 Jan 2019:first-line (::first-line)to select the first line of every <p> element1,2.1last updated 11 Jan 2019:first-of-typeto select every <p> element that is the first <p> element of its parentlast updated 11 Jan 2019:focusto select the input element which has focus2.1last updated 11 Jan 2019:focus-visiblelast updated 11 Jan 2019:focus-withinlast updated 11 Jan 2019:fullscreenlast updated 11 Jan 2019:futurelast updated 11 Jan 2019:has()last updated 11 Jan 2019:hostlast updated 11 Jan 2019:host()last updated 11 Jan 2019:host-context()last updated 11 Jan 2019:hoverto select links on mouse over2.1last updated 11 Jan 2019:indeterminateto select input elements that are in an indeterminate statelast updated 11 Jan 2019:in-rangeto select input elements with a value within a specified rangelast updated 11 Jan 2019:invalidto select all input elements with an invalid valuelast updated 11 Jan 2019:is()last updated 11 Jan 2019:lang(language)to select every <p> element with a lang attribute equal to "it" (Italian)2.1last updated 11 Jan 2019:last-childto select every <p> element that is the last child of its parentlast updated 11 Jan 2019:last-of-typeto select every <p> element that is the last <p> element of its parentlast updated 11 Jan 2019:leftlast updated 11 Jan 2019:linkto select all unvisited links1,2.1last updated 11 Jan 2019:local-linklast updated 11 Jan 2019:not(selector)to select every element that is not a <p> elementlast updated 11 Jan 2019:nth-child(n)to select every <p> element that is the second child of its parentlast updated 11 Jan 2019:nth-last-child(n)to select every <p> element that is the second child of its parent, counting from the last childlast updated 11 Jan 2019:nth-last-of-type(n)to select every <p> element that is the second <p> element of its parent, counting from the last childlast updated 11 Jan 2019:nth-of-type(n)to select every <p> element that is the second <p> element of its parentlast updated 11 Jan 2019:only-childto select every <p> element that is the only child of its parentlast updated 11 Jan 2019:only-of-typeto select every <p> element that is the only <p> element of its parentlast updated 11 Jan 2019:optionalto select input elements with no "required" attributelast updated 11 Jan 2019:out-of-rangeto select input elements with a value outside a specified rangelast updated 11 Jan 2019:pastlast updated 11 Jan 2019:placeholder-shownlast updated 11 Jan 2019:read-onlyto select input elements with the "readonly" attribute specifiedlast updated 11 Jan 2019:read-writeto select input elements with the "readonly" attribute NOT specifiedlast updated 11 Jan 2019:requiredto select input elements with the "required" attribute specifiedlast updated 11 Jan 2019:rightlast updated 11 Jan 2019:rootto select the document's root elementlast updated 11 Jan 2019:scopelast updated 11 Jan 2019:targetto select the current active #news element (clicked on a URL containing that anchor name)last updated 11 Jan 2019:target-withinlast updated 11 Jan 2019:user-invalidlast updated 11 Jan 2019:validto select all input elements with a valid valuelast updated 11 Jan 2019:visitedto select all visited links1,2.1last updated 11 Jan 2019[attribute$=value]to match all elements with [attribute] attribute containing word ends with string "value"last updated 11 Jan 2019[attribute*=value]to match all elements with [attribute] attribute containing word with substring "value" at the start, end or in the middle of the word.last updated 11 Jan 2019[attribute]to match all elements with an "attribute" attribute2.1last updated 11 Jan 2019[attribute^=value]to match all elements with [attribute] attribute containing word begins with string "value"last updated 11 Jan 2019[attribute|=value]to match all elements with [attribute] attribute starting with the word "value" of either exactly "value" or "value" immediately followed by "-".2.1last updated 11 Jan 2019[attribute~=value]to match all elements with [attribute] attribute containing the word "value"2.1last updated 11 Jan 2019[attribute=value]to match all elements with [attribute] attribute equal to "value"2.1last updated 11 Jan 2019columnA||tablecellBto match all <tablecellB> elements that belong to the scope of the <columnA> element.last updated 11 Jan 2019elementA elementBto match all <elementB> elements that are nested inside the <elementA> element1,2.1last updated 11 Jan 2019elementA,elementB,⋯to match all <elementA>, <elementB>, <⋯>, ⋯ elements1,2.1last updated 11 Jan 2019elementA~elementBto match all <elementB> elements that are preceded by the <elementA> element but not necessarily immediately inside the same parent element.last updated 11 Jan 2019elementA+elementBto match all <elementB> elements that are preceded immediately by the <elementA> element inside the same parent element.2.1last updated 11 Jan 2019elementA>elementBto match all <elementB> elements that are direct children of the parent <elementA> element2.1last updated 11 Jan 2019elementnameto match all <elementname> elements1,2.1last updated 11 Jan 2019nth-col()last updated 11 Jan 2019nth-last-col()last updated 11 Jan 2019

©sideway

ID: 190300028 Last Updated: 28/3/2019 Revision: 0 Ref:

close

References

  1. http://www.w3.org/TR/1999/REC-html401-1999, 1999
close

Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 7

Culture

Chinese 1097

English 337

Reference 67

Computer

Hardware 149

Software

Application 187

Digitization 24

Numeric 19

Programming

Web 761

CSS 1

ASP.NET 1

Regular Expression 1

HTML

Knowledge Base

Common Color 1

Html Entity (Unicode) 1

Html 401 Special 1

OS 389

MS Windows

Windows10 1

.NET Framework 1

DeskTop 7

Knowledge

Mathematics

Formulas 8

Algebra 20

Number Theory 206

Trigonometry 18

Geometry 18

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Physics

Electric 11

Biology 1

Geography 1


Copyright © 2000-2019 Sideway . All rights reserved Disclaimers last modified on 06 September 2019