Internal CSS
An internal style sheet is useful when a single HTML page needs its own unique style.
The internal styles are written inside a <style> element, placed in the <head> section of the page.
Example
The styles are defined inside the <style> element in the <head> section.
Prompt
An HTML page that uses internal CSS in a
<style> element inside the <head>.
Set the body background to linen, and make <h1> maroon with a left margin of 40px. Add a heading and a paragraph in the body.
Output: complete HTML page
index.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background-color: linen;
}
h1 {
color: maroon;
margin-left: 40px;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>