Thursday, 4 May 2017

Set heading tag and Paragraph tag style using CSS

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:

1 comment: