HTML


Lesson HTML



មេរៀន HTML

HTML មកពីពាក្យ Hypertext Markup Language HTML គឺជាភាសាដំបូងសម្រាប់ សរសេរ គេហទំព័រ។ក្នុង HTML គេប្រើ Tag សម្រាប់ធ្វើការកំណត់នានា។
ឧទាហរណ៍

HTML មាន​ចែក​ជា​ពីរ​ផ្នែក​ធំ​ៗ គឺ tag Header និង tag Body ហើយ tag ទាំង​ពីរ​នេះ ត្រូវ​ស្ថិត​នៅ​ក្នុង tag HTML 
ខាង​ក្រោម​នេះ គឺ​ជា​ទំរង់​ទូទៅ​របស់ HTML
1.<html>
2.<head><title>Name of Page</title></head>
3.<body>
4.// any text here
5.</body>
6.</html>
សំគាល់:
<html> គឺជា tag ដែល​យើង​ប្រើ​ដើម្បី​បើក​នៅ​ពេល​ដែល​ចាប់​ផ្តើម​ដំបូង​និង​នៅ​ពេល​បញ្ចប់​នៃ Page របស់​យើង​។ 
<body>
គឺ​ជា tag សម្រាប់​ឲ្យ​យើង​សរសេរ​កូដ​ផ្សេង​ដើម្បី​បង្ហាញ​នៅ​លើ​Page របស់​យើង ។
ឧទាហរណ៍
1.<html>
2.<head><title>Name of Page</title></head>
3.<body>
4.This is my first time with HTML.
5.</body>
6.</html>
យើងមានកម្មវិធីជាច្រើនដែលប្រើសម្រាប់សរសេរ HTML មានដូចជា Dreamweaver, Notepad ,Notepad++ WordPad ជាដើម។

ដើម្បី​បង្កើត​នូវ Page HTML យើង​អាច​បង្កើត​តាម​កម្ម​វិធី​ជា​ច្រើន​ដូច​ជា Dreamweaver, Notepad , Notepad++ WordPad ជា​ដើម តែ​ពេល​នេះ អាយ​ធី​កូន​ខ្មែរ សូម​លើក​យក​កម្ម​វិធី Notepad មក​បង្ហាញ។ Notepad គឺ​ជា​កម្ម​វិធី​តូច​មួយ​របស់​វីន​ដូ​ផ្ទាល់ ហើយ​ជា​ទូទៅ​សម្រាប់ អ្នក​ដែល​រៀន HTML គួរ​តែ​ប្រើ​វា។
.បើកកម្មវិធីNotepad:Start->Run->Notepad (ឬចុចMouseស្តាំយកNew->TextDocument)
.ធ្វើការសរសេរCodeរបស់HTML 
. រក្សាទុកវាជា File HTML ដែលមាន Extension .html
. Tag របស់ HTML
HTML គឺជា Markup Language ដូច​នេះ​វាកើត​ឡើង​ពី​បណ្តុំ​នៃ tag ហើយ Tag របស់​វា​មាន​ពីរ​គឺ Open tag និង Close tag
ឧទាហរណ៍
1.This is my frist paragraph.
2.<h1>This is heading 1</h1>
ប៉ុន្តែ​ទន្ទឹម​នឹង​នោះ វា​ក៏​មាន tag មួយ​ចំនួន​ដែល​មិន​មាន Open tag ដូច​ឧទាហរណ៍​ខាង​ក្រោម:
1.<img src="/path/image_name.extension" ... />
2.// new line
3.// insert a line
សំគាល់:
-<p>...</p>:គឺជាtagសម្រាប់កំណត់អត្ថបទរបស់យើងជាកថាខណ្ខ។ 
-<br/>:
គឺជាTagប្រើសម្រាប់ចុះបន្ទាត់។ 
- <hr/> :
គឺជា Tag ប្រើសម្រាប់ទាញយកនូវបន្ទាត់មកបង្ហាញនៅលើ Page របស់យើង
. HTML Attribute
Tag របស់ HTML ភាគច្រើនតែងតែមាន Attribute ដើម្បីកំណត់លក្ខណៈបន្ថែមទៅលើ tags ទាំង នោះ។

ឧទាហរណ៍
01.<html>
02.<head><title>Paragraph</title></head>
03.<body>
04. 
05.Welcome to itkonkhmer.Thanks for visiting and support us.
06.This is example how to use tag and attribute.
07. 
08.</body>
09.</html>
សំគាល់:
Align :ជា Attribute ប្រើសម្រាប់កំណត់ទំរង់របស់អត្ថបទរបស់យើង ដែលវាមានដូចជា Justify , Center,Leftនិង Right

. Headings

Heading គេប្រើសម្រាប់កំណត់ម៉ូតអក្សរដែលមាន៦ប្រភេទ គឺពី <h1> ដល់ <h6> (ពីធំទៅតូច) ហើយ ជាទូទៅគេប្រើសម្រាប់កំណត់ទៅលើចំនងជើង នៃអត្ថបទរបស់យើង។
1.<h1> heading h1 </h1>
2..
3..
4..
5..
6.</h6> heading h6 </h6>
ឧទាហរណ៍
01.<html>
02.<head><title>Welcome to itkonkhmer</title></head>
03.<body>
04.<h1> this is heading h1 </h1>
05.<h2> this is heading h2 </h2>
06.<h3> this is heading h3 </h3>
07.<h4> this is heading h4 </h4>
08.<h5> this is heading h5 </h5>
09.<h6> this is heading h6 </h6>
10.</body>
11.</html>
លទ្ធផល

this is heading h1

this is heading h2

this is heading h3

this is heading h4

this is heading h5
this is heading h6
-<b>….</b>:សម្រាប់កំណត់អក្សរដិត 
-<i>…..</i>:
សម្រាប់កំណត់អក្សរទ្រេត 
-<u>….</u>:
សម្រាប់ដាក់បន្ទាត់ពីក្រោម 
-<small>…</small>:
សម្រាប់កំណត់អក្សរឲ្យមានទំហំតូច 
-<big>….</big>:
សម្រាប់កំណត់អក្សរឲ្យមានទំហំធំ 
-<sup>…</sup>:
សម្រាប់សរសេរជាស្វ័យគុណ 
- <sub>….</sub> :
សម្រាប់សរសេរជាសន្ទស្សន៍
ឧទាហរណ៍
01.<html>
02.<head><title>Text Style</title></head>
03.<body>
04.<b> Bold </b>
05. 
06.<i> Italic </i>
07. 
08.<u> Underline </u>
09. 
10.<small> Small </small>
11. 
12.<big> Big </big>
13. 
14.A <sup><small> 2 </small><sup> -B <sup><small> 2 </small></sup>
15.=(A-B)(A+B)
16. 
17.H <sub><small> 2 </small></sup> 0
18.</body>
19.</html>
លទ្ធផល
Bold
Italic
Underline
Small
Big

A
2-B2=(A-B)(A+B) 
H
2O
សំគាល់ៈ 
tag <br/>
គឺជា tag ប្រើសម្រាប់ចុះបន្ទាត់។វាជា tag ដែលមានតែបើកមិនមានបិទទេ។ គេអាច សរសេរ វាបានពីររបៀបគឺ <br> <br/>
. ការកំណត់ពុម្ពអក្សរ
ដើម្បីកំណត់ពុម្ពអក្សរយើងប្រើ tag <font> ហើយនៅក្នុង tag <font> មាន attribute មួយចំនួន ដូចខាងក្រោម :
-Face:សំរាប់ដាក់ឈ្មោះពុម្ពអក្សរ 
-Size:
សំរាប់កំណត់ទំហំរបស់អក្សរ 
- Color:
សម្រាប់កំនត់ពណ៌របស់អក្សរ
ឧទាហរណ៍

លទ្ធផល
This is the first time for me to learning HTML. This is example how to use tag font.
Link គឺជាការដាក់តំណភ្ជាប់ទៅកាន់ទំព័រណាផ្សេងទៀត ហើយយើងអាចដាក់ Link ទៅលើ អក្សរ ឬ លើរូបភាពក៏បាន។

No comments:

Post a Comment