From df72d90f00f6411b89d0dd1edfd7b3eb633ad206 Mon Sep 17 00:00:00 2001 From: Heerko Date: Tue, 6 Jul 2021 11:29:57 +0200 Subject: [PATCH] added list of common properties --- front/docs/CSS.md | 72 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 11 deletions(-) diff --git a/front/docs/CSS.md b/front/docs/CSS.md index d18faaf..0901aeb 100644 --- a/front/docs/CSS.md +++ b/front/docs/CSS.md @@ -4,7 +4,7 @@ CSS (Cascading Style Sheets) is the language that allows you to style and layout HTML web pages. This article explains what CSS is, with some simple syntax examples, and also covers some key terms about the language. -Since this document relates specifically to **Chatty-pub**, the focus is going to be on the parts of the language that are supported by this platform. Because CSS is specifically oriented towards styling HTML (and related languages like SVG and XML) you have to have a basic understanding of HTML.[^1] Mozilla has an excellent [HTML introduction](https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started). +Since this document relates specifically to **Chatty-pub**, the focus is going to be on the parts of the language that are supported by this platform. Because CSS is specifically oriented towards styling HTML (and related languages like SVG and XML) you have to have a basic understanding of HTML.[1](#footnote1) Mozilla has an excellent [HTML introduction](https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started). At its heart, HTML is a fairly simple language made up of elements, which can be applied to pieces of text to give them different meaning in a document (Is it a paragraph? Is it a bulleted list? Is it part of a table?), structure a document into logical sections (Does it have a header? Three columns of content? A navigation menu?), and embed content such as images and videos into a page. But what HTML does not do is speficy how these elements should look. That is where CSS comes in. @@ -16,7 +16,7 @@ In Chatty-pub we're mostly interested in the first part. #### _Elements and Classes_ -In this section we will talk about CSS in general. Chatty-pub uses a slight variation on it, but it is good to know the basics, right? +In this section we will talk about CSS in general. Chatty-pub uses a slight variation on it, but let's start with the basics. CSS is a rule-based language — you define rules specifying groups of styles that should be applied to particular elements or groups of elements on your web page. For example "I want the main heading on my page to be shown as large red text." @@ -31,12 +31,14 @@ h1 { The rule opens with a selector. This selects the HTML element that we are going to style. In this case we are styling all level one headings (`

`) that appear on the page. -We then have a set of curly braces `{` `}`. Inside those will be one or more declarations, which take the form of property and value pairs. Each pair specifies a property of the element(s) we are selecting, then a value that we'd like to give the property. +We then have a set of curly braces `{` `}`. Inside those will be one or more declarations, which take the form of property and value pairs. Each pair specifies a property of the element(s) we are selecting, then a value that we'd like to give the property. Each pair is followed by a semi-colon `;` to indicate the end of the property. Before the colon, we have the property, and after the colon, the value. CSS properties have different allowable values, depending on which property is being specified. In our example, we have the color property, which can take various color values. We also have the font-size property. This property can take various size units as a value. The example above will style all the `H1` elements on the page. You could also write a selector for all paragraphs (the selector would be `p`), images (`img`) or list items (`li`). This works as long as you want all of the elements of that type in your document to look the same. Most of the time that isn't the case and so you will need to find a way to select a subset of the elements without changing the others. The most common way to do this is to add a class to your HTML element and target that class. +Take this HTML: + ```lang=html