Header Ads

Indentig Paragraph




Indenting is the process of setting of the text from its normal position, either to the left or
to the right. In paragraph style, there are three types of indentation:


  • First line indent - The text–indent property is used in the CSS for indenting the first line of a paragraph. Code Snippet 3 demonstrates inline style for <p> tag and an internal CSS code for first line indent.
Code Snippet 3:

Inline style


<p style=”text-indent: 50px”>


Internal CSS


p {text-indent: 50px}


Code Snippet 4 demonstrates the use of the text–indent property in the HTML
file.
Code Snippet 4:
<!DOCTYPE HTML>
<html>
<head>
<title>Font Gallery</title>
<style>
p {text-indent: 150px}
</style>
</head>
<body>
<p>The font styles properties allow you to specify the font for the text. They allow
you to change the different font attributes of the text such as font, size, and style
of the text. The browser must support the font specified by the font properties.
Otherwise, it will display the default font, which is dependent on the browser.
</p>
</body>
</html>
Figure  shows the output of text-indent property.



  • Padding - The padding property is used to add a specified amount of space between the border of an element and its contents.
Code Snippet 5 demonstrates the inline style for <p> tag and an internal CSS code for padding property.


Code Snippet 5:

Inline style

<p style=”padding: 20px”>

Internal CSS

p {padding: 20px}

Code Snippet 6 demonstrates the use of the text–indent property in the html fie.

Code Snippet 6:

Figure shows the padding property.
<!DOCTYPE HTML>
<html>
<head>
<title>Font Gallery</title>
<style>
p {padding: 20px }
</style>
</head>
<body>
<p>The font styles properties allow you to specify the font for the text. They allow
you to change the different font attributes of the text such as font, size, and style
of the text. The browser must support the font specified by the font properties.
Otherwise, it will display the default font, which is dependent on the browser.</p>
</body>
</html>




  • Margin - The margin property is used to add a specified amount of white space around an element, on the outside of the element.
Code Snippet 7 demonstrates the inline style for <p> tag and an internal CSS code for margin property.

Code Snippet :


Inline style


<p style=”margin: 20px”>


Internal CSS


p {margin: 20px}
















No comments:

Powered by Blogger.