ផ្នែកទី១
i
2 Votes

I- ទំរង់របស់ HTML
១- សេចក្តីផ្តើម
HTML មកពីពាក្យ Hypertext Markup Language ។ HTML
គឺជាភាសាដំបូងសម្រាប់សរសេរគេហទំព័រ ។ ក្នុង HTML វាប្រើ Tag
សម្រាប់ការកំណត់នានា ។
នៅពេលដែលយើងចង់យក Tag ណាមួយមកប្រើ យើងគ្រាន់តែ បើកTag <..>
រួចនៅពេលបញ្ចប់យើងត្រូវបិទ Tag វិញ (</..>) ។
ឧទាហរណ៍:
<p>Welcome to itkunkhmer blog And welcome to HTML. Why you want
to study HTML? Maybe you want to create own website? It’s right?
</p>
២- ទំរង់របស់ HTML
HTML គឺតែងតែមានទំរង់ដូចខាងក្រោមជានិច្ច ដែលមិនអាចខ្វះមួយណាបាន ។
<hmtl>
<head> <title>Name of Page </title>
</head>
<body>
Welcome to study HTML language.
</body>
</html>

សំគាល់ៈ
<html> tag គឺយើងត្រូវបើកនៅពេលដែលចាប់ផ្តើមដំបូង និង នៅពេលបញ្ចប់ ។
<body> tag គឺសម្រាប់ឲ្យយើងសរសេរដងខ្លួនរបស់គេហទំព័ររបស់យើង ។
———————————————–
៣- Meta Tag
<meta> tag គឺជា tag សម្រាប់ពណ៌នាពត៌មាន ឬ ចំនុចសំខាន់ៗ(Key
words) នៅក្នុងគេហទំព័ររបស់យើង ។ ហើយវាជា tag ដែល Search engine
ទាញយកនូវពត៌មាន ចំនុចសំខាន់ៗ ទៅបង្ហាញដល់អ្នកទស្សនាដែល ស្វែងរក ។
ឧទាហរណ៍
<html>
<head><title>itkunkhmer</title></head>
<meta name=”keywords” content=”programming, html, khmer,
Itkunkhmer”>
<meta name=”description” content=”prepared by student of RUPP,
information technology for kunkhmer”>
</head>
<body>
</body>
</html>
សំគាល់៖ នៅពេលដែលយើងស្វែងរក នៅក្នុង Search Engine ដូចជា Google
ហើយនៅពេលដែលយើងវាយ ដូចពាក្យណាមួយដែលនៅក្នុង meta មានឈ្មោះ keywords ដែលមាន
programming, html, khmer,itkunkhmer ពេលនោះ Google
វានឹងបង្ហាញគេហទំព័ររបស់យើងបង្ហាញដល់អ្នកទស្សនាដែលបានស្វែងរក ។
———————————————–
៤- ការគ្រប់គ្រងលើ Background
យើងអាចដាក់ផ្ទៃខាងក្រោយ(Background) និង អក្សរ
របស់យើងជាពណ៌ផ្សេងៗតាមតម្រូវ និង អាចដាក់ជារូបភាពបានទៀត ផង ។
ដើម្បីដាក់ពណ៌ផ្ទៃខាងក្រោយ គឺយើងប្រើ bgcolor attribute នៅក្នុង
<body> tag ។ ហើយបើយើងចង់កំណត់ពណ៌ នៃអក្សរយើងប្រើ text attribute ។
ចំណែកការដាក់ផ្ទៃខាងក្រោយជារូបភាពយើងប្រើ background attribute ។
ទំរង់របស់ background attribute គឺៈ background=”ដាក់ទីតាំង និង ឈ្មោះ
របស់រូបភាពរបស់យើង”
ឧទាហរណ៍ៈ ការដាក់ផ្ទៃខាងក្រោយជាពណ៌
<html>
<head><title>Background and Text
color</title></head>
<body bgcolor=”#000000” text=” white”>
Now we has black background and white text.
</body>
</html>
ចំណាំ៖ ដើម្បីដាក់ពណ៌យើងអាចដាក់ ជាឈ្មោះរបស់ពណ៌ជាអក្សរ ក៏បាន
ជាលេខកូដរបស់ពណ៌ក៏បាន ។
ឧទាហរណ៍ៈ ការដាក់ផ្ទៃខាងក្រោយជារូបភាព
<html>
<head><title>Background Image</title></head>
<body background=” image/itkunkhmer.jpg” text=” white” >
<center><b>Now we has image
background</b></center>
</body>
</html>
———————————
II- ម៉ូតរបស់អក្សរ
៥- Headings : សម្រាប់កំណត់ម៉ូតអក្សរដិតដែលមាន ៦ប្រភេទពីធំទៅតូច
។
Tag របស់ Heading ទាំង៦គឺ៖
<h1>……</h1> ធំជាងគេ
<h2>……</h2>
<h3>……</h3>
<h4>……</h4>
<h5>……</h5>
<h6>……</h6> តូចជាងគេ
ឧទាហរណ៍
<html>
<head><title>Heading</title></head>
<body>
<h1 align=”center”>This is a Heading 1</h1>
<h2>This is a Heading 2</h2>
<h3>This is a Heading 3</h3>
<h4>This is a Heading 4</h4>
<h5>This is a Heading 5</h5>
<h6>This is a Heading 6</h6>
</body>
</html>

—————————————
៦- ទំរង់អក្សរជាកថាខណ្ឌ ( Paragraphs )
Tag <p> ប្រើសំរាប់សរសេរជាកថាខណ្ឌ (Paragraph) ។
ឧទាហរណ៍:
<html>
<head><title>Paragraph tag</title></head>
<body>
<p align=”left”> <b>This is paragraph</b>
<br>
Welcome to itkunkhmer blog And welcome to HTML. Why you want to study
HTML? Maybe you want to create own website? It’s right? </p>
This is not paragraph.
</body>
</html>

សំគាល់ៈ align គឺជា Attribute សម្រាប់កំណត់ទីតាំងដែលអាចកំណត់ជា ៖
center , right , left ។
————————————
៧- ការកំណត់ពុម្ពអក្សរ ( font )
ដើម្បីកំណត់ពុម្ពអក្សរយើងប្រើ <font> tag ហើយនៅក្នុង <font>
tag មាន attribute របស់វាដូចជា :
Face: សំរាប់ដាក់ឈ្មោះពុម្ពអក្សរ
Size: សំរាប់កំណត់ទំហំរបស់អក្សរ
Color: សំរាប់កំណត់ពណ៌អក្សរ
ឧទហរណ៍៖
<html>
<head><title>Font Tag</title></head>
<body>
<p><font face=” Time New Roman” size=” 5″ color=” black”
>Welcome to itkunkhmer blog And welcome to HTML. Why you want to
study HTML? Maybe you want to create own website? It’s
right?</font></p>
<p><font face=” Kh freehand” size=” 5″ color=”
#000000″>យើងអាចសរសេរជាអក្សរខ្មែរបានទៀតផង ។ ប៉ុន្តែពេលយើង Save វា
យើងត្រូវកំណត់ Encoding របស់វាជា unicode ។</font></p>
</body>
</html>

————————————
៨- ម៉ូតផ្សេងៗរបស់អក្សរ
- <b>….</b> : សម្រាប់កំណត់អក្សរដិត
- <i>…..</i> : សម្រាប់កំណត់អក្សរទ្រេត
- <u>….</u> : សម្រាប់ដាក់បន្ទាត់ពីក្រោម
- <small>…</small> : សម្រាប់កំណត់អក្សរឲ្យមានទំហំតូច
- <big>….</big> : សម្រាប់កំណត់អក្សរឲ្យមានទំហំធំ
- <sup>…</sup> : សម្រាប់សរសេរជាស្វ័យគុណ
- <sub>….</sub> : សម្រាប់សរសេរជាសន្ទស្សន៍
ឧទាហរណ៍
<html>
<head><title>Text Style</title></head>
<body>
<b>Bold</b> <br>
<i>Italic</i> <br>
<u>Underline</u> <br>
<small>Small</small> <br>
<big>Big</big> <br><br>
A<sup><small>2</small></sup>-B<sup><small>2</small></sup>=(A-B)(A+B)
<br>
H<sub><small>2</small></sub>O
</body>
</html>

សំគាល់ៈ <br> tag គឺជា tag ប្រើសម្រាប់ចុះបន្ទាត់ ។ វាជា tag
ដែលមានតែបើក មិនមានបិទទេ ។ គេអាចសរសេរវា បានពីររបៀបគឺ <br> ឬ
<br/> ។
———————–
៩- ការប្រើប្រាស់ Preformatted
នេះគឺជាវិធីសម្រាប់បង្ហាញទំរង់ដើមនូវអ្វីដែលយើងបានសរសេរនៅក្នុង code
html ។
Tag របស់វាគឺ <pre>…..</pre> ។
បានជាច្រើនប្រើ tag នេះព្រោះ html វាមិនស្គាល់ដកឃ្លាទេ
អញ្ចឹងដើម្បីបានទំរង់ដើមដែលយើងចង់យើងត្រូវតែប្រើ <pre> tag ។
ឧទាហរណ៍
<html>
<head><title>Preformatted Text</title></head>
<body>
<pre>
****** ** ** ** **
****** * * * * ** **
** * * * ** **
** * * ** **
** * * ** **
** * * ** **
****** * * ********
****** * ******
</pre>
</body>
</html>
១០- ការប្រើប្រាស់ Blockquote ៖
<blockquote>…..</blockquote>
Blockquote គឺសម្រាប់កំណត់អត្ថបទរបស់យើងឲ្យមានលក្ខណៈជាអត្ថបទដកស្រង់ ។
ជាទូទៅបើយើងដាក់អត្ថបទ របស់យើង នៅក្នុង blockquote
នោះអត្ថបទរបស់យើងនឹងចូលបន្ទាត់ ។
បើយើងដាក់ blockquote ពីរដង នោះអត្ថបទរបស់យើងនឹងចូលបន្ទាត់ថែមទៀត ។
ឧទាហរណ៍
<html>
<head><title>Blockquoye</title></head>
<body>
<blockquote><b>This is the text that set a
blockquote</b><br>
HTML is a first language to create website. There are a lot of
language to create website suck as CSS , Java Script , PHT , ASP.Net …. ។
When we finish HTML we continue to study CSS ..and other.
</blockquot>
<blockquote><blockquote><b>This is the text that
set two blockquot</b><br>
HTML is a first language to create website. There are a lot of
language to create website suck as CSS , Java Script , PHT , ASP.Net …. ។
When we finish HTML we continue to study CSS ..and other.
</blockquote></blockquote>
</body>
</html>