HTML-CSS: Reset all styles
HTML-CSS : Exercise-41 with Solution
Using HTML, CSS resets all styles to default values using only one property.
- Use the all property to reset all styles (inherited or not) to their default values.
- Note: This will not affect direction and unicode-bidi properties.
HTML Code:
<!--License: https://bit.ly/3GjrtVF--><!-- Comment: Indicates the license information for the code -->
<!DOCTYPE html><!-- Comment: Declares the document type and version of HTML -->
<html><!-- Comment: Indicates the start of the HTML document -->
<head><!-- Comment: Contains meta-information about the HTML document -->
<meta charset="utf-8"><!-- Comment: Declares the character encoding for the document -->
<meta name="viewport" content="width=device-width"><!-- Comment: Sets the viewport width to the width of the device -->
<title>Using HTML, CSS resets all styles to default values using only one property</title><!-- Comment: Sets the title of the document -->
</head><!-- Comment: End of the head section -->
<body><!-- Comment: Contains the content of the HTML document -->
<div class="reset-all-styles"><!-- Comment: Creates a div element with the class "reset-all-styles" to apply the reset -->
<h5>w3resource</h5><!-- Comment: Displays the heading "w3resource" -->
<p><!-- Comment: Contains a paragraph of text -->
Lorem ipsum dolor sit amet consectetur adipisicing elit. Iure id
exercitationem nulla qui repellat laborum vitae, molestias tempora velit
natus. Quas, assumenda nisi. Quisquam enim qui iure, consequatur velit sit?
</p>
</div>
</body>
</html><!-- Comment: End of the HTML document -->
Explanation:
CSS Code: Explanation: HTML-CSS Editor:
See the Pen
html-css-practical-exercises by w3resource (@w3resource)
on CodePen.
.reset-all-styles {
all: initial; /* Comment: Resets all CSS properties to their initial values */
}
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/html-css-exercise/html-css-practical-exercises/html-css-practical-exercise-41.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics