- Courses
- HTML
- HTML top level tags
- <style>
- Purpose of the style element
What role does the <style>
element play in the structure of an HTML document?
The style element provides internal CSS for styling the document.
The <style>
element is used within the <head>
section of an HTML document to include internal CSS. It allows developers to define styles directly within the HTML file, which are then applied to the document's content. This is useful for quick styling or when external stylesheets are not feasible.
<head>
<style>
p { color: red; }
</style>
</head>
More cards6
Show allHow does the
What is the function of the blocking
attribute in the <style>
element?
In the following code, what background color will the paragraph have?
<style>
p { background-color: blue; }
</style>
<style>
p { background-color: yellow; }
</style>
<p>This is my paragraph.</p>