How To Use Style In HTML?

How To Use Style In HTML?

To make the attractive your HTML web page use the style in html tags and attributes. The style is use with two different way first is use inside the attribute and second is used outside the tags or in body tags with <style>tags <style/>.

You need to download Sublime Text Edit for developing a web pages.

How To Use Style In HTML Attribute?

Use the style in html attribute in start of the tags. For example

 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Use Styling In HTML Tags</title>
</head>
<body>
 <h1 style="color: darkblue; text-align: center;">THIS IS FIRST HEADING</h1>
<p style="font-family: sans-serif; font-size: 18px; color: blue;">The style is use in the start of html tags with the style word</p>
</html>

In above html document we use the style in heading <h1> and in paragraph attribute .Here your can change the font style, font size, font family and much more as you want.

But in a large amount of data I recommended to you , you must use the separate css file for styling the tags. There are more benefit in css file you can apply styling more than tags in a single piece of code.

Following example will more clear about HTML Tags Styling.

Make a separate css file or write down in the bottom for html styling. The css syntax start with following code.

<style type="text/css">

</style>

We will write the code in the middle of <style></style> tags.



<body>
<h1>THIS IS FIRST HEADING</h1>

<p>The style is use in the start of html tags with the style word</p>


</body>

<style type="text/css">
h1 {

text-align: center;
color: orange;
font-family: cursive;
}
p{
text-align: center;
font-size: 18px ;
}
</style>
how to use style in html

This Post Has One Comment

Leave a Reply