To elaborate 3 types of CSS ,we will disqus each below to formulate the same result.
- Inline styles
- Embedded styles
- External styles
1. Inline style
Inline styles are styles that are written directly in the tag on the document. It will affect only the tag they are applied to.
<html>
<head>
<title>3 Types of CSS styles</title>
</head>
<body>
<p style="font-size:20px;">Three types of CSS style</p>
</body>
</html>
2. Embedded style
Embedded styles are styles that are embedded in the head of the document.
<html>
<head>
<title>3 Types of CSS styles</title>
<style type="text/css">
p{
font-size:20px;
}
</style>
</head>
<body>
<p>Three types of CSS style</p>
</body>
</html>
3. External style
External styles are styles that are written in a separate document and more often called in the head element.
<html>
<head>
<title>3 Types of CSS styles</title>
<link rel="stylesheet" type="text/css" href = "style.css">
</head>
<body>
<p>Three types of CSS style</p>
</body>
</html>
style.css
p{
font-size:20px;
}
Disclaimer: The view and opinions expressed in this blog post are that of the author and do not in any way represents the agency or department he/she currently belongs to. Further, this information should not be interpreted as an endorsement of any specific provider, service or offering.