3 css

Page 1

αž…αžΆαž”αŸ‹αž•αŸ’αžαžΎαž˜

CSS

Web Development ិ αžŸαžΆαžŸαŸ’αžšαžŸαž αž’αŸ’αž“αž€αž“αžΉαž„αžŸαž·αž€αžΆαž–αžΈαž˜αŸαž˜ αŸ€αž“αžαŸ†αž”αžΌαž„ αžœαž’ αžαŸ’αžΈαŸ— ម ី

ិ αžŸαžΆαžŸαŸ’αžšαžŸαž αž“αž·αž„αžœαž’ αž˜αŸ’αžšαžΎαž‡αžΆαž‰αžΉαž€αž‰αžΆαž”αŸ‹αž€αž»αž„αž€αžΆ αž“ αž”αž˜αž„αž€αžαž˜αžœαž”αžŸαžΆαž™ ើ ី

αž• αŸ€αž”αž• αŸ€αž„αž•αŸ„αž™αŸˆ αž€αž»αž™ αž‘αž·αžαŸ’αž™αžαžΆαžšαžΆ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αž•αŸ’αž„αŸ€αž“αž•αŸ… αž˜αž‡αŸ’αžˆαž˜αžŽαŸ’αžŒαž› ITEC αž“αž·αž„αž…αŸ‚αž€αž…αžΆαž™αžαžΆαž˜ Bayon Hosting


Module 1: Introduction to Cascading Style Sheets αž€αžΆαžšαž”αž„αŸ’αž€αžΎαž CSS

Internal CSS αž‡αžΆαž€αžΆαžšαžŸαžšαž„αžŸαžšαž“αžΌ វ αž€αžΌ ដ CSS αž€αž“αž»αŸ’ File αž‡αžΆαž˜αž½ αž™αž‚αŸ’αž“αž“αž“αžΉαŸ’ HTMLαŸ” αž„αž‚αž˜αžΆαž“αžœ αž·αž’αžΈ αž–αžΈαžšαž™αŸ‰αžΆ αŸ’αŸ–

αž€αžΆαžšαž„αžšαž”αžΎαžαžΆαž˜ style tag Syntax: <style type=”text/css”> Css_statements; </style>

αž€αžΆαžšαž„αžšαž”αžΎαž“αžΌαžœ style attribute αž€αž“αŸ’ ុ tag Syntax: <tag_name style=”css_statements”></tag>

External CSS αž‡αžΆαž€αžΆαžšαžŸαžšαž„αžŸαžšαž“αžΌ វ αž€αžΌ ដ CSS αž€αž“αž»αŸ’ File មួ αž™αž„αŸ„αž™αž‘αŸ‚αž€αž–αžΈ HTML FileαŸ” αž„αž‚αž˜αžΆαž“αžœ αž·αž’αžΈαž€αž»αŸ’αž€αžΆαžš αž“

αžαž—αŸ’αž‡αžΆαž”αŸ‹ αž„αŸ…αž€αžΆαž“αŸ‹ CSS File αž–αžΈαžšαž™αŸ‰αžΆ αŸ’αŸ–

αž€αžΆαžšαž„αžšαž”αžΎαž“αžΌαžœ link tag Syntax <link rel=”stylesheets” type=”text/css” href=”css_file_path”/>

αž€αžΆαžšαž„αžšαž”αžΎαž“αžΌαžœ @import αž€αž“αŸ’ ុ style tag Syntax <style type=”text/css”> @import url(css_path); </style>


Module 2: CSS Basic αž›αž€αžαžŽαŸˆαž‘αžΌαž„αŸ…αž“αž“ CSS

Comments αž‡αžΆ statements αžŠαŸ‚αž›αž”αŸ’αžšαžΎ αžŸαŸ†αžšαžΆαžšαŸ‹αž–αž·αž–αžŽαŸαž“αžΆαžšαžŠαžαŸ‚αž˜αž”αŸ…αž€αžΆαžαŸ‹ αž€αžΌ αŸ‚αžŠαŸ‚αž›αž” αž€αžΆαžšαžš αŸ†αž›αžΉαž€αžŸαŸ†αžšαžΆαžšαŸ‹αžαŸ’αž„αŸƒαž”αŸ’αž€αžΆ αž”αžΆαžαžšαž€αžŠαŸ’αžšαž”αŸ„

αž•αž„ αžαž·αž„αž„αžΆ

Interpreter αž”αž‘αŸ”

αžΎαž„αž”αžΆαžαžŸαžšαž”αžŸαžš αžŸαŸ†αžšαžΆαžšαŸ‹ αž‡αžΆ

αžŸαŸ’αžŸαž½αž›αž€αž“αž»αž„αž€αžΆαžšαžŠαžŸαŸ‚αž„αžšαž€αž‘αžΈ αžαŸ†αž„αžαŸ’αžαž€αžΌ αŸ‚αž•αž„αŸ” Comments មិ αžαŸ’αžšαžΌαžœ

Syntax /* This is my first css_statement That wrote to create stylesheets For my web page*/

វ αž·αž’αžΈαž€αž»αŸ’αž€αžΆαžšαž€αŸ† αž“ αž“αžαŸ‹ Style

αž€αŸ†αž“αžαŸ‹αžαžΆαž˜αž„αŸ’αž˜αŸ„αŸ‡αžšαž”αžŸαŸ‹ tag αž‡αžΆαž€αžΆαžšαž€αŸ† αž“αžαŸ‹ αž„αŸ„αž™αž™αž€αž„αŸ’αž˜αŸ„αŸ‡αžšαž”αžŸαŸ‹ tagαŸ” αž€αžΆαžšαž„αž’αžœαžΎαž‘αž”αž”αž„αž“αŸ„αŸ‡αžšαž‚αž”αŸ‹ element αž‘αžŠαž›αž„αžšαž”αžΎ tag αž‘αžŠαž› αž”αžΆαž“αž€αŸ†αž“αžαŸ‹αž„

αŸ„αŸ‡ αžœαžΆαž“αžΉαŸ’αž‘αž‘αž½αž›αžαŸ† αž“αž›αžŠαžΌαž…αŸ—αž‚αŸ’αž“αž“αŸ”

αž„αžŠαžΎαž˜αž”αžΈαž€αŸ†αž“αžαŸ‹ αžαžΆαž˜αž„αŸ’αž˜αŸ„αŸ‡αžšαž”αžŸαŸ‹αž„αž™αžΎαŸ’αžšαž‚αŸ’αž“αž“αŸ‹ αž‘αžαŸ„αž€αŸ‹ αž„αŸ’αž˜αŸ„αŸ‡αžšαž”αžŸαŸ‹ tag αž„

αžΎαž™αž”αž“αžαž„αŸ„αž™ {}

Syntax: Tag_Name{ Css_statement }

αž§αž‘αžΆ

αžšαžŽαŸαŸ–

αž„αž™αžΎαŸ’αž“αžΉαŸ’αž€αŸ† αž“αžαŸ‹αž–αžŽαŸαžšαž”αžŸαŸ‹αžšαž‚αž”αŸ‹ element αž‘αžŠαž›αž„αžšαž”αžΎ <h1> tagαž„αŸ…αž‡αžΆαž–αžŽαŸαžšαž€ αž˜αž€αž„αŸ…αž€αžŽαŸ’αž ត αž›αŸ” <style type=”text/css”> H1{ color:red; text-align:center; } </style> . . . <H1>Welcome</H1> <H2>Heading 2</H2> <H1>To My Site</H1>

ម αž“αž· αŸ’αžαžšαž˜αžΉ មវអ


αž€αŸ†αž“αžαŸ‹αžαžΆαž˜ Class αž‡αžΆαž€αžΆαžšαž€αŸ† αž“αžαŸ‹ αž„αŸ„αž™αž”αž„αŸ’αž€αžΎαžαž‡αžΆ class (αžšαž€αž»αž˜) αž“αž“ style មួ αž™αŸ” αž„αžŠαžΎαž˜αž”αžΈαž„αŸ„αž™ element αž‘αž‘αž½ αž› style αž‘αžŠαž›αž€αŸ†αž“αžαŸ‹ αž„αŸ„αž™ class αž˜αž½αž™ αž€αž“αž»αŸ’ open tag αž“αž“ element αžšαžαžΌαžœαž„αžšαž”αžΎ attribute មួ αž™αž„αŸ’αž˜αŸ„αŸ‡αžαžΆ class αž“αž· αŸ’αž€αŸ† αž“αžαŸ‹ value αžšαž”αžŸαŸ‹αžœαžΆαž„αŸ…αžαžΆαž˜ class αž‘αžŠαž›αž„αž™αžΎαŸ’αžšαžαžΌαžœαž€αžΆαžšαŸ”

αž„αžŠαžΎαž˜αž”αžΈαž”αž„αŸ’αž€αžΎαž class αž„αž™αžΎαŸ’αž„αžšαž”αžΎ αžŸαž‰αŸ’αž‰αžΆ (.) αž”αž“αžαž„αŸ„αž™αž„αŸ’αž˜αŸ„αŸ‡ class αž“αž· αŸ’ {} Syntax: .class_Name{ Css_statement }

αž§αž‘αžΆ

αžšαžŽαŸαŸ–

αž„αž™αžΎαŸ’αž“αžΉαŸ’ class αž…αŸ† αž“αž½αž“αž–αžΈ រ αž‘αžΈαŸ‘ αž„αžšαž”αžΎ Font Khmer OS αž‘αŸ† Roman αž‘αŸ†

αŸ† 20px αž‘αžΈ ្ αž„αžšαž”αžΎ Font Time New

αŸ† 14pxαŸ”

<head> <meta http-equiv="Content-Type" content="text/html; charset=UTF8" /> <style type=”text/css”> .khmer{ font-family:Khmer OS; font-size:20px; } .english{ font-family:Time New Roman; font-size:14px; } </style> </head> <body> <h1 class=”khmer”>សួសីត</h1> <span class=”khmer”>αžŸαžΌαž˜αžŸαŸ’αžœαžœαž‚αž˜αž“αŸαž˜αž€αž€αžΆαž“αŸ‹ </span> <span class=”english”> Web Page</span> <span class=”khmer”>αžšαž”αžŸαŸ‹αž„αž™αžΎαŸ’αžαŸ’αŸ†αž» </span> </body>

αž…αŸ† αžŽαŸ’αžαŸ†αž„αžŠαžΎαž˜αž”αžΈαž„αŸ„αž™ Browser αŸ„αž…αž”αž„αŸ’αž αžΆαž‰αž‡αžΆαž’αž€αžŸαžšαž‘αžŠαž›αž„αžšαž”αžΎ Unicode αž”αžΆαž“αžšαžαžΌαžœαž€αŸ†αž“αžαŸ‹ αž“αžΌ វ attribute content αžšαž”αžŸαŸ‹ meta tag αž“αžΌ αžœαžαŸ† αž“αž›αžαžΆ <meta http-equiv="Content-Type" content="text/html; charset=UTF8" />

αž€αžΆαžšαž€αŸ†αž“αžαŸ‹αžαžΆαž˜ id αž‡αžΆαž€αžΆαžšαž€αŸ† αž“αžαŸ‹ αž„αŸ„αž™ element αžŽαŸ’αžαž˜αž½ αž™αž‘αžαž˜αžαŸ’ αž„αŸ„αž™αž™αž€ id αžšαž”αžŸαŸ‹ element αž„ αž„αž‚αž„αžšαž”αžΎ αžŸαž‰αŸ’αž‰αžΆ # αž”αž“αžαž„αŸ„αž™ id αž“αž· αŸ’ {} Syntax #element_id{

αŸ„αŸ‡αž˜αž€αž„αžšαž”αžΎαž‘αžαž˜αžαŸ’αŸ”


Css_statements }

αž§αž‘αžΆ

αžšαžŽαŸαŸ– αž„αž™αžΎαŸ’αž“αžΉαŸ’αž”αž„αŸ’αž€αžΎαžαž“αžΌ αžœαž•αŸ’αž‘αŸ†αŸ’αž’αžαžαž”αž‘αžŸαŸ†αžšαžΆαž”αŸ‹ αŸ„αž€αŸ‹αž’αž€αžŸαžšαž‘αžαž˜αžš αž˜αžΆαž“αž“αž•αž‘αžαžΆαŸ’αž„αžšαž€αžΆαž™αž–αžŽαŸ αž„αžšαž”αž„αž•αŸ„αŸ‡

αž‘αŸ†

αŸ†αŸ‘αŸ€αŸ”

<head> <meta http-equiv="Content-Type" content="charset=UTF-8"/> <style type="text/css"> #khmer_content{ Background:#CCCCCC; Font-family:Khmer OS System; Font-size:14px; } </style> </head> <body> <div id="khmer_content"> Comments αž‡αžΆ statements αž‘αžŠαž›αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž–αž·αž–αžŽαŸ αž”αž‘αž“αžαž˜αž„αŸ…αž€αžΆαž“αŸ‹ αž€αžΌαžŠαž‘αžŠαž›αž„αž™αžΎαŸ’αž”αžΆαž“αžŸαžšαž„αžŸαžš αžŸαŸ†αžšαžΆαž”αŸ‹αž‡αžΆαž€αžΆαžšαžš αŸ†αž›αžΉαž€αžŸαŸ†αžšαžΆαž”αŸ‹αž“αžαŸƒαž„αžšαž€αžΆαž™αž•αŸ’ αž“αž·αŸ’αž„αŸ’αž αž™αžŸαŸ’αžŸαž½αž›αž€αž“αž»αŸ’αž€αžΆαžšαž‘αžŸαžœαŸ’αžšαž€αž‘αžΈαžαžΆαŸ†αŸ’αž“αž“αž€αžΌαžŠαž•αŸ’αŸ” Comments αž˜αž·αž“αžšαžαžΌαžœαž”αžΆαž“αž”αž€αž‘αžšαž”αž„αŸ„αž™ Interpreter αž„αž‘αŸ” </div> </body> αž…αŸ†αžŽαŸ’αžαŸ†αŸ– αž„αž™αžΎαŸ’αŸ„αž…αž€αŸ†αž“αžαŸ‹ αž”αžΆαž“αž„αžšαž…αžΎαž“ tag, class, id αž€αž“αž»αŸ’αž„αž–αž›αž‘αžαž˜αž½αž™αž”αžΆαž“αž€αžΆαžšαž„αžšαž”αžΎ (,)αŸ” ឧ.

H1,H2{…} .khmerTop,.khmerBottom{…} #box1,#box2{…}

αž›αž€αžαžŽαŸˆ Inheritance (αžαž‚αŸ’αž“αž“) Inheritance αžšαžœαžΆαŸ’ tag αž“αž·αŸ’ tag Syntax

αž„αž‚αž„αžšαž”αžΎαžœαžΆαžŸαŸ†αžšαžΆαž”αŸ‹ tag មួ αž™αž‘αžŠαž›αž„αŸ…αž€αž“αž»αŸ’ tag មួ αž™αž„αž‘αŸ€αžαŸ” tag1Name ag2Name{ css_statement }

. . . <tag1> <tag2> </tag2> </tag1> αž§αž‘αžΆ

αžšαžŽαŸαŸ–


<style> div p{ font-size:16px; color:blue; } span p{ font-size:18px; color:red; } p{ font-size:20px; color:Green; } </style> </head> <body> <div> <p>Welcome <span><p>Welcome <p>Welcome </p> </body>

</p></div> </p></span>

αž›αž‘αž’αž•αž›αŸ–

Welcome

Welcome

Welcome Inheritance αž“αž“ id αž“αž·αŸ’ tag αž„αž‚αž„αžšαž”αžΎαžœαžΆαž„αž–αž›αžŽαŸ’αžαž‘αžŠαž›αž˜αžΆαž“ αž”αž›αž»αž€αž–αžΈ αžšαž„αž•αžŸαŸ’αž‚αŸ’αž“αž“ αž”αŸ‰αžΆαž» αž‘αž“αž αž„αžšαž”αžΎαž„αŸ„αž™ tag ទតមួ αž™αž„

αžΎαž™αžšαž‚αž”αŸ‹αž’αžΆαžαž»αžαžΆαŸ’

αž€αž“αž»αŸ’αžŠαžΌ αž…αž‚αŸ’αž“αž“αž‘αžΆαŸ†αŸ’αž’αžŸαŸ‹αŸ” αž§αž”αž˜αžΆαž’αž“αž€αž…αŸ’αŸ‹αž„αž’αžœαžΎαž€αŸ†αž“αžαŸ‹ style αž“αž“αž’αžΆαžαž»αž€αž»αŸ’αžšαž”αž’αž”αŸ‹ αž“ αž„ αŸ„αŸ‡αž„αž•αžŸαŸ’αž‚αŸ’αž“αž“ αž„ αŸ„αŸ‡αž’αž“αž€αžšαžαžΌαžœαž€αŸ†αž“αžαŸ‹ id αžšαž”αžŸαŸ‹ element αŸ„αž€αŸ‹αž•αž»αž€αž”αž› αž‘ αž»αž€αž‘αžΆαŸ†αŸ’αž–αžΈ αžšαž„αž•αžŸαŸ’αž‚αŸ’αž“αž“ αž„ αžΎαž™αž’αž“αž€αŸ„αž…αž„αžšαž”αžΎ αž›αž€αžαžŽαŸˆ inheritance αžŸαŸ†αžšαžΆαž”αŸ‹αž€αŸ†αž“αžαŸ‹ style αž“αž“ tagαž“αžΈ αž˜αž½αž™αŸ— αž€αž“αž»αŸ’αž”αž›αž»αž€αž‘αžΆαŸ†αŸ’αž–αžΈαžšαž„αž•αžŸαŸ’αž‚αŸ’αž“αž“αž”αžΆαž“αŸ” Syntax: #element_id tagName{ Css_statement; } . . . <tagName id=”element_id”> <tagName> </tagName> </tagName> αž§αž‘αžΆ αžšαžŽαŸαŸ– <style> #borderBox p{ border:solid 1px; color:blue; } #greyBox p{


background:#CCCCCC; } </style> </head> <body> <div id="greyBox"><p>Welcome</p></div> <div id="borderBox"><p>Welcome</p></div> </body> αž›αž‘αž’αž•αž›αŸ–

Welcome Welcome

αž›αž€αžαžŽαŸˆ Inheritance αž“αž“ class αž“αž·αŸ’ tag .className tagName αž˜αžΆαž“αž›αž€αžαžŽαŸˆαžŠαžΌαž…αž“αžΉαŸ’ Inheritance αž“αž“ id αž“αž·αŸ’ tag αž‘αžŠαžšαŸ” style αžœαžΆαž“αžΉ αŸ’αž€αŸ†αž“αžαŸ‹ αž„αŸ„αž™ tag αžŽαŸ’αžαž‘αžŠαž› αž‹αž· αžαž€αž“αž»αŸ’ element αž‘αžŠαž›αž˜αžΆαž“ class αž‘αžŠαž›αž”αžΆαž“αž”αž‰αŸ’αž‰ អ αž€αŸ‹αž”αŸ‰αžΆαž»αž„αžŽαŸ’αžαžŽαŸ„αŸ‡αŸ” Syntax: .className tagName{ Css_statements } . . .

<tag1 class=”className”> <tagName> </tagName> </tag1>

tagName.className Syntax:

αž„αž‚αž„αžšαž”αžΎαžœαžΆαž„αž–αž›αž„αž™αžΎαŸ’αž…αŸ’αŸ‹ αž”αž„αŸ’αž€αžΎαž class មួ αž™αžŸαŸ†αžšαžΆαž”αŸ‹αž„αžšαž”αžΎ αž‘αžαž€αž“αž»αŸ’ tag αžŽαŸ’αžαž˜αž½ αž™αž”αŸ‰αžΆαž»αž„αžŽαŸ’αžαžŽαŸ„αŸ‡αŸ” tagName.className{ css_statement }

αž§αž‘αžΆ αžšαžŽαŸαŸ– <style> div.redText{ color:red; font-size:20px; } span.redText{ color:red; font-size:12px; } </style> </head>


<body> <div class="redText">Welcome</div> <span class="redText">Welcome</span> </body> αž›αž‘αž’αž•αž›αŸ–

Welcome Welcome

Formatting Universal Resource Location Syntax: url(http://www.example.com/style/banner.css); αž§αž‘αžΆ

αžšαžŽαŸαŸ– @import url(http://www.style.com/style/box.css); Body{ Background:url(http://www.gallery.com/images/2435.jpg); }

រឺ Body{ Background:url(../images/my Image.jpg); }

Color RGB Format Syntax: rgb(red,green,blue)

red, blue, green αž˜αžΆαž“αžαŸ† αž“αž›αž–αžΈ ០ αžŠαž›αŸ‹ ្αŸ₯αŸ₯

Hexa Format Syntax: #rrggbb

rr,gg,bb αž˜αžΆαž“αžαŸ† αž“αž›αž–αžΈ 00-FF

Name Format Syntax: colorName

ដូ αž…αž‡αžΆ blue, red, black, white, gray, green, purple, pink…

Link Behavior a:link មិ αž“αž’αžΆαž›αž”αŸ‹ αž…αž»αž…


a:visited αž…αž» αž…αž˜αžαŸ’αž„

αžΎαž™

a:active window αž‘αžŠαž›αž”αžΆαž“ link αž„αŸ…αž€αŸ† αž–αž»αŸ’αž„αž”αžΎ αž€

a:hover

αž„αž–αž›αž™αž€ mouse រ αŸ†αž€αž· αž›αž„αž›αžΎαŸ‹

Syntax a:link{ color:green; textdecoration=none; } a:visited{ color:red; textdecoration=none; } a:active{ color:blue; textdecoration=none; } a:hover{ color:black; textdecoration=overline; } αž„αž™αžΎαŸ’αŸ„αž…αž„αžšαž”αžΎ αž›αž€αžαžŽαŸˆ Descending αž”αžΆαž“αž§αž‘αžΆ a.footer:link{color:blue} a.header:link{color:red} #leftBlock a:link{color:green}

αžšαžŽαŸαŸ–


Applied CSS Formatting Text font-family: font-family: Arial, Helvetica, sans-serif;

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαž–αž» ត αž˜αž–αž’αž€αžŸαžšαŸ” αž„αž‚αŸ„αž…αŸ„αž€αŸ‹ αž–αž»αž˜αž’ αž– αž€αžŸαžšαž”αžΆαž“αž„αžšαž…αžΎ αž“αž€αžΆαžšαž–αžΆαžšαž€αžšαžŽαžΈαž‘αžŠαž› αž˜αžΆαŸ‰αžΆ αžŸαž»αžΈαž“αž’αž“αž€αž„αžšαž”αžΎαž˜αž·αž“αž˜αžΆαž“αž–αž»αž˜αž’ αž– αž€αžŸαžšαž„

αŸ„αŸ‡αŸ” αž…αŸ† αž„αž–αžΆαŸ„αŸ‡αž–αž»αž˜αž’ αž– αž€αžŸαžšαžŽαŸ’αžαž‘αžŠαž›αž˜αžΆαž“αžŠαž€αžƒαŸ’αž›αž›αžšαžαžΌαžœαž‘αžαŸ„αž€αŸ‹ αž€αž»αŸ’ αž“ β€œ β€œαŸ”

αžšαž€αž»αž˜αž’αž€αžŸαžšαž‘αžŠαž›αž˜αžΆαž“αžšαžΌαž”αžšαžΆαŸ’αžŸαŸ’αžŸαž„αžŠαŸ€αŸ’αž‚αŸ’αž“αž“αž˜αžΆαž“αžŠαžΌαž…αž‡αžΆαŸ– ο‚· ο‚· ο‚· ο‚· ο‚· ο‚· ο‚· ο‚· ο‚· ο‚·

Arial, Helvetica, sans-serif "Times New Roman", Times, serif "Courier New", Courier, monospace Georgia, "Times New Roman", Times, serif Verdana, Arial, Helvetica, sans-serif Geneva, Arial, Helvetica, sans-serif Tahoma, "Lucida Grande", Arial, sans-serif "Lucida Console", Monaco, monospace "Marker Felt", "Comic Sans MS", fantasy "Century Gothic", "Gill Sans", Arial, sans-serif

color: color:#F1F1F1; color:rgb(241,241,241); color:gray;

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαž–αžŽ ត ៌ αž’αž€αžŸαžšαŸ”

font-size: font-size:[16px|1em|100%|...];

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαž‘αŸ† ត

αŸ†αžšαž”αžŸαŸ‹αž’αž€αžŸαžšαŸ” αž‡αžΆαž’αž˜αž˜αžαžΆαž’αž€αžŸαžšαžšαžαžΌαžœαž”αžΆαž“αž€αŸ† αžŽαžαŸ‹ αž™αž€αž‘αŸ†

αŸ† 16px, 1em, 100%αŸ”

font-style: font-style: [italic|oblique|normal];

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαžšαžΆαŸ’αž’αž€αžŸαžšαž„αŸ„αž™αž˜αžΆαž“ ត αž›αž€αžαžŽαŸˆαž„αžšαž‘αžαž„αŸ…αž˜αž» αžαŸ” αž…αŸ† αž„αž–αžΆαŸ„αŸ‡ italic αž“αž·αŸ’ oblique αž˜αžΆαž“αž›αž€αžαžŽαŸˆαžŠαžΌαž… αž‚αŸ’αž“αž“αŸ” normal αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαžœαžΆαž˜αž€αž‘αŸ† ត αžšαŸ’αŸ‹αž„αžŠαžΎαž˜αžœ αž·αž‰

font-weight:


font-weight:[100-900|bold|bolder|lighter|normal]

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαž€αŸ† ត αžšαžΆαžŸαŸ‹αžšαž”αžŸαŸ‹αž’αž€αžŸαžšαŸ” ៑០០ αžŠαž›αŸ‹ ៩០០ αž‚αžΊ αž–αžΈαžšαž€αžΆαžŸαŸ‹αž”αŸ†αž•αž»αž αžŠαž›αŸ‹ αž„αžŸαžαžΎαŸ’αž”αŸ† αž•αž»αžαŸ” bold αž‚αžΊ αž€αžΆαžšαž€αŸ† αž“αžαŸ‹ αž™αž€αž’αž€αžŸαžšαžŠαž·αžαž’αž˜αž˜αžαžΆαŸ”

text-tranform: text-tranform:[capitalize|lowercase|uppercase|none];

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαž case αžšαž”αžŸαŸ‹αž’αž€αžŸαžšαŸ” none αžŸαŸ†αžšαžΆαž”αŸ‹αž€αŸ†αž“αžαŸ‹αž€αž»αŸ†αž„αŸ„αž™αž™αž€αž›αž€αžαžŽαŸˆ Inherit αž–αžΈ parent styleαŸ”

font-variant: font-variant:[small-caps|none];

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαžšαžΆαž›αŸ‹ ត αž’αž€αžŸαžš lowercase αž„αŸ„αž™αž„αŸ…αž‡αžΆ uppercase αž‘αžŠαž›αž˜αžΆαž“αž‘αŸ†

αŸ†αžαžΌαž…αž‡αžΆαŸ’ uppercase αž„αžŠαžΎαž˜αŸ”

αž§αž‘αžΆαžšαžŽαŸ HELLO W ORLD! αŸ”

text-decoration: text-decoration: [underline|overline|line-through|none]

αžŸαŸ†αžšαžΆαž”αŸ‹αž‚αžΌαžšαžŸαž” αž‘ αžαŸ‹αž–αžΈαž„αžšαž€αžΆαž˜ αž€αžŽαŸ’αž អ αž› αž“αž·αŸ’αž–αžΈαž„αž›αžΎαž’αž€αžŸαžšαŸ”

letter-spacing: letter-spacing:[-#px|#px|normal];

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαž‚αŸ† ត αž›αžΆαžαžšαž”αžŸαŸ‹αž’αž€αžŸαžšαŸ” αž„αž”αžΎ αž˜αžΆαž“αžŸαž‰αŸ’αž‰αžΆ αžŠαž€ αžœαžΆαž“αžΉαŸ’αž„αž’αžœαžΎαž„αŸ„αž™αž’αž€αžŸαžšαžšαž½αž˜αž…αžΌαž›αž‚αŸ’αž“αž“αŸ”

word-spacing: word-spacing:[-#px|#px|normal];

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαž‚αŸ† ត αž›αžΆαžαžšαž”αžŸαŸ‹αž–αžΆαž€αž™αž“αžΈαž˜αž½αž™αŸ—αŸ”

line-height: line-height:[30px|150%|1.5em|1.5];

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαž‚αŸ† ត αž›αžΆαžαž–αžΈαž” αž‘ αžαŸ‹ αž˜αž½αž™ αž„αŸ…αž” αž‘ αžαŸ‹ αž˜αž½αž™αž„αž‘αŸ€αžαŸ”

text-align: text-align:[left|center|right|justify|normal]

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αžαžšαž˜αžΉαž˜αž’αž€αžŸαžšαž˜αž€αž„αžœαžœαŸ’ αž€αžŽαŸ’αž អ αž› αžŸαŸ’αžœαžαŸ† រ αžΊαž‘αžΆαŸ†αŸ’αžŸαŸ’αžαžΆαŸ’αŸ”


text-indent: text-indent:[#px|#em];

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž…αžΌαž›αž” αž‘ αžαŸ‹αžšαžΆαž›αŸ‹αž” αž‘ αžαŸ‹αžαŸ†αž”αžΌαŸ’αž„αž‚ αž“αž“ tag αž‘αžŠαž›αžœαžΆαžŸαžαž·αžαž„αŸ…αžŠαžΌαž…αž‡αžΆ p tag αž‡αžΆαž„αžŠαžΎ αž˜αŸ”

tagName:first-letter p:first-letter{ declaration; }

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαž‘αžαž’αž€αžŸαžšαž‘αžŠαž›αž„αŸ…αžαŸ† ត αž”αžΌαŸ’αž„αž‚αž”αŸ’αž’αžŸαŸ‹αž“αž“ tag αž„

αŸ„αŸ‡αŸ”

tagName:first-line p:first-line{ declaration; }

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αžΌαžšαž‘αžαž” ត αž‘ αžαŸ‹αžαŸ†αž”αžΌαŸ’αž”αŸ‰αžΆαž»αž“αž„

αŸ„αŸ‡αž“αž“ tag αž„

αŸ„αŸ‡αŸ”

Styling List list-style-type: list-style-type:[..|none]];

αž„αžšαž”αžΎ αž‡αžΆαž˜αž½ αž™αž“αžΉαŸ’ <ul>,<ol>,<li> tag αž‘αžŠαž›αž„αž‚αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž”αž„αŸ’αž€αžΎαžαž‡αžΆ List αŸ” αž„αž™αžΎαŸ’αŸ„αž…αž€αŸ† αžŽαžαŸ‹αž“αžΌαžœ style αžšαž”αžŸαŸ‹ αžœαžΆαžŠαžΌαž…αžαžΆαŸ’αž„αžšαž€αžΆαž˜αŸ–


list-style-position: list-style-position:[inside|outside];

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž€αŸ†αž“αžαŸ‹ αžαžΆαž„αžαžΎ style αžšαž”αžŸαŸ‹ list αžšαžαžΌαžœαž‹αž·αžαž„αŸ…αžαžΆαŸ’αž„αžšαŸ… រ αžΊαž„αŸ…αžαžΆαŸ’αž€αž“αž»αŸ’ ដូ αž…αžαžΆαŸ’αž„αžšαž€αžΆαž˜αŸ–

Remove indent of list item padding-left:0px; margin-left:0px;

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹ αž›αž»αž”αžšαžΆαž›αŸ‹αž‚αŸ†αž›αžΆαžαžšαž”αžŸαŸ‹ list itemαŸ”

list-style-image: list-style-image:url(images/bullet.jpg);

αž”αŸ’αžšαžΎ αžŸαŸ†αžšαžΆαžšαŸ‹ αŸ„αž€αŸ‹αžαžΌαžœ αžšαžΌαžšαž—αžΆαž–αž‡αŸ† ថួស style αž…αžΆαžŸαŸ‹αŸ”

Margins, Padding, and Borders Understanding the Box Model Box αž˜αžΆαž“αž“αžΌαžœ properties αžŸαŸ†αžαžΆαž“αŸ‹ αŸ—αž˜αž½ αž™αž…αŸ†αž“αž½αž“αžŠαžΌαž…αž‡αžΆαŸ– ο‚·

Padding : αž‡αžΆαž‚αŸ† αž›αžΆαžšαžšαžœαžΆαž„ content ថិ αž„ border αžšαžšαžŸαŸ‹ contentαŸ”


ο‚·

Border: αž‚αžΊ αž‡αžΆαž” αž‘ αžαŸ‹ αž‘αžŠαž›αž‚αžΌ αžŸαž‡αž»αŸ† វ αž·αž‰αžšαž‡αž»αŸ’αžšαž”αžŸαŸ‹ boxαŸ” αž„αž™αžΎαŸ’αŸ„αž…αž€αŸ†αž“αžαŸ‹αžšαž‡αž»αŸ’αž‘αžΆαŸ†αŸ’αž”αž½ αž“ αž“αž·αŸ’αžšαž‡αž»αŸ’ αž“αžΈ αž˜αž½αž™αŸ—αž”αžΆαž“αŸ”

ο‚· ο‚·

Background-color: αž‚αžΊ αž“αž•αž‘αž‘αžŠαž›αž‹αž·αžαž€αž“αž»αŸ’ border αžšαž½αž˜αž‘αžΆαŸ†αŸ’ padding αž•αŸ’αž‘αžŠαžšαŸ”

Margin: αž‡αžΆαž‚αŸ† αž›αžΆαžαžšαžœαžΆαŸ’ tag មួ αž™αž„αŸ… tag មួ αž™αž„αž‘αŸ€αž ដូ αž…αž‚αŸ† αž›αžΆαžαžαžΆαŸ’αž„αž›αžΎ αž“αž· αŸ’αžαžΆαŸ’αž„αžšαž€αžΆαž˜ αžšαž”αžŸαŸ‹ p tagαŸ”


Define margin and padding All Edge margin:#px|#em|#%; padding: #px|#em|#%;

Specified Edge margin-left:#px|#em|#%; margin-right:#px|#em|#%; margin-top: #px|#em|#%; margin-bottom:#px|#em|#%; padding-left:#px|#em|#%; padding-right:#px|#em|#%; padding-top: #px|#em|#%; padding-bottom:#px|#em|#%;

Shorthand margin: top right bottom left; //TRouBLe padding: top right bottom left; αž§αž‘αžΆ

αžšαžŽαŸαŸ– margin: 0 10px 10px 20px; padding: 10px 0 10px 0;

Display with inline and block-level block αžšαžΆαž›αŸ‹ tag αžšαž”αžŸαŸ‹ HTML αž‚αžΊ αžŸαž»αž‘αž’αž‘αžαž˜αžΆαž“αž›αž€αžαžŽαŸˆαž‡αžΆ boxαŸ” αž”αŸ‰αžΆαž» αž‘αž“αž box αž˜αžΆαž“ 2 αžšαž”αž„αž—αž‘αž‚αžΊ inline αž“αž· αŸ’ block boxαŸ” block box αž”αž„αŸ’αž€αžΎαžαž“αžΌ αžœαž€αžΆαžšαž…αž» αŸ„αŸ‡αž” αž‘ αžαŸ‹αž–αžΈαž˜αž»αž“αžœαžΆ αž“αž· αŸ’ αž–αžΈ αž„αžšαž€αžΆαž™αžœαžΆ ដូ αž…αž‡αžΆ p, div, table, ul, ol, li β€¦αŸ” inline box មិ αž“αž”αž„αŸ’αž€αžΎαžαž“αžΌ αžœαž€αžΆαžšαž…αž» αŸ„αŸ‡αž” αž‘ αžαŸ‹ ធី αž‘αžΆ វ αŸ†αŸ’αž’αžŸαŸ‹ αž„

αžΎαž™αžœαžΆαž‹αž·αžαž„αŸ…αž‡αžΆαž˜αž½ αž™αž” αž‘ αžαŸ‹ ទតមួ αž™αž“αžΉ αŸ’ tag

αžŠαž“αž‘αž„αž‘αŸ€αžαŸ” inline box tag αž˜αžΆαž“αžŠαžΌαž…αž‡αžΆ <strong>, <em>, <a>, <img>αŸ” αž…αŸ† αž„αž–αžΆαŸ„αŸ‡ tag αžšαž”αž„αž—αž‘αž„αž“αŸ„αŸ‡αž„αž‚αŸ„αž… αž€αŸ† αž“αžαŸ‹ padding, margin αž„αžœαžœαŸ’αžŸαŸ’αžœαžΆαŸ†αž”αžΆαž“ αž”αŸ‰αžΆαž» αž‘αž“αžαž˜αž·αž“αŸ„αž…αž€αŸ†αž“αžαŸ‹ αžαžΆαŸ’αž„αž›αžΎ αž“αž· αŸ’αž„αžšαž€αžΆαž˜αž”αžΆαž“αž„αž‘αŸ” αž„αžŠαžΎαž–αžšαŸ’αžΈ αž€αž„αž‚αžšαžαžΌαžœ αž„αžšαž”αžΎαž“αžΌαžœ line-height αž‡αŸ† αž“αž½αžŸαžœ αž·αž‰αŸ” αž„αžŠαžΎαž˜αž”αžΈαž„αž’αžœαžΎαž€αžΆαžšαž”αžαžΌαžšαž“αžΌ αžœαžšαž”αž„αž—αž‘ box αžšαž”αžŸαŸ‹αžœαžΆαžšαžαžΌαžœαž€αŸ† αž“αžαŸ‹ αž“αžΌαžœ display αžšαž”αžŸαŸ‹αžœαžΆαž€αž“αž»αŸ’ CSS ដូ αž…αžαžΆαŸ’αž„αžšαž€αžΆαž˜αŸ–

display: display:[inline|block|none]

Defining Border Border αž˜αžΆαž“αž“αžΌ αžœαž›αž€αžαžŽαŸˆαž”αžΈαž™αŸ‰αžΆαŸ’αž‘αžŠαž›αžšαžαžΌαžœαž€αŸ† αž“αžαŸ‹ αž‚αžΊ αž–αžŽαŸŒ αž‘αŸ† αž˜αžΆαž“αžŠαžΌαž…αžαžΆαŸ’αž„αžšαž€αžΆαž˜αŸ–

αŸ† αž“αž· αŸ’ style αžšαž”αžŸαŸ‹αžœαžΆαŸ” αž…αŸ† αž„αž–αžΆαŸ„αŸ‡ style


border: border: color width style; border: #AABB44 1px solid;

αžŸαŸ†αžšαžΆαž”αŸ‹αž€αŸ†αž“αžαŸ‹ αž›αž€αžαžŽαŸˆ αžšαž”αžŸαŸ‹αžšαž‡αž»αŸ’αž‘αžΆαŸ†αŸ’αž”αž½ αž“

Each Border Edge: border-left: color width style: border-top: color width style: border-right: color width style: border-bottom: color width style:

Each Border Porperty border-width: width; border-color: color; border-style: style;

Each Border Edge and Property border-left-color: color; border-top-style: style; ...

background-color: background-color: color;

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž€αŸ†αž“αžαŸ‹αž–αžŽαŸŒαžšαž”αžŸαŸ‹αž“αž•αž‘αžαžΆαŸ’αž„αžšαž€αžΆαž™αžšαž”αžŸαŸ‹ boxαŸ”

overflow: overflow: visible|scroll|auto|hidden;


αž„αž‚αž„αžšαž”αžΎαžœαžΆαž„αŸ…αž„αž–αž›αž’αž€αžŸαžšαž„αŸ…αž€αž“αž»αŸ’αž„αž›αžΎαžŸαž‘αŸ† αž„αŸ„αž™αžšαžαžΌαžœαž“αžΉαŸ’αž”αžš αž·αž˜αžΆαžŽαž‘αŸ† αž„αžšαŸ… boxαŸ” αž„

αŸ†αž‘αžŠαž›αžšαžαžΌαžœαž•αž‘αž»αž€αŸ” αž‡αžΆαž’αž˜αž˜αžαžΆαž€αž“αž»αŸ’IE αžœαžΆαž“αžΉαŸ’αž–αžšαŸ’αžΈ αž€αž‘αŸ†

αŸ†αž’αž€αžŸαžšαŸ” αž‘αžαž€αž“αž»αŸ’ browser αžŠαž“αž‘αž„αž‘αŸ€αžαžœαžΆαž“αžΉ αŸ’αž„αž’αžœαžΎαž„αŸ„αž™αž’αž€αžŸαžšαž€αž“αž»αŸ’ αž„

αŸ†αžšαž”αžŸαŸ‹αžšαž”αž’αž”αŸ‹ αŸ€αžšαž„αž…αž‰αž˜αž€

តុ αžŠαžΌαž…αž„αž“αŸ„αŸ‡αž„αž‚αž„αžšαž”αžΎ αž“αžΌαžœ overflow αž„αžŠαžΎαž˜αž”αžΈαž„αŸ„β€‹αŸ„αŸ‡αžŸαŸ’αžŸαŸ’αžœαž™αž”αž‰αŸ’αž‰ អ αž„αž“αŸ„αŸ‡αŸ”

ο‚·

visible αŸ– αž‚αžΊ αžŠαžΌαž…αž’αž˜αž˜αžαžΆ αž‚αžΊαžœαžΆαž“αžΉ αŸ’αž”αž„αŸ’αž αžΆαž‰αžšαžΆαž›αŸ‹αž’αž€αžŸαžšαž‘αžŠαž›αž˜αžΆαž“

ο‚·

scroll αŸ– αž‚αžΊ αžœαžΆαž”αž„αŸ’αž€αžΎαžαž“αžΌ វ scrollbar αž„αžŠαžΎ αž„αž˜αž”αžΎαžš αŸ†αž€αž· αž›αŸ” αžœαžΆαž”αž„αŸ’αž αžΆαž‰αž‡αžΆαž“αž· αž…αž„αžΆ αž”αžΎαž„αž‘αžΆαŸ„αŸ‡αž‡αžΆαž‘αŸ†

αŸ†αžšαž‚αž”αŸ‹ αžšαž‚αŸ’αž“αž“αŸ‹

αž€αŸ αž„αŸ„αž™αŸ” ο‚·

auto αŸ– αž‚αžΊ αžŠαžΌαž… scroll αž‘αžαžœαžΆαž˜αžΆαž“ scrollbar αž‘αžαž„αž–αž›αžœαžΆαž„αž›αžΎαžŸαž‘αŸ†

αŸ†αž”αŸ‰αžΆαž»αž“αž„

αŸ„αŸ‡αŸ”

ο‚·

hidden αŸ– αž‚αžΊαžœαžΆαž”αž„αŸ’αž αžΆαž‰αž‘αžαž’αž€αžŸαžšαž‘αžŠαž›αž‹αž· αžαž€αž“αž»αŸ’αž‘αžŠαž“αž€αŸ† αž“αžαŸ‹ αžšαž”αžŸαŸ‹αžœαžΆαž”αŸ‰αžΆαž»αž“αž„

αŸ„αŸ‡αŸ”

Wrap Content with Floating Elements float: float: left|right|none;

ο‚·

left : αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹ αž‘αžΆαž‰αž„αŸ„αž™ Element αž„αŸ…αž‘αž•αž“αž€αžαžΆαŸ’αž„αžœαžœαŸ’ αž“αž·αŸ’αž’αžœαžΈαž‘αžŠαž›αž„αŸ…αž„αžšαž€αžΆαž˜ αž“αžΉ αŸ’αž˜αž€αž‹αž·αžαž‡αžΆαž”αŸ‹ αžαžΆαŸ’αžŸαŸ’αžœαžαž“αŸ† αž“ element αž„

ο‚·

αŸ„αŸ‡αŸ”

right : αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹ αž‘αžΆαž‰αž„αŸ„αž™ Element αž„αŸ…αž‘αž•αž“αž€αžαžΆαŸ’αžŸαŸ’αžœαžαŸ† αž“αž·αŸ’αž’αžœαžΈαž‘αžŠαž›αž„αŸ…αž„αžšαž€αžΆαž˜ αž“αžΉ αŸ’αž˜αž€αž‹αž·αžαž‡αžΆαž”αŸ‹ αžαžΆαŸ’αž„αžœαžœαŸ’αž“αž“ element αž„

ο‚·

αŸ„αŸ‡αŸ”

none : αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹ រ αŸ†αž€αž· αž›αž˜αž€αž‘αžΈ αžαžΆαŸ†αŸ’αž„αžŠαžΎαž˜αžœ αž·αž‰αŸ”

Background, Border with float Problem αž‡αžΆαž’αž˜αž˜αžαžΆαž„αž–αž›αž„αž™αžΎαŸ’αž€αŸ†αž“αžαŸ‹αž“αžΌαžœ style αžšαž”αžŸαŸ‹ box αž„αŸ„αž™ float αž„αŸ…αžαžΆαŸ’αžŸαŸ’αžœαžαŸ† αž‘αžαž€αž“αž»αŸ’αž€αžšαžŽαžΈαž‘αžŠαž›

αž„αž™αžΎαŸ’αž˜αžΆαž“αž“αžΌ វ Element αž‘αžŠαž›αž„αŸ…αž–αžΈ αž„αžšαž€αžΆαž˜ αž‘αžŠαž›αžαžšαž˜αžΌαžœαž„αŸ„αž™αž”αŸ† αž„αž–αž‰αž‘αžαž‘αž•αž“αž€αžαžΆαŸ’αž„αžœαžœαŸ’ វអមិ αž“αž˜αžΆαž“

αžšαž”αžŸαž·αž‘αž· αž—αŸ’αž‡ αž’ αž–αž„αŸ…αž„αž›αžΎ background αž“αž· αŸ’ border αž„αž‘αžŠαžΌαž…αž”αž„αŸ’αž αžΆαž‰αž„αŸ…αžšαžΌαž”αžαŸ† αž”αžΌαŸ’αŸ” αž„αžŠαžΎ αž„αž˜αž”αžΎαž„αŸ„β€‹αŸ„αŸ‡αžŸαŸ’αžŸαŸ’αžœαž™αž“αžΌαžœ αž”αž‰αŸ’αž‰ អ αž„αž“αŸ„αŸ‡ αž€αž“αž»αŸ’ style αžšαž”αžŸαŸ‹ element αž‘αžŠαž›αž˜αžΆαž“ background, border αž„ ដូ αž…αž€αžΌ αžŠαžαžΆαŸ’αž„αžšαž€αžΆαž˜αŸ–

αŸ„αŸ‡αžšαžαžΌαžœαž”αž‘αž“αžαž˜αž“αžΌαžœ overflow:hidden αž„αž‘αžΎ αž”αž”αžΆαž“

body{ font-family:Georgia, "Times New Roman", Times, serif; } h1{ background-color:#CCCCCC; border:1px solid; overflow:hidden; } h2{ margin-bottom:0px; border-bottom:2px dashed; color:#FF9933; overflow:hidden; zoom:1;//αž„αžšαž”αžΎαž…αŸ†αž„αž–αžΆαŸ„αŸ‡αž‘αž IE 5 αž“αž·αŸ’ 6 αž”αŸ‰αžΆαž»αž„αžŽαŸ’αžαžŽαŸ„αŸ‡αž…αŸ†αž„αž–αžΆαŸ„αŸ‡ IE 7 αž˜αž·αž“αž…αŸ†αž”αžΆαž…αŸ‹αž„αž‘ } p{ margin-top:0; }


#sidebar{ background:rgb(227,108,10); border:#CC3300; float:right; width:250px; padding:20px; margin:20px; } * html #sidebar{ display:inline;} //αž„αžšαž”αžΎαž…αŸ†αž„αž–αžΆαŸ„αŸ‡αž‘αž IE 5 αž“αž·αŸ’ 6


clear: clear: left|right|both|none;

αž”αŸ’αžšαžΎ αžŸαŸ†αžšαžΆαžšαŸ‹αžšαž„αžΆβ€‹αžΆαžšαŸ‹ αž”αŸ„ αž”αŸ„

element αž€αž»αŸ† αž”αŸ„

wrap αžšαŸ† αž”αž–αž‰ element αžŠαŸ‚αž›αž”αžΆαž floatαŸ” αž€αžΆαžšαž”αŸ’αŸ‚αžΎαžŠαžšαžšαž”αžαŸαŸ‡αžœαžΆαž”αŸ’αŸ‚αžΎ

element αž’αŸ’αž›αžΆαž€αŸ‹ αž˜αž€αž–αžΈ αž”αŸ’αž€αžΆαž˜ element αžŠαŸ‚αž› floatαŸ” ο‚·

left αŸ– αžœαžΆαžαžΉαž„αž’αŸ’αž›αžΆαž€αŸ‹αž˜αž€αž”αŸ’αž€αžΆαž˜ element αžŠαŸ‚αž› float αžαžΆαž„αž”αžœαŸ‚αž„ αžŠαžšαž”αŸ…αžšαŸ†αž”αž–αž‰ element right float

ο‚·

right αŸ– αžœαžΆαžαžΉαž„αž’αŸ’αž›αžΆαž€αŸ‹αž˜αž€αž”αŸ’αž€αžΆαž˜ element αžŠαŸ‚αž› float αžαžΆαž„αžŸαŸ’αžαŸ† αžŠαžšαž”αŸ…αžšαŸ† αž”αž–αž‰ element left float

ο‚·

both αŸ– αžœαžΆαž“αžΉαŸ’αž’αžΆαž›αž€αŸ‹αž˜αž€αž„αžšαž€αžΆαž˜ element αž‘αžŠαž› float

ο‚·

none αŸ– αžœαžΆαž“αžΉαŸ’αž„αŸ…αž”αŸ† αž„αž–αž‰ element αž‘αžŠαž› floatαŸ”

Adding Graphics to Web Page background-image: background-image: url(image/bg.jpg);

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹ αŸ„αž€αŸ‹ background αž„αŸ…αž„αŸ„αž™ tag αžŽαŸ’αžαž˜αž½ αž™αŸ”

background-repeat: background-repeat: repeat|repeat-x|repeat-y|no-repeat;

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž€αŸ†αž“αžαŸ‹αž“αžΌαžœαž€αžΆαžš repeat αžšαž”αžŸαŸ‹ background image αŸ”

background-position: background-position: [left|center|right|#px|%] [bottom|center|top|#px|%];

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž€αŸ†αž“αžαŸ‹αž‘αžΈαžαžΆαŸ†αŸ’αžšαž”αžŸαŸ‹ background imageαŸ”

html { height: 100%; } αž˜αžΆαž“αžšαž”αž„αž™αž‡αž“αŸ αžŸαŸ†αžšαžΆαž”αŸ‹αž„αž–αž› αž‘αžŠαž›αž˜αžΆαž“αž”αž‰αŸ’αž‰ អ αž€αž“αž»αŸ’ firefox browser αž‘αžŠαž›αž€αŸ†αž–αžŸαŸ‹αžšαž”αžŸαŸ‹ body មិ αž“

αž„αžŸαž˜αžΎαž“αžΉαŸ’αž€αŸ†αž–αžŸαŸ‹αžšαž”αžŸαŸ‹ page αž‘αžΆαŸ†αŸ’αž˜αžΌ αž›

background-attachment: background-attachment: scroll|fixed;

fixed: αž€αŸ† αž“αžαŸ‹ αž€αž»αŸ†αž„αŸ„αž™ background-image រ αŸ†αž€αž· αž›αžαžΆαž˜αž€αžΆαžšαž‘αžŠαž›αž„αž™αžΎαŸ’αž”αžΆαž“ scroll scroll: αž€αŸ† αž“αžαŸ‹ αž„αŸ„αž™ background-image រ αŸ†αž€αž· αž›αžαžΆαž˜αž€αžΆαžšαž‘αžŠαž›αž„αž™αžΎαŸ’αž”αžΆαž“ scroll

background: background: url(…) #FFF center center fixed …;

αžŸαŸ†αžšαžΆαž”αŸ‹αž€αŸ†αž“αžαŸ‹ αžšαž‚αž”αŸ‹ property αžšαž”αžŸαŸ‹ background


Navigation Technique Requirement αž‡αžΆαž’αž˜αž˜αžαžΆαž€αž“αž»αŸ’αž€αžΆαžšαž”αž„αŸ’αž€αžΎαžαž“αžΌαžœ Link αž„αž‚αž‘αžαŸ’αž‘αžαž„αžšαž”αžΎ <a/>,<ul/>,<li/> tag αž„αžŠαžΎαž˜αž”αžΈαŸ„αž€αŸ‹ link

αž‡αžΆαžšαž€αž»αž˜αŸ—αŸ” αž€αžΆαžšαž„αž’αžœαžΎαž‘αž”αž”αž„αž“αŸ„αŸ‡αžœαžΆαŸ„αž… αž„αŸ„αž™αžšαž…

αž“αžΌ αžœαžšαž”αž„αž—αž‘αž“αž“ navigation option αž”αžΆαž“αž„αžšαž…αžΎ αž“ αžŠαžΌαž…αž‡αžΆ Vertical

Navigation, Horizontal NavigationαŸ”

Vertical Navigation Sample Preloading Techniques Pixy Techniques αž„αžšαž€αžΆαž˜αŸ–

αž‡αžΆαžœ αž·αž’αžΈ αžŸαŸ’αžœαžŸαŸ’αžšαžŸαžαž‘αžŠαž›αž„αž‚αž„αžšαž”αžΎαž€αž»αŸ’ αž“ preloading-rolloverαŸ” αž€αž“αž»αŸ’αžœ αž·αž’αžΈ αžŸαŸ’αžœαžŸαŸ’αžšαžŸαžαž‚αžΊαž˜αžΆαž“αžŠαŸ† αžŽαŸ’αžαž€αŸ‹αž€αžΆαž›αžŠαžΌ αž…αžαžΆαŸ’ ο‚·

αžšαžαžΌαžœαž”αž„αŸ’αž€αžΎαžαž“αžΌ αžœαžšαžΌαž”αž—αŸ’αž‡αž–αž˜αž½ αž™αž‘αžŠαž›αž˜αžΆαž“αž‘αžΆαŸ†αŸ’ normal state, rollover state

ο‚·

αžšαžαžΌαžœαž€αŸ† αž“αžαŸ‹αž‚αŸ†αž›αžΆαžαž–αžΈ state αž“αžΈ αž˜αž½αž™αŸ—αž„αŸ„αž™αž”αžΆαž“αž‡αžΆαž€αŸ‹αž›αžΆαž€αŸ‹

ο‚·

αžšαžαžΌαžœαž€αŸ† αž“αžαŸ‹ style αž„αŸ„αž™ link ដូ αž…αžαžΆαŸ’αž„αžšαž€αžΆαž˜αŸ–(αž§αž”αž˜αžΆαžαžΆαž‚αŸ† αž›αžΆαž 20px)

ο‚· ο‚·

a{ background: url(state.jpg) 0px 0px; a:hover{ background: url(state.jpg) opx -20px;

Using Hidden Loading αžšαžΌαž”αž—αŸ’αž‡αž–αžšαžαžΌαžœαž”αžΆαž“ download αž„αŸ…αž€αžΆαž“αŸ‹ client αž‘αžαž˜αžαŸ’αž‚αžαŸ‹ αž„αž”αžΎ αž„αž‘αžΆαŸ„αŸ‡αž‡αžΆ αžšαžΌαž”αž—αŸ’αž‡αž–αž˜αž½ αž™αž„

αŸ„αŸ‡αžšαžαžΌαžœαž”αžΆαž“αž„αžšαž”αžΎ

αž„αžšαž…αžΎαž“αžŠαŸ’αž€αž“αž»αŸ’ page αž€αŸ αž„αŸ„αž™αŸ” ដូ αž…αž„αž…αž“αŸ„αŸ‡αž„αž™αžΎαŸ’αžšαž‚αŸ’αž“αž“αŸ‹ αž‘αžαž”αž„αŸ’αž€αžΎαžαž“αžΌ វ div tag មួ αž™αžšαž½αž…αŸ„αž€αŸ‹ αž“αžΌαžœαžšαžΌαž”αž—αŸ’αž‡αž–αžŽαŸ’αžαž‘αžŠαž› រតូវ load αžαžΆαŸ’αž€αž“αž»αŸ’αžœαžΆ αž” αž‘ αž”αŸ‹αž˜αž€αž€αŸ† αž“αžαŸ‹visibility:hidden, position:absolute αž‡αžΆαž€αžΆαžšαž„αžŸαŸ’αžŸαž…αŸ”

Sliding Door Technique αž‡αžΆαžœ αž·αž’αžΈ αžŸαŸ’αžœαžŸαŸ’αžšαžŸαžαž‘αžŠαž›αž„αž‚αž„αžšαž”αžΎαžŸαŸ†αžšαžΆαž”αŸ‹αž”αž„αŸ’αž€αžΎαžαž“αžΌ αžœαž”αžΌ αžαž»αŸ’αž˜αž½ αž™αž‘αžŠαž›αŸ„αž… រ αžΈαž€αžšαž½αž˜αž‘αŸ†

αŸ†αž”αžΆαž“αž‘αžŠαž›αž„αž™αžΎαŸ’αž”αžΆαž“

αž€αŸ† αž“αžαŸ‹ αŸ” ο‚·

αž”αž„αŸ’αž€αžΎαžαž“αžΌ αžœαž”αžΌ αžαž»αŸ’αž˜αž½ αž™αž‘αžŠαž›αž˜αžΆαž“αž‘αŸ†

αŸ†αž’αžαž·αž”αžšαž˜αžΆ

ο‚·

αž” αž‘ αž”αŸ‹ αžšαžαžΌαžœαž”αŸ† αž‘αž”αž€αžšαžΌαž”αž—αŸ’αž‡αž–αž‡αžΆαž–αžΈ αžšαž…αŸ† αž„αžšαŸ€αž€αŸ” αž…αŸ† αž„αžšαŸ€αž€αž‘αžΈ αŸ‘αŸ„αž€αŸ‹ αž‘αžαž˜αžΆαžαŸ’αž‘αžŠαž›αž‘αžšαž”αžšαž”αž½αž›αžαžΆαŸ’αž„αžœαžœαŸ’αž„αž‚ αž”αŸ’αž’αžŸαŸ‹ αž“αž·αŸ’αž…αŸ† αž„αžšαŸ€αž€αž‘αžΈ ្ αŸ„αž€αŸ‹ αžšαž” ូ αž—αŸ’αž‡αž–αž‘αžŠαž›αž„αŸ…αžŸαž›αŸ‹αŸ”

ο‚· ο‚·

αž€αž“αž»αŸ’αž€αžΌ ដ HTML αžšαž‚αž”αŸ‹ link αžšαžαžΌαžœαŸ„αž€αŸ‹αž€αž»αŸ’ αž“ li αŸ” αž€αž“αž»αŸ’ style sheet αžšαžαžΌαžœαž€αŸ†αž“αžαŸ‹ background αžšαž”αžŸαŸ‹ li αž„αŸ„αž™αžšαžΌαž”αž—αŸ’αž‡αž–αž‘αžΈ ្

li{ background: url(btn_right.png) right top; ο‚·

αž€αž“αž»αŸ’ a αžšαžαžΌαžœαž€αŸ†αž“αžαŸ‹

a{ background: url(btn_left.png) left top;


Formatting Table and Form border-collapse: border-collapse: collapse|separate;

αž„αžšαž”αžΎ αžŸαŸ†αžšαžΆαž”αŸ‹αž€αŸ†αž“αžαŸ‹αž“αžΌαžœ αž€αžΆαžšαŸ„αž…αŸ‹ αž‚αŸ’αž“αž“ រ αžΊαž‡αžΆαž”αŸ‹ αž‚αŸ’αž“αž“αžšαž”αžŸαŸ‹ border αž“αž“ table αŸ”


CSS Page Layout CSS Page Layout αž˜αžΆαž“αž–αžΈαžšαžšαž”αž„αž—αž‘αž‚αžΊ absolute positioning αž“αž· αŸ’floatαŸ” Absolute Positioning αž‚αžΊ αž‡αžΆαž€αžΆαžšαŸ„αž€αŸ‹ element មួ αž™ αž„αŸ„αž™αž„αŸ…αž‘αžΈαžαžΆαŸ†αŸ’αžŽαŸ’αžαž˜αž½ αž™αž“αž“ Page αžαžΆαž˜αžšαž™αŸˆαž€αžΆαžšαž€αŸ† αž“αžαŸ‹αž…αŸ†αž“αž½αž“ pixelαŸ”

Type of Web Page Layout Fixed Width αž‚αžΊ αž‡αžΆαž€αžΆαžšαž€αŸ†αž“αžαŸ‹ αž“αžΌαžœαž‘αž‘αžΉ αŸ’αž‡αžΆαž€αŸ‹αž›αžΆαž€αŸ‹ αžšαž”αžŸαŸ‹ Page αž„αž‘αžΆαŸ„αŸ‡αž”αžΈαž‡αžΆαž‘αŸ† αž€αŸ αž’αžΈαŸ— វ αž‘αžŠαž›αž˜αžΆαž“αž€αž“αž»αŸ’ Page មិ αž“αžš αžΈαž€αžšαž½αž˜αž„αŸ…αžαžΆαž˜αž€αžΆαžšαž‘αžšαž”αžšαž”αž½αž›αž„ αž…αŸ† αž„αž–αžΆαŸ„αŸ‡αž‘αŸ†

αŸ†αžšαž”αžŸαŸ‹ browser αž‘αžšαž”αžšαž”αž½αž›αž™αŸ‰αžΆ αŸ’αžŽαŸ’αž

αŸ„αŸ‡αž„αž‘

αŸ† Screen 800x600 αž„αž‚αž‘αžαŸ’αž‘αžαž„αžšαž‡αžΎ αžŸαž™αž€αž‘αŸ†

αŸ†αžšαž”αžŸαŸ‹ Page 760px αž„αžŠαžΎαž˜αž”αžΈαž”αž“αžŸαž›αŸ‹

αž€αž‘αž“αž›αŸ’αž‘αŸ† αž„αž“αžšαžαž›αŸ„αŸ‡αžŸαŸ†αžšαžΆαž”αŸ‹ scroll bar αž“αž· αŸ’αž‘αž•αž“αž€αž„αž•αžŸαŸ’αŸ—αž“αž“ Browser αž…αŸ† αž„αž–αžΆαŸ„αŸ‡αž‘

αŸ† Screen 1024x768 αž„αž‚αž‘αžαŸ’αž„αžšαž‡αžΎ αžŸαž™αž€ 950pxαŸ”

Liquid αž‚αžΊ αž‡αžΆαž€αžΆαžšαžšαž… αžαžΆαž˜αž‘αŸ†

αž„αŸ„αž™αž‘αžšαž”αžšαž”αž½αž›αž„αŸ…αžαžΆαž˜ αž‘αŸ†

αŸ†αžšαž”αžŸαŸ‹ browser αžœαžΆαž“αžΉ αŸ’αž…αž„αŸ’αž’αŸ€αž រ αžΊαž‘αžΌ αž›αžΆαž™αŸ„αžŸαŸ’αžŸαŸαž™αž„αŸ…

αŸ†αžšαž”αžŸαŸ‹ browserαŸ”

Elastic αž‚αžΊ αž‡αžΆαž€αžΆαžšαžšαž…

αž‘αžŠαž› αž€αŸ† αž“αžαŸ‹αž‘αŸ†

αŸ†αžšαž”αžŸαŸ‹ page αž„αŸ…αžαžΆαž˜αž‘αŸ†

αž€αŸ† αž“αžαŸ‹ αŸ” ដូ αž„αž…αž“αŸ„αŸ‡αž„αž–αž›αž‘αžŠαž› user αž–αžšαŸ’αžΈαž€αž’αž€αžŸαžšαž„αŸ…αž„αž›αžΎ browser αž„ αž‘αŸ†

αŸ†αžšαž”αžŸαŸ‹αž’αž€αžŸαžšαž”αžΆαž“αž™αŸ‰αžΆ αŸ’αž›αž’αŸ”

αŸ†αžšαž”αžŸαŸ‹αž’αž€αžŸαžšαž„αŸ„αž™αž„αžšαž”αžΎ αžšαž”αžΆαžŸαŸ‹ em αžŸαŸ†αžšαžΆαž”αŸ‹ αŸ„αŸ‡αž‘αŸ†

αŸ† container αž“αžΉαŸ’αž‘αžšαž”αžšαž”αž½αž›αž„αŸ…αžαžΆαž˜




Step to Create Page Layout 1. αŸ„αž€αŸ‹ αžšαžΆαž›αŸ‹ Page Content αž€αž“αž»αŸ’ wrapper <div>

αž”αž„αŸ’αž€αžΎαžαž“αžΌ វ container αžŸαŸ†αžšαžΆαž”αŸ‹αž€αžΆαžšαž€αŸ† αž“αžαŸ‹αž‘αž‘αžΉαŸ’αž‡αžΆαž€αŸ‹ αž›αžΆαž€αŸ‹αž˜αž½αž™ αžŸαŸ†αžšαžΆαž”αŸ‹ αŸ„αž€αŸ‹ αžšαžΆαž›αŸ‹ cotent αž„αŸ…αž„αž›αžΎ page αž“αž· αŸ’αž•αžαž›αŸ‹αž—αŸ’αž‡αž–αž„αŸ’αž αž™αžŸαŸ’αžŸαž½αž› មិ αž“αž…αŸ†αž”αžΆαž…αŸ‹ αž€αŸ†αž“αžαŸ‹ αž‘αŸ†

αŸ† banner, column, footerαŸ”

2. αž€αŸ† αž“αžαŸ‹ αž‘αž‘αžΉαŸ’αž“αž“ wrapper <div> αž”αž„αŸ’αž€αžΎαž style αžŸαŸ†αžšαžΆαž”αŸ‹ wrapper <div> αž„αžŠαžΎ αž„αž˜αž”αžΎαž€αŸ†αž“αžαŸ‹ αž‘αž‘αžΉαŸ’αžšαž”αžŸαŸ‹αžœαžΆ 3. αŸ„αž€αŸ‹ column αž“αžΈ αž˜αž½αž™αŸ—αž€αž“αž»αŸ’ <div> tag αž„αŸ„αž™αž€αŸ† αž“αžαŸ‹ id αž“αž· αŸ’ class attribute: 4. αž€αŸ† αž“αžαŸ‹Float αž“αž“ divs αžŸαŸ†αžšαžΆαž”αŸ‹ column αž“αžΈ αž˜αž½αž™αŸ—

αŸ„αž€αŸ‹ left sidebar αž“αž· αŸ’ main content αž€αž“αž»αŸ’ div មួ αž™ αž„

αžΎαž™ float left, αž€αž“αž»αŸ’ div αž„

αŸ„αŸ‡ div αžšαž”αžŸαŸ‹ left

sidebar រតូវ float left αž“αž· αŸ’main content រតូវ float rightαŸ” αž…αŸ† αž‘αž“αž€αž― right side bar រតូវ float right. 5. αž€αŸ† αž“αžαŸ‹ width αž“αž“ column αž“αžΈ αž˜αž½αž™αŸ—


αž‡αžΆαž‘αžΌ αž„αŸ… αž„αž™αžΎαŸ’αž‚αž½αžšαž‘αžαž€αŸ†αž“αžαŸ‹ width αž“αž“ float elementαŸ” αž„αŸ„αž™αž–αžΉ αŸ’αž‘αž•αž’αž€αž„αž›αžΎαž€αžΆαžšαžšαž…

αžšαž”αžŸαŸ‹αž’αž€ αž“ αž’αž“αž€

αŸ„αž…αž”αž‘αž“αžαž˜ padding, margin αž“αž· αŸ’ borderαŸ” αž…αŸ†αžαžΆ width αžŸαžšαž»αž”αžšαž”αžŸαŸ‹ column αž“αžΈαž˜αž½αž™αŸ—αž‚αžΊ αž”αžΆαž“αž˜αž€αž–αžΈ αž€αžΆαžšαž”αžΌ αž€αž”αž‰αŸ’αžΌαž… αž›αž‚αŸ’αž“αž“αžšαžœαžΆαŸ’ left and right margin, padding, αž“αž·αŸ’ border


6. αž”αž‘αž“αžαž˜ left margin αž„αŸ…αž€αžΆαž“αŸ‹ main column 7.

αž€αŸ† αž“αžαŸ‹ left margin αžšαž”αžŸαŸ‹ left_sidebar : -587px;


Turn static files into dynamic content formats.

CreateΒ aΒ flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.