WD - balises (CSS) Flashcards
What is CSS?
You can specify many style properties for any given HTML element. Each property has a name and a value, separeted by “:”. Each property declaration separated by “;”.
color:olive; font-size:24px;
Pour l’utiliser:
<p> HTML styles with CSS</p>
Inline styles
It is called inline because we declared the styles within the HTML tag itself.
Pour l’utiliser:
<p> HTML styles with CSS</p>
Embedded styles
Embedded styles are addead to the element of a document, and can contain most of the styles for the document.
My example
body { background-color: grey}
etc etc
External styles
External styles refers to creating a separate file that contains all style information. This file is then linked to from as many HTML Pages as you like -even the whole site.
You have tuse the “link” tag, providing the url of style sheet in the href attribute as well as rel”stylesheet”.
my example
Selectors
Embedded style sheets and external style sheets use selectors to specify which element to apply a style to.
Example “body” is a selector for the”” element.
#intro is an ID selector. id="intro" .colorful is a class selector. class="colorful"
foreground color (la couleur du font, de la lettre)
color:orange;
<h1> HTML colors </h1>
coleur de la bordure (encadrement de ce que tu écris)
border-color:olivedrab;
La couleur pour le surlignement de ce que tu écris
background-color:yellow;
Comment nommer une couleur?
- color name (ex: blue)
- hexadecimal (ex: #0000ff)
- RGB (ex: rgb(0,0,255))
Pour la transparence?
il faut rajouter “a”.
ex: “background-color:rgba(0,0,255,0.5)” (ça deviendra semi-transparent)