Internal-CSS
Internal CSS
- Inline CSS is a practice of including CSS styles directly within an HTML element's style attribute.
- It takes precedence over external CSS files and internal styles defined in the <style> element in the document head, so Inline CSS is the most specific way to apply styles to an element.
Syntax:
<style>
body {
background-color: powderblue;
}
h1 {
color: blue;
}
p {
color: red;
}
</style>
- <element>: Indicates the HTML element we want to style.
- property: property you want to apply.
- value: the value you want to assign to the property.
Key Points:
- Internal styles are defined within the <style> element, inside the<head> section of an HTML page.
Example:
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: powderblue;
}
h1 {
color: blue;
}
p {
color: red;
}
</style>
</head>
<body>
<h1>Welcome to</h1>
<p>Quipoin.</p>
</body>
</html>
Output: