Author: Saim Khalid
-
Class Selectors
Class Selectors in CSS CSS class selectors are used to select elements with a specific class attribute. The class selector is defined using a period (.) followed by the class name. Syntax The syntax for CSS class selectors is as follows: .classname{/* property: value; */background-color: #04af2f;} Basic Class Selector To apply a background-color and text color to elements with a specific class,…
-
Group Selectors
Group Selectors in CSS CSS group selector applies the same style to multiple elements at a time. The names of elements can be separated by commas. Group selector keeps CSS concise and avoids redundancy. Syntax The syntax for the CSS group selector is as follows: #selector_1, .selector_2, selector_3{/* property: value; */color: #04af2f } CSS Group Selectors Example…
-
ID Selectors
ID Selectors in CSS CSS ID selector selects a single element with a particular value for the id attribute. An id in CSS is denoted by the “#” (hash) symbol. The same class can be applied to multiple elements, but an id is unique for an element. Syntax The syntax for the CSS id selector…
-
Universal Selectors
Universal Selectors in CSS CSS universal selector is a special selector that selects all the elements in an HTML document. It is denoted by an asterisk mark (*). Universal selector is used to set a similar style for the entire document. Syntax The syntax for the CSS universal selector is as follows: *{margin: 0;padding: 0;} Using…
-
Cascading in CSS?
CSS Cascading Cascading in CSS refers to a process where a browser determines which rule to apply on any element when various conflicting rules exist. The cascade follows a structured order to specify which style rule will take precedence over other style rules. Key Factors of CSS Cascading The key factors for deciding which CSS rule will…
-
user select Property
CSS user-select property determines whether text can be selected by the user, with no effect on content loaded as part of a browser’s user interface (chrome) other than textboxes. While user-select is not inherited, its initial “auto” value often makes it behave as if it is inherited. WebKit/Chromium-based browsers implement the property as inherited, which violates the specification and…
-
accent color Property
CSS accent-color property determines the accent color that can be applied to user-interface controls such as radio button, checkboxes, buttons etc. This property gives the flexibility to assign color of user’s choice to the user-interface control. Syntax accent-color: auto | color | initial | inherit; Value Description auto The browser selects the accent color. Default value. color…
-
offset Property
The CSS shorthand property offset makes it easier for an element to animate along a certain path. Constituent Properties The offset property is a shorthand for the following CSS properties: Possible Values The following list of values is accepted by offset shorthand property. Applies to Transformable elements Syntax offset = [ <‘offset-position’>? [ <‘offset-path’> [ <‘offset-distance’> || <‘offset-rotate’> ]? ]? ]!…
-
min inline size Property
CSS min-inline-size property sets the minimum inline size of an element. The direction of the inline is determined by the writing-mode property. The property has no effect, if the content fits well within the inline size of the element. Syntax min-inline-size: auto | length | percentage | initial | inherit; Property Values Value Description auto No width limit is…
-
max inline size Property
CSS max-inline-size property sets the maximum inline size of an element. The direction of the inline is determined by the writing-mode property. The property has no effect, if the content fits well within the inline size of the element. Syntax max-inline-size: auto | length | percentage | initial | inherit; Property Values Value Description auto No width limit is…