Skip to main content

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