welcome to tutorialfamily

css text

css text property used for applying alignment of element.

Various type of alignment given below.


css text

  • text-align: center – set text to center
  • text-align: left – set text to left
  • text-align: right – set text to right
  • text-align: justify – set text to auto
  • text-decoration: none – used for underline and none

css text


						        
<!DOCTYPE html>
<html>
<head>
   <title>css tutorial</title>
<style>
h1{
   text-align: left;
   color: red;  
   border: 1px dotted #000;
   margin: 5px;
}
h2{
   text-align: center;
   color: red;  
   border: 1px dotted #000;
   margin: 5px;
}
h3{
   text-align: right;
   color: red;  
   border: 1px dotted #000;
   margin: 5px;
}
h4{
   text-align: justify;
   color: red;  
   border: 1px dotted #000;
   margin: 5px;
}
h5{
   text-decoration: none;
   color: red;  
   border: 1px dotted #000;
   margin: 5px;
}
h6{
   text-decoration: underline;
   color: red;  
   border: 1px dotted #000;
   margin: 5px;
}
</style>
</head>
<body>
   <h1>my car</h1>
   <h2>my car</h2>
   <h3>my car</h3>
   <h4>my car</h4>
   <h5>my car</h5>
   <h6>my car</h6>
</body>
</html>


Run

Our Content