Class

Posted by & filed under C.

A class selector in CSS looks like this: .class { } The word “class” in that code above can be anything. It refers to the attribute on HTML elements. See the relationship between these two things: <a href=”#” class=”big-button”>Push Me</a> .big-button { font-size: 60px; } You can limit a class selector to a specific kind

Continue reading →

Child

Posted by & filed under C.

A child selector in CSS is the “greater than” symbol, it looks like this: ol > li { margin: 5px; } It means “select elements that are direct descendants only”. In this case: “select list items that are direct descendants of an ordered list”. To illustrate: <ol> <li>WILL be selected</li> <li>WILL be selected</li> <ul> <li>Will

Continue reading →

:checked

Posted by & filed under C.

The :checked pseudo-class in CSS selects elements when they are in the selected state. It is only associated with input (<input>) elements of type radio and checkbox . The :checkedpseudo-class selector matches radio and checkbox input types when checked or toggled to an on state. If they are not selected or checked, there is no match. So when a

Continue reading →

Adjacent sibling

Posted by & filed under A.

The adjacent sibling combinator in CSS isn’t a selector on it’s own, but a way of combining two selectors. For example: p + p { margin: 0; } The plus sign (+) is the adjacent sibling combinator, between two paragraph tag (element) selectors. What this means is “select any paragraph tag that is directly after

Continue reading →