It's used for website layout and design used alongside HTML, and other mark up language like XHTML.
.
Doesn't have any logic strictly presentational but technology such as SASS/LESS allows you to use things like variables and conditionals.
3 Methods can be used when adding CSS.
Inline CSS.
This is done by adding directly into the THML elements. eg:
<h1 style="color: red">Heading<h1>its strictly not advised and it looks very unprofressional.
Internal CSS
This done by adding style tags within a single document.
eg;
<style type="text/css"> h1 {color:red} </style>
3. External CSS
This is done by linking separate CSS file to an HTML file.
that is to say;
in an HTML doc it will look like this;
<link rel= "style sheet" type="text/css" href="css/style.css">
the css in the href represents the actual folder the _style.css _ is in.
if it was in the same folder it would be only href ="style.css".
CSS Selectors
a { background color: yellow; }
so
a - is a selector
{ - is a declaration start
back ground color - is aproperty
: - is property/value separator
yellow - is the value
; - is the declaration seperator.
} - is the decclaration end.
Colors in CSS
colors can be represented in different types that are _
names eg, red
hexadecimal values eg #000000 that is black
or RGB Fonts in CSS_
so there are web safe fonts and other fonts
websafe fonts
these are fonts that are already there by default eg Arial, or Sans-serif
but
Other fonts
these fonts can be imported from different sources eg google fonts, these fonts are special. eg
Dosis or Misty rose.
font-weight: is lightness or boldness of a font.
Difference between class and id in CSS
id can be used the same as a class but the difference is that id is used to specify a unique element. ids do not repeat.
Class can be used multiple times
Margin in CSS
margin is the distance or space outside the border, top, bottom, right, left.
Padding in CSS
the space between the element and its border. from the top, bottom, right, left.
Border radius:
gives radius around the edges of a box or container.
Positionig in CSS
static
Element positioned in a default position. Keeps element in the order of document flow.
Relative_
Element is positioned relative to its normal position. Falls naturally.
Absolute
allow us to target whatever position we want inside a relative element.
Fixed
It will always leave the element on the same position on the browser, no matter how you navigate.
Initial.
Sets the property to its default value.
Inherit
Will inherit whatever property to its parent value.
CSS
The word CSS stands for Cascading Style Sheets.
It's not a programming language.
it's a style sheet/styling language
It's used for website layout and design used alongside HTML, and other mark up language like XHTML. .
Doesn't have any logic strictly presentational but technology such as SASS/LESS allows you to use things like variables and conditionals.
3 Methods can be used when adding CSS.
Inline CSS. This is done by adding directly into the THML elements. eg:
<h1 style="color: red">Heading<h1>
its strictly not advised and it looks very unprofressional.Internal CSS This done by adding style tags within a single document. eg;
<style type="text/css"> h1 {color:red} </style>
3. External CSS
This is done by linking separate CSS file to an HTML file. that is to say;
in an HTML doc it will look like this;
<link rel= "style sheet" type="text/css" href="css/style.css">
thecss in the href represents the actual folder the _style.css _ is in
. if it was in the same folder it would be onlyhref ="style.css"
.CSS Selectors
a { background color: yellow; }
so a - is a selector { - is a declaration start back ground color - is aproperty : - is property/value separator yellow - is the value ; - is the declaration seperator. } - is the decclaration end.Colors in CSS colors can be represented in different types that are _
names eg, red
hexadecimal values eg #000000 that is black
or RGB Fonts in CSS_ so there are web safe fonts and other fonts
websafe fonts these are fonts that are already there by default eg Arial, or Sans-serif but Other fonts these fonts can be imported from different sources eg google fonts, these fonts are special. eg Dosis or Misty rose. font-weight: is lightness or boldness of a font.
Difference between class and id in CSS
id can be used the same as a class but the difference is that id is used to specify a unique element. ids do not repeat.
Class can be used multiple times
Margin in CSS
margin is the distance or space outside the border, top, bottom, right, left.
the space between the element and its border. from the top, bottom, right, left.
Border radius: gives radius around the edges of a box or container.
Positionig in CSS
static Element positioned in a default position. Keeps element in the order of document flow.
Relative_ Element is positioned relative to its normal position. Falls naturally.
Absolute allow us to target whatever position we want inside a relative element.
Fixed It will always leave the element on the same position on the browser, no matter how you navigate.
Initial. Sets the property to its default value.
Inherit Will inherit whatever property to its parent value.
Thats it to the short summary on CSS