text-align: right; : text align « CSS « HTML / CSS






text-align: right;

  

<!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' xml:lang='en'>
    <head>
        <title>text-align</title>
<style type='text/css'>
body {
    font: 12px sans-serif;
}
h1 {
    font: 14px sans-serif;
    margin: 0;
    color: darkslateblue;
    border-bottom: 1px solid steelblue;
}
p {
    color: darkslateblue;
    padding: 10px;
}
p#left {
    text-align: left;
}
p#center {
    text-align: center;
}
p#right {
    text-align: right;
}
p#justify {
   text-align: justify;
}
</style>


    </head>
    <body>
        <h1>Mitch Hedberg Quotes</h1>
        <p id='left'>
            "Fettuccine alfredo is macaroni and cheese for adults."
        </p>
        <p id='right'>
            "Rice is great if you're really hungry and want to eat two
            thousand of something."
        </p>
        <p id='center'>
            "I'm lactose intolerant, so I eat my cereal with a fork."
        </p>
        <p id='justify'>
            "this is a test. this is a test. this is a test. this is a test. 
            this is a test. this is a test. this is a test. this is a test. 
            this is a test. this is a test. this is a test. this is a test. 
            this is a test. this is a test. this is a test. this is a test. 
            this is a test. this is a test. this is a test. this is a test. 
            this is a test. this is a test. this is a test. this is a test. 
            this is a test. this is a test. this is a test. this is a test. 
            this is a test. this is a test. this is a test. this is a test. 
            this is a test. this is a test. this is a test. this is a test. 
            this is a test. this is a test. this is a test. this is a test. 
            this is a test. this is a test. this is a test. this is a test. 
            this is a test. this is a test. this is a test. this is a test. 
            this is a test. this is a test. this is a test. this is a test. "
        </p>
    </body>
</html>

   
    
  








Related examples in the same category

1.The text-align Property
2.'text-align' Example
3.text-align all possible values
4.text-align: justify
5.text-align:right;
6.text-align:left;
7.text align center
8.text-align: left;
9.text-align: center;
10.text-align: justify;
11.text-align:left;right;center;justify;
12.Right align text
13.Text flows out of the boundaries