Overflow Property

overflow ជា property ដែល​អនុញ្ញាត​អោយ​យើង​អាច​ធ្វើការកំណត់​អោយ​មាន scrollbar ឬ​អត់ នៅ​ពេល​ដែល​ content នៅ​ក្នុង​ element មួយ មាន​ទំហំ​ធំ​ជាង​ទំហំ​របស់ element នោះ​។

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Overflow</title>
    <style>
      div {
  		background-color: #eee;
  		width: 200px;
  		height: 50px;
  		border: 1px dotted black;
  		overflow: visible;
	  }
    </style>
  </head>
  
  <body>
	

CSS Overflow

By default, the overflow is visible, meaning that it is not clipped and it renders outside the element's box:

You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.
</body> </html>

CSS Overflow

By default, the overflow is visible, meaning that it is not clipped and it renders outside the element's box:

You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.

យ៉ាងណាម៉ិញ បើ​សិន​ជា​យើង​មិន​ចង់​អោយ​ផ្នែក​នៃ content ដែល​ធំ​ជាង​ទំហំ​របស់​ element ណា​មួយ លេច​ចេញ​រូបរាង​មក​ខាង​ក្រៅ​នោះ​ទេ យើង​ត្រូវ​កំណត់​តំលៃ​របស់ property overflow ជា "hidden" ។

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Overflow</title>
    <style>
      div {
  		background-color: #eee;
  		width: 200px;
  		height: 50px;
  		border: 1px dotted black;
  		overflow: hidden;
	  }
    </style>
  </head>
  
  <body>
	

CSS Overflow

By default, the overflow is visible, meaning that it is not clipped and it renders outside the element's box:

You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.
</body> </html>

CSS Overflow

By default, the overflow is visible, meaning that it is not clipped and it renders outside the element's box:

You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.

លើស​ពី​នេះ​ទៀត បើ​សិន​ជា​យើង​ចង់​អោយ​ scrollbar លេច​រូបរាង​ឡើង នៅ​ពេល​ដែល content នៅ​ក្នុង element មួយ​មាន​ទំហំ​ធំ​ជាង​ទំហំ​របស់ element យើង​ចាំបាច់​ត្រូវ​ផ្តល់​តំលៃ "scroll" អោយ​ទៅ​ property overflow ដោយ​ធ្វើ​ដូច​ខាង​ក្រោម​នេះ៖

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Overflow</title>
    <style>
      div {
  		background-color: #eee;
  		width: 200px;
  		height: 100px;
  		border: 1px dotted black;
  		overflow: scroll;
	  }
    </style>
  </head>
  
  <body>
	

CSS Overflow

By default, the overflow is visible, meaning that it is not clipped and it renders outside the element's box:

You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.
</body> </html>

CSS Overflow

By default, the overflow is visible, meaning that it is not clipped and it renders outside the element's box:

You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.

យ៉ាងណាម៉ិញ បើ​សិន​ជា​យើង​ចង់​អោយ​តែ​ scrollbar ដេក​ឬ​ឈរ​លេច​ចេញ​ឡើង​តែប៉ុណ្ណោះ យើង​អាច​កំណត់​តំលៃ "hidden" ឬ "scroll" ​សំរាប់​ property "overflow-x" ឬ "overflow-y" ដោយ​ធ្វើ​ដូច​ខាង​ក្រោម​នេះ៖

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Overflow</title>
    <style>
      div {
  		background-color: #eee;
  		width: 200px;
  		height: 100px;
  		border: 1px dotted black;
  		overflow-x: hidden;
  		overflow-y: scroll;
	  }
    </style>
  </head>
  
  <body>
	

CSS Overflow

By default, the overflow is visible, meaning that it is not clipped and it renders outside the element's box:

You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.
</body> </html>

CSS Overflow

By default, the overflow is visible, meaning that it is not clipped and it renders outside the element's box:

You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.

ដូច​គ្នា​ដែរ បើ​យើង​កំណត់​តំលៃ​សំរាប់ property overflow ជា "auto", scrollbar ណាមួយ​លេច​ចេញ​ឡើង​តែ​ក្នុង​ករណី​ចាំបាច់​តែ​ប៉ុណ្ណោះ​។

<!DOCTYPE html>
<html>
  <head>
  	<meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  	<title>Overflow</title>
    <style>
      div {
  		background-color: #eee;
  		width: 200px;
  		height: 100px;
  		border: 1px dotted black;
  		overflow: auto;
	  }
    </style>
  </head>
  
  <body>
	

CSS Overflow

By default, the overflow is visible, meaning that it is not clipped and it renders outside the element's box:

You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.
</body> </html>

CSS Overflow

By default, the overflow is visible, meaning that it is not clipped and it renders outside the element's box:

You can use the overflow property when you want to have better control of the layout. The overflow property specifies what happens if content overflows an element's box.