Q&A
Ask and answer questions to make information more available to wider audiences.
Dalton Ahern @aherndalton   15, Jun 2023 12:00 AM
included CSS in HTML
How many types of CSS can be included in HTML?
answers 4
 
Answer 1
Anthony Bearcub @anthonybearcub   22, Jun 2023 11:24 AM
External CSS – using a <link> element to link to an external CSS file
It is used when the style is applied to many pages. To use an external CSS, add a link to it in the <head> section of each HTML page. 

Example: 
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
 
Answer 2
Anthony Bearcub @anthonybearcub   22, Jun 2023 11:24 AM
Internal or Embedded CSS – using <style> element in the <head> section
It requires you to add <style> tag in the <head> section of the HTML document. It is most suited for styling a single page that has a unique style. However, using this style for multiple pages is time-consuming as CSS rules need to be added to every page of the website.

Example: 
<head>  
<style>  
body {  
    background-color: black;  
}  
h1 {  
    color: red;  
    padding: 50px;  
}   
</style>  
</head>  
 
Answer 3
Anthony Bearcub @anthonybearcub   22, Jun 2023 11:23 AM
Inline CSS – using the style attribute inside HTML elements
Inline CSS is used for styling small contexts. It contains the CSS property in the body section attached to the element. The style attribute is used in the relevant tag to use inline styles added.

Example: 
<!DOCTYPE html>  
<html>  
<body style="background-color:white;">  
<h1 style="color:red;">A Red Heading</h1>
<p style="color:blue;">A blue paragraph.</p>
</body>  
</html>  
 
Answer 4
Anthony Bearcub @anthonybearcub   22, Jun 2023 11:23 AM
There are three types of CSS:  Inline CSS, Internal or Embedded CSS, External CSS