Technical Knowledge Base

Syntax _ Project

You can add style to an element by specifying it in the style element and setting a property for it like this:

Example Code
css
element {
property: value;
}

Center the content of the h1 element by setting its text-align property to the value center.

\

You have styled three elements by writing CSS inside the style tags. This works, but since there will be many more styles, it's best to put all the styles in a separate file and link to it.
We have created a separate styles.css file for you and switched the editor view to that file. You can change between files with the tabs at the top of the editor.

link the styles.css file, so the styles will be applied again. Inside the head element, add a link element. Give it a rel attribute with the value of "stylesheet" and a href attribute with the value of "styles.css".

\ <- linking to the styles sheet for CSS code
    \ <- make the browser available for desktop and mobile

Comment syntax in CSS - /* comment here */

article elements commonly contain multiple elements that have related information.

block level elements take up the entire line of their parent element