Sideway
output.to from Sideway



CSS Selector Type


Draft for Information Only

Content

Selectors
   Universal selector CSS2.1
   Type Selectors CSS2.1
   Descendant selectors CSS2.1
   Child selectors CSS2.1
   Adjacent selectors CSS2.1
   Attribute selectors CSS2.1
   Class Selectors CSS2.1
   ID Selectors CSS2.1
   Pseudo-Class CSS2.1
   Pseudo-Element CSS2.1
  CSS Standard

Selectors

In order to make CSS more flexible and simple to apply, a number of patterns are provided for manipulating CSS rules.

Universal selector CSS2.1

This is a styling method to redefine any element. e.g. any element

* { color: blue }

Type Selectors CSS2.1

This is a styling method to redefine the presentation style of existing elements. e.g. h2

h2 { color: blue }

Descendant selectors CSS2.1

This is a styling method to redefine the presentation style of existing elements that is a descendant of another element. e.g. em, nested anywhere within  h2,

h2 em { color: blue }

Child selectors CSS2.1

This is a styling method to redefine the presentation style of existing elements that is a child of another element. e.g. em, nested as a child within h2,

h2 > em { color: blue }

Adjacent selectors CSS2.1

This is a styling method to redefine the presentation style of existing elements that immediately follow another element, and both elements share the same parent. e.g. h2 follows h1 within body,

h1 + h2 { color: blue }

Attribute selectors CSS2.1

This is a styling method to redefine the presentation style of existing elements that match the specified attribute conditions.

h1[title] { color: blue }
h1[title="example"] { color: blue }
h1[title~="example"] { color: blue }
h1[lang|="en"] { color: blue }
h1[title="example"][lang|="en"] { color: blue }

Class Selectors CSS2.1

This is a styling method used in HTML to redefine the presentation style of existing elements that match the specified class attribute conditions.

.head1 { color: blue }
*.head1 { color: blue }
h1.heat1 { color: blue }
h1.heat.blue { color: blue }

ID Selectors CSS2.1

This is a styling method to redefine the presentation style of existing elements that match the specified id attribute conditions.

h1#titleid { color: blue }

Pseudo-Class CSS2.1

This is a styling method to redefine the presentation style of existing elements that match the specified  state.

p:first-child { color: blue }
*>p:first-child { color: blue }
h1>p:first-child { color: blue }
:link { color: blue }
a:link { color: blue }
:visited { color: blue }
a:visited { color: blue }
a.head1:visited { color: blue }
a:hover { color: blue }
a:active { color: blue }
a:focus { color: blue }
a:focus:hover { color: blue }
html:lang(fr) { color: blue }
:lang(fr) { color: blue }
:lang(fr) > h1{ color: blue }

Pseudo-Element CSS2.1

This is a styling method to redefine the presentation style of existing elements that match the specified part of an element.

p:first-line { color: blue }
p:first-letter { color: blue }
p:before { color: blue }
p:after { color: blue }

CSS Standard

CSS References..........


©sideway
close

References

  1. http://www.w3.org/TR/1999/REC-html401-1999, 1999, HTML 4.01 Specification: W3C Recommendation, updated 24 December 1999
close

ID: 190400008 Last Updated: 4/8/2019 Revision: Ref:

IMAGE

Home (5)

Business

Management

HBR (3)

Information

Recreation

Hobbies (7)

Culture

Chinese (1097)

English (336)

Reference (66)

Computer

Hardware (149)

Software

Application (187)

Digitization (24)

Numeric (19)

Programming

Web (705)new

CSS (SC)

ASP.NET (SC)

Regular Expression (SC)

HTML

Knowledge Base

Common Color (SC)

Html Entity (Unicode) (SC)

Html 401 Special (SC)

OS (389)

MS Windows

Windows10 (SC)

.NET Framework (SC)

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)

Biology (1)

Geography (1)

Latest Updated Links

Copyright © 2000-2019 Sideway . All rights reserved Disclaimers last modified on 10 Feb 2019