Text Property

color ត្រូវ​គេ​ប្រើប្រាស់​សំរាប់​កំណត់​ពណ៌​របស់​ពុម្ព​អក្សរ​នៅ​ក្នុង​អត្ថបទ​ទាំងឡាយ​។

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Text Property</title>
    <style>
      body {
  		background-color: lightgrey;
  		color: blue;
	  }

	  h1 {
  		background-color: black;
  		color: white;
	  }
    </style>
  </head>
  
  <body>
	

This Heading is Black with White Text

This page has a grey background color and a blue text.

Another paragraph.

</body> </html>

This Heading is Black with White Text

This page has a grey background color and a blue text.

Another paragraph.


text-align ត្រូវ​គេ​ប្រើប្រាស់​សំរាប់​កំណត់​ទីតាំង​របស់​អត្ថបទ​នៅ​ក្នុង element ទាំងឡាយ​។

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Text Property</title>
    <style>
      h1 {
  		text-align: center;
	  }

	  h2 {
      text-align: left;
	  }

	  h3 {
  		text-align: right;
	  }
    </style>
  </head>
  
  <body>
	

Heading 1 (center)

Heading 2 (left)

Heading 3 (right)

The three headings above are aligned center, left and right.

</body> </html>

Heading 1 (center)

Heading 2 (left)

Heading 3 (right)

The three headings above are aligned center, left and right.


តែ​បើ​សិន​ជា​យើង​ចង់​អោយ​អត្ថប​តំរៀប​ស្មើ​គ្នា​ ទាំង​នៅ​ជ្រុង​ខាង​ឆ្វេង ទាំង​នៅ​ជ្រុង​ខាង​ស្តាំ យើង​ចាំបាច់​ត្រូវ​ផ្តល់​តំលៃ justify ​សំរាប់ property text-align

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Text Property</title>
    <style>
      div {
  		border: 1px solid black;
  		padding: 10px;
  		width: 200px;
  		height: 200px;
  		text-align: justify;
	  }
    </style>
  </head>
  
  <body>
	

Example text-align: justify;

The text-align: justify; value stretches the lines so that each line has equal width (like in newspapers and magazines).

In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since. 'Whenever you feel like criticizing anyone,' he told me, 'just remember that all the people in this world haven't had the advantages that you've had.'
</body> </html>

Example text-align: justify;

The text-align: justify; value stretches the lines so that each line has equal width (like in newspapers and magazines).

In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since. 'Whenever you feel like criticizing anyone,' he told me, 'just remember that all the people in this world haven't had the advantages that you've had.'

text-decoration ត្រូវ​ប្រើប្រាស់​សំរាប់​កំណត់​អោយ​អត្ថបទ​នៅ​ក្នុង​ element a មាន​បន្ទាត់​គូស​ពី​ក្រោម​ឬ​អត់​។ បើ​យើង​ផ្តល់​តំលៃ​ដល់ property នេះ​ជា none អត្ថបទ​នៅ​ក្នុង a នឹង​គ្មាន​ការគូសបន្ទាត់​ពី​ក្រោម​ឡើយ​។

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Text Property</title>
    <style>
      a {
  		text-decoration: none;
	  }
    </style>
  </head>
  
  <body>
	

A link with no underline: khmerjs.org/

</body> </html>

A link with no underline: khmerjs.org/


ចំណែក​ឯ text-shadow វិញ ត្រូវ​គេ​ប្រើប្រាស់​សំរាប់​ធ្វើ​អត្ថបទ​មាន​ស្រមោល​ ដោយ​ធ្វើ​ដូច​ខាង​ក្រោម​នេះ​៖
<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Text Property</title>
    <style>
       h1 {
  		text-shadow: 2px 2px 5px red;
	  }
    </style>
  </head>
  
  <body>
	

Text-shadow effect!

</body> </html>

Text-shadow effect!