Styling Link

នៅ​ក្នុង​ភាសា HTML តំណរភ្ជាប់​ទៅ​កាន់​គេហទំព័រ​ផ្សេង​ៗ ត្រូវ​ធ្វើ​ឡើង​ដោយ​ផ្តល់​តំលៃ​ជា​អាស័យដ្ឋាន​នៃ​គេហទំព័រ​ណា​មួយ​អោយ​ទៅ attribute href របស់​ a ដែល​ដើរ​តួនាទី​យ៉ាង​ចំបង​នៅ​ក្នងុ​ការធ្វើ​ដំណរ​ភ្ជាប​ទាំងឡាយ​។ អាស្រ័យ​ហេតុ​នេះ ការកែច្នៃ​រចនា element a ដោយ​ប្រើប្រាស់​ភាសា CSS ជា​រឿង​ដ៏​សំរាប់​មួយ នៅក្នុង​ការបង្កើត​គេហទំព័រ​មាន​លក្ខណៈ​អាជីព​ទាំងឡាយ​។ ជាក់ស្តេង យើង​អាច​រចនា​ element a ស្ថិត​ក្នុង​សភាព​ផ្សេង​ៗ ដោយ​ធ្វើ​ដូច​ខាង​ក្រោម​នេះ៖

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Styling Link</title>
    <style>
      /* unvisited link */
	  a:link {
  		color: red;
	  }

	  /* visited link */
	  a:visited {
  		color: green;
	  }

	  /* mouse over link */
	  a:hover {
  		color: hotpink;
	  }

	  /* selected link */
	  a:active {
  		color: blue;
	  }
    </style>
  </head>
  
  <body>
	

This is a link

Note: a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective.

Note: a:active MUST come after a:hover in the CSS definition in order to be effective.

</body> </html>

This is a link

Note: a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective.

Note: a:active MUST come after a:hover in the CSS definition in order to be effective.


នៅ​ក្នុង​ការអនុវត្ត​ជាក់ស្តែង គេ​និយម​ធ្វើការកែច្នៃ element a អោយ​ទៅ​ជា​ប៊ូតុង​ចុច​មួយ​បាន ដោយ​ធ្វើ​ដូច​ខាង​ក្រោម​នេះ៖

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Styling Link</title>
    <style>
      a:link, a:visited {
  		background-color: #f44336;
  		color: white;
  		padding: 14px 25px;
  		text-align: center;
  		text-decoration: none;
	  }

	  a:hover, a:active {
  		background-color: red;
	  }
    </style>
  </head>
  
  <body>
	

Link Button

A link styled as a button:

This is a link </body> </html>

Link Button

A link styled as a button:

This is a link