Indenting the First Line

Description

The text-indent property controls how to specify an indentation for the first line of a block of text.

It isexpressed either as a length or as a percentage of the width of the containing element.

Example

The following code shows the use of text-indent Property.


<!DOCTYPE HTML>
<html>
<head>
<style>
p  {<!-- w w w .  ja  v a2 s.  c  o m-->
    margin:  15px;
    padding: 5px;
    border: medium double   black;
    background-color: lightgrey;
    float:left;
    text-indent: 15%;
}
</style>
</head>
<body>
    <p>this is  a test.</p>
</body>
</html>

Click to view the demo





















Home »
  HTML CSS »
    CSS »




CSS Introduction
CSS Background
CSS Border
CSS Box Layout
CSS Text
CSS Font
CSS Form
CSS List
CSS Selectors
CSS Others
CSS Table