Cascading Style Sheets (CSS)

Cascading Style Sheets (CSS)

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

Property value (rule set)

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (12)

Section 1

(12 cards)

Property value (rule set)

Front

To the right of the property after the colon, we have the property value, which chooses one out of many possible appearances for a given property (there are many color values besides red).

Back

Properties (rule set)

Front

Ways in which you can style a given HTML element. (In this case, color is a property of the <p> elements.) In CSS, you choose which properties you want to affect in your rule.

Back

How does CSS work?

Front

1. The browser converts HTML and CSS into the DOM (Document Object Model). The DOM represents the document in the computer's memory. It combines the document's content with its style. 2. The browser displays the contents of the DOM.

Back

external style sheet

Front

An external stylesheet is when you have your CSS written in a separate file with a .css extension, and you reference it from an HTML <link> element. This method is arguably the best, as you can use one stylesheet to style multiple documents, and would only need to update the CSS in one place if changes were needed.

Back

Selector (rule set)

Front

The HTML element name at the start of the rule set. It selects the element(s) to be styled (in this case, <p> elements). To style a different element, just change the selector.

Back

Anatomy of a CSS ruleset

Front

The whole structure is called a rule set (but often "rule" for short). Parts: - Selector - Declaration - Property - Property value

Back

Internal styelsheet

Front

An internal stylesheet is where you don't have an external CSS file, but instead place your CSS inside a <style> element, contained inside the HTML head. This can be useful in some circumstances (maybe you're working with a content management system where you can't modify the CSS files directly), but it isn't quite as efficient as external stylesheets — in a website, the CSS would need to be repeated across every page, and updated in multiple places if changes were required.

Back

CSS (Cascading Style Sheets)

Front

A style sheet language used for describing the presentation semantics (the look and formatting) of a document written in a markup language.

Back

Inline styles

Front

Inline styles are CSS declarations that affect one element only, contained within a style attribute. Please don't do this, unless you really have to! It is really bad for maintenance (you might have to update the same information multiple times per document), and it also mixes your presentational CSS information with your HTML structural information, making the CSS harder to read and understand.

Back

DOM (Document Object Model)

Front

A DOM has a tree-like structure. Each element, attribute and piece of text in the markup language becomes a DOM node in the tree structure. The nodes are defined by their relationship to other DOM nodes. Some elements are parents of child nodes, and child nodes have siblings.

Back

Declaration (rule set)

Front

A single rule like color: red; specifying which of the element's properties you want to style.

Back

Document

Front

Usually a text file structured using a markup language - HTML is the most common markup language, but includes SVG or XML.

Back