1
1
style, Display Mango, Banana and Apple in font color “Blue” and Tomato, Potato and Carrot in
font color “Orange” using internal stylesheet, set background color for Fruits and Vegetables to
pink using external stylesheet). Hint: use id/class attributes and/or styles for nested tags.
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Styled List</title>
<style>
/* Internal stylesheet */
#fruits-list li {
color: blue;
#vegetables-list li {
color: orange;
ul li {
color: red;
</style>
</head>
<body>
<h1>shirish singh</h1>
<h1>roll no.23</h1>
<ul>
<!-- Fruits -->
<li style="list-style-type:square">Fruits
<ol id="fruits-list">
</ol>
</li>
<ol id="vegetables-list">
</ol>
</li>
</ul>
</body>
</html>
Output:
Q.3) Aim: