HTML/CSS/CSS Attributes and Javascript Style Properties/text indent
Содержание
text indent: -0.75em
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
ul {
width: 30%;
padding: 0 0 0.75em 0;
margin: 0;
list-style: none;
}
li {
text-indent: -0.75em;
margin: 0.33em 0.5em 0.5em 1.5em;
}
</style>
</head>
<body>
<h3>
Table of Contents
</h3>
<ul>
<li>D</li>
<li>P</li>
<li>B</li>
<li>A?</li>
<li class="last">S</li>
</ul>
</body>
</html>
text-indent: 25%
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<style type="text/css">
p {
text-indent: 25%;
width: 200px;
}
</style>
</head>
<body>
<p>
This is a test. This is a test. This is a test. This is a test.
</p>
</body>
</html>
text-indent: 25px;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<style type="text/css">
p {
text-indent: 25px;
width: 200px;
}
</style>
</head>
<body>
<p>
This is a test. This is a test. This is a test. This is a test.
</p>
</body>
</html>
text-indent: -25px (positive value)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<style type="text/css">
p {
text-indent: -25px;
width: 200px;
}
</style>
</head>
<body>
<p>
This is a test. This is a test. This is a test. This is a test.
</p>
</body>
</html>
text-indent: 3em
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>CSS Example</title>
<style rel="stylesheet" type="text/css">
body {
color: #000000;
background-color: #ffffff;
font-family: arial, verdana, sans-serif;
font-size: 12px;
}
.indent {
text-indent: 3em;
}
</style>
</head>
<body>
<h1>text-indent</h1>
<p>aligned with the left-hand side of the browser window. </p>
<p class="indent">The content of this paragraph should be indented by 3 em.</p>
</body>
</html>
text-indent: -5%
<html>
<head>
<title>Percentages Demo</title>
<style type="text/css">
p {text-indent: -5%;
margin-left: 25%;
margin-right: 15%;
font-size: 150%;
</style>
</head>
<body>
<p>This paragraph"s font and margins have been set with percentages.
The indent was set with a negative percentage.</p>
</body>
</html>
"text-indent" Example
<html>
<body>
<div style="width:200; background-color:beige; text-indent:100px">
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
This is a sample paragraph with an indent of 100px.
</div>
</body>
</html>