Showing posts with label Html Style. Show all posts
Showing posts with label Html Style. Show all posts

Wednesday, December 26, 2018

Text Alignment.

HTML TEXT ALIGNMENT:-

<html>
<body>

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

</body>
</html>

OUTPUT:-

  • The text-align property defines the horizontal text alignment for an HTML element

Text Size.

HTML TEXT SIZE:-

<html>
<body>

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

</body>
</html>

OUTPUT:-

  • The font-size property defines the text size for an HTML element.
  • EXAMPLE:- <h1 style="font-size:150%;">This is a heading</h1>

Text Style.

HTML TEXT TYPE:-

<html>
<body>

<h1 style="font-family:verdana;">This is a heading</h1>
<p style="font-family:courier;">This is a paragraph.</p>

</body>
</html>

OUTPUT:-

  • The font-family property defines the font to be used for an HTML element.
  • EXAMPLE:- <h1 style="font-family:verdana;">This is a heading</h1>.

Text colour.

HTML TEXT COLOUR:-

<html>
<body>

<h1 style="color:green;">This is a heading</h1>
<p style="color:pink;">This is a paragraph.</p>

</body>
</html>

OUTPUT:-

  • The color property defines the text color for an HTML element.
  • EXAMPLE:- <h1style="color:brown;">This is a heading</h1>

Background colour.

HTML Background colour:-

<html>
<body style="background-color:blue;">

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

</body>
</html>

OUTPUT:-

  • The background-color property defines the background color .
EXAMPLE:- <body style="background-color:blue;">

Style.

HTML STYLE:-

<html>
<body>

<p>I am normal</p>
<p style="color:yellow;">I am Akash.</p>
<p style="color:green;">I am Ansh.</p>
<p style="font-size:150px;">I am Operator.</p>

</body>
</html>

OUTPUT:- 

  • Setting the style of an HTML element, can be done with the <style> attribute.
  • SYNTAX:- <tagnamestyle="property:value;">.

Internal Javascripts

Internal Javascripts :    The script code can be written directly into the HTML document. script code is placed in header of the docume...