Set heading tag and Paragraph tag style using CSS:
In CSS we define H1, H2 and P Tag this
<html>
<head>
<title>
Set heading tag and Paragraph tag style using CSS
</title>
<style>
body {
background-image:url('C:\Users\Public\Pictures\Sample Pictures\Desert.jpg');
}
h1{ // H1 Heading tag
text-align: center; //text alignment is center
color: blue; //set color blue
}
h2{ //H2 heading tag
text-align: center; //text alignment is center
color: red; // color is red
}
p {
text-align: center;
color: green;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
<h2>Smaller heading!</h2>
<p>This is a paragraph.</p>
</body>
</html>
Browser view of above Web Page:
In CSS we define H1, H2 and P Tag this
<html>
<head>
<title>
Set heading tag and Paragraph tag style using CSS
</title>
<style>
body {
background-image:url('C:\Users\Public\Pictures\Sample Pictures\Desert.jpg');
}
h1{ // H1 Heading tag
text-align: center; //text alignment is center
color: blue; //set color blue
}
h2{ //H2 heading tag
text-align: center; //text alignment is center
color: red; // color is red
}
p {
text-align: center;
color: green;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
<h2>Smaller heading!</h2>
<p>This is a paragraph.</p>
</body>
</html>
Browser view of above Web Page:
Code woks . Keep updating UI online course Bangalore
ReplyDelete