Html Style

Advertisements

Hyperlink in HTML Image Tag in HTML

Html Style

Every Html element has a default style. Default background color is white, text color is black, text-size is 16px . For changing these default style of an Html element, you need to use style attribute. Below example changes the default text color from black to red:.

Example

<html>
<body>
<p>This is my html page.</p>
<p style="color:red;">Html is Simple and easy to learn.</p>
</body>
</html>

Result

This is my html page.

Html is Simple and easy to learn.

Style Attribute

Syntax

style="property:value"
  • Text color: The color property defines the text color
  • Text font: The font-family property defines the font
  • Text size: The font-size property defines the text size
  • Text alignment: The text-align property defines the horizontal text alignment

Example

<!DOCTYPE html>
<html>
<body>
<h1 style="font-size:20px">This is a heading</h1>
<p style="font-color:red">This is a paragraph.</p>
<p style="font-family:courier">This is Second paragraph.</p>
<p style="text-align:center">This is Third paragraph.</p>
</body>
</html>

Result

This is a heading

This is a paragraph.

This is Second paragraph.

This is Third paragraph.


Hyperlink in HTML Image Tag in HTML

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements