HTML Style

 HTML Style Attribute

Without styling HTML is incomplete.
syntax of HTML styling is

<tagname style="property:value;">

HTML Text Color

It is very simple to change the color of your  text.

color property use for HTML text color.

Color codes are easily available in internet.You can also use the name of color as use in example

Example

<html>
<body>

<h1 style="color:#009;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>

</body>
</html>

HTML Background Color

Same as the text color you can also change the background colour of your web page.

Example


<html>

 <body style="background-color:#CFC;">

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


 </body>
</html>

HTML Fonts

To change the font of your text, use the  font-family property.

Example

<html>
<body>

<h1 style="font-family:Elephant;">This is a heading</h1>
<p style="font-family:Arial Narrow;">This is a paragraph.</p>

</body>
</html>

HTML Text Size

To change the size of your text, use the  font-size property.

Example

<html>
<body>

<h1 style="font-size:300%;">This is a heading</h1>
<p style="font-size:180%;">This is a paragraph.</p>

</body>
</html>

HTML Text Alignment

You can also adjust the alignment of our text, use the text-align property.

Example

<html>
<body>

<h1 style="text-align:center;">Centered Heading</h1>
<p style="text-align:center;">Centered paragraph.</p>

</body>
</html>

No comments:

Post a Comment