Horje

How to add Multiple styles for the same elements in HTML <style> Tag

Multiple styles for the same elements.

index.html
Example: HTML
<!DOCTYPE html>
<html>
<head>
<style>
  h1 {color:red;}
  p {color:blue;}
</style>
<style>
  h1 {color:green;}
  p {color:pink;}
</style>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

<p>Notice that if some properties have been defined for the same selector (element) in different style sheets, the value from the last read style sheet will be used!</p>

</body>
</html>

Output should be:

How to add Multiple styles for the same elements in HTML <style> Tag




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin