មេរៀនទី២២:លក្ខណ:ពិសេស Browser
លំហាត់អនុវត្តសរសេរកូដ ជាមួយកម្មវិធី CSS
លំហាត់ទី១: បង្កើតព៌ណ របស់ scrollbars
សរសេរកូដ
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
Changing the scrollbar colors
content=”text/html; charset=iso-8859-1″ />


សរសេរកូដ
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
content=”text/html; charset=iso-8859-1″ />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. …
លំហាត់ទី២ ការបង្កើត menu ប្រើ page scrolls បាន

សរសេរកូដ
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
content=”text/html; charset=iso-8859-1″ />
Welcome to Stage & Screen
Lorem ipsum dolor sit amet, consectetuer adipiscing …
Latest Reviews
body {
margin: 0;
padding: 0;
background-color: #FFFFFF;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
}
#nav {
position: absolute;
top: 2em;
left: 1em;
width: 14em;
}
body > #nav {
position: fixed;
}
#nav ul {
list-style: none;
margin-left: 1em;
padding-left: 0;
}
#nav li {
font-size: 80%;
border-bottom: 1px dotted #B2BCC6;
margin-bottom: 0.3em;
}
#nav a:link, #nav a:visited {
text-decoration: none;
color: #2A4F6F;
background-color: transparent;
}
#nav a:hover {
color: #778899;
}
#nav h2 {
font: 110% Georgia, “Times New Roman”, Times, serif;
color: #2A4F6F;
background-color: transparent;
border-bottom: 1px dotted #cccccc;
}
#content {
margin: 2em 2em 0 16em;
}
h1 {
font: 150% Georgia, “Times New Roman”, Times, serif;
}
#content p {
font-size: 80%;
line-height: 1.6em;
padding-left: 1.2em;
} លំហាត់ទី៣ របៀប ដោះស្រាយអោយ menu ដើរលើ Internet Explorer
<!–force IE into Quirks Mode–>
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
content=”text/html; charset=iso-8859-1″ />
<!–[if IE]>
body
{
overflow-y: hidden;
}
div#content
{
height: 100%;
overflow: auto;
}
<![endif]–>
Welcome to Stage & Screen
Lorem ipsum dolor sit amet, consectetuer adipiscing …
…
Latest Reviews
body {
margin: 0;
padding: 0;
background-color: #FFFFFF;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
}
#nav {
position: absolute;
top: 2em;
left: 1em;
width: 14em;
}
body > #nav {
position: fixed;
}
#nav ul {
list-style: none;
margin-left: 1em;
padding-left: 0;
}
#nav li {
font-size: 80%;
border-bottom: 1px dotted #B2BCC6;
margin-bottom: 0.3em;
}
#nav a:link, #nav a:visited {
text-decoration: none;
color: #2A4F6F;
background-color: transparent;
}
#nav a:hover {
color: #778899;
}
#nav h2 {
font: 110% Georgia, “Times New Roman”, Times, serif;
color: #2A4F6F;
background-color: transparent;
border-bottom: 1px dotted #cccccc;
}
#content {
padding: 2em 2em 0 16em;
}
h1 {
font: 150% Georgia, “Times New Roman”, Times, serif;
}
#content p {
font-size: 80%;
line-height: 1.6em;
padding-left: 1.2em;
}
លំហាត់ទី៤ ការបង្កើត page footer ដោយប្រើ CSS

សរសេរកូដ
<!–force IE into Quirks Mode–>
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
content=”text/html; charset=iso-8859-1″ />
<!–[if IE]>
body
{
overflow-y: hidden;
}
div#wrapper
{
height: 100%;
overflow: auto;
}
<![endif]–>

alt=”Stage & Screen” />
theatre and film reviews
Welcome to Stage & Screen
Lorem ipsum dolor sit amet, consectetuer adipiscing …
…
Latest Reviews
Contact us | Discussion forum
body {
margin: 0;
padding-bottom: 2em;
background-color: #FFFFFF;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
border-top: 2px solid #2A4F6F;
}
#header {
border-top: 1px solid #778899;
border-bottom: 1px dotted #B2BCC6;
height: 3em;
}
#header .strapline {
font: 120% Georgia, “Times New Roman”, Times, serif;
color: #778899;
background-color: transparent;
float: right;
margin-right: 2em;
margin-top: 0.5em;
}
#header .logo {
float: left;
margin-left: 1.5em;
margin-top: 0.5em;
}
#footer {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 2em;
background-color: #2A4F6F;
color: #FFFFFF;
border-top: #778899;
text-align: right;
}
html > body #footer {
position: fixed;
}
#footer a:link, #footer a:visited {
padding: 0.5em 1em 0.5em 1em;
color: #FFFFFF;
background-color: transparent;
font-size: 80%;
}
#footer a:hover {
text-decoration: none;
}
#nav {
position: absolute;
top: 5em;
left: 1em;
width: 13em;
}
#nav ul {
list-style: none;
margin-left: 1em;
padding-left: 0;
}
#nav li {
font-size: 80%;
border-bottom: 1px dotted #B2BCC6;
margin-bottom: 0.3em;
}
#nav li a:link, #nav li a:visited {
text-decoration: none;
color: #2A4F6F;
background-color: transparent;
}
#nav li a:hover {
color: #778899;
}
#nav h2 {
font: 110% Georgia, “Times New Roman”, Times, serif;
color: #2A4F6F;
background-color: transparent;
border-bottom: 1px dotted #cccccc;
}
#content {
margin-left: 16em;
margin-right: 2em;
}
h1 {
font: 150% Georgia, “Times New Roman”, Times, serif;
}
#content p {
font-size: 80%;
line-height: 1.6em;
padding-left: 1.2em;
}
លំហាត់ទី៥ បង្កើត CSS drop-down menus?

សរសេរកូដ
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
content=”text/html; charset=iso-8859-1″ />
#nav, #nav ul {
padding: 0;
margin: 0;
list-style: none;
}
#nav li {
float: left;
position: relative;
width: 10em;
border: 1px solid #B0C4DE;
background-color: #E7EDF5;
color: #2D486C;
font: 80% Verdana, Geneva, Arial, Helvetica, sans-serif;
margin-right: 1em;
}
#nav a:link, #nav a:visited {
display: block;
text-decoration: none;
padding-left: 1em;
color: #2D486C;
}
#nav ul {
display: none;
position: absolute;
top: 1.3em;
left: 0;
padding-top: 0.5em;
}
#nav ul li {
float: none;
border: 0 none transparent;
border-bottom: 1px solid #E7EDF5;
background-color: #F1F5F9;
font-size: 100%;
margin: 0;
margin-bottom: 0.5em;
padding: 0;
}
#nav li > ul {
top: auto;
left: auto;
}
#nav li:hover ul {
display: block;
}

… លំហាត់ទី៦ បង្កើត ស៊ុមជុំវិញអត្ថបទ មានរាងជាចតុកោណជ្រុងមូលសងខាង

“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
content=”text/html; charset=iso-8859-1″ />
Lorem ipsum dolor sit amet, consectetuer adipiscing …
.curvebox {
width: 250px;
padding: 1em;
background-color: #B0C4DE;
border: 2px solid #33527B;
color: #33527B;
-moz-border-radius: 25px;
}
ជ្រុងកែង
-moz-border-radius: 25px;

លំហាត់ទី៧ បង្កើត cross-browser ស៊ុមជ្រុងព័ទ្ធជុំវិញ

“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
content=”text/html; charset=iso-8859-1″ />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. …
#box {
font: 80%/1.6 Arial, Helvetica, sans-serif;
color: #2D486C;
background-color: transparent;
margin: 0 20px 10px 0;
}
.roundborder {
height: 1px;
overflow: hidden;
background-color: #B0C4DE;
border-right: 1px solid #33527B;
border-left: 1px solid #33527B;
}
.c1 {
margin: 0 12px 0 12px;
border: none;
background-color: #33527B;
}
.c2 {
margin: 0 9px;
border-width: 0 3px;
}
.c3 {
margin: 0 7px;
border-width: 0 2px;
}
.c4 {
margin: 0 6px 0 6px;
}
.c5 {
margin: 0 5px 0 5px;
}
.c6 {
margin: 0 4px 0 4px;
}
.c7 {
margin: 0 3px 0 3px;
}
.c8 {
margin: 0 2px 0 2px;
height: 2px;
}
.c9 {
margin: 0 1px 0 1px;
height: 3px;
}
.content {
height: auto;
padding: 0 15px;
}

“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
content=”text/html; charset=iso-8859-1″ />

Lorem ipsum dolor sit amet, consectetuer adipiscing …

.rndbox {
background: #C6D9EA;
width: 300px;
font: 11px Verdana, Arial, Helvetica, sans-serif;
color: #000033;
}
.rndtop {
background: url(topright.gif) no-repeat right top;
}
.rndbottom {
background: url(bottomright.gif) no-repeat right top;
}
.rndbox p {
margin: 0 8px;
}
លំហាត់ទី៨ ធ្វើយ៉ាងណាដើម្បីបង្កើត ធាតុ ព៌ណថ្លាព្រិលៗ ក្នុង Mozilla-based browsers, និង Internet Explorer?

សរសេរកូដ
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
content=”text/html; charset=iso-8859-1″ />
Lorem ipsum dolor sit amet, consectetur adipisicing …
#container {
position: absolute;
top: 20px;
left: 20px;
width: 400px;
height: 300px;
background: url(limes.jpg) no-repeat;
}
#container .textblock {
filter: alpha(opacity=60);
opacity: 0.6;
margin-top: 50px;
margin-left: 50px;
width: 300px;
background: #ffffff;
border: 1px solid #007101;
padding: 0.5em;
font: 80%/1.6 Arial, Helvetica, sans-serif;
}

Mozilla browsers.
opacity: 0.6;
Internet Explorer
filter: alpha(opacity=60);
លំហាត់ទី៩ តើធ្វើយ៉ាងណា ប្រើ CSS ដើម្បីបង្ហាញអ្នកមើលអោយដឹងថាមាន link?

សរសេរកូដ
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
content=”text/html; charset=iso-8859-1″ />
By using the more advanced capabilities of CSS3 and viewing
this example in a supporting browser we can have different link
styles depending on whether the link is
internal (within the site) or
external (pointing to
another site).
body {
background-color: #FFFFFF;
color: #000000;
}
p {
font: 80%/1.6 Arial, Helvetica, sans-serif;
}
a:link, a:visited {
color: #CD853F;
background-color: transparent;
font-weight: bold;
text-decoration: none;
padding-bottom: 1px;
border-bottom: 1px dotted #EBCEB1;
}
a:hover {
background-color: #FAF3EC;
}
a[href^="http:"]:link, a[href^="http:"]:visited {
color: #7B68EE;
background-color: transparent;
font-weight: bold;
text-decoration: none;
padding-bottom: 1px;
border-bottom: 1px dotted #B0C4DE;
}
a[href^="http:"]:hover {
background-color: #DEE6F1;
}
លំហាត់ទី១០ ធ្វើយ៉ាងណាដើម្បីបញ្ចូល Text ទៅក្នុង Documents

លំហាត់ទី១១ ស្ទាយបន្ទាត់ដំបូង និងអក្សរដំបូងជាអក្សរពុម្ពធំ

សរសេរកូដ
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
content=”text/html; charset=iso-8859-1″ />
This is the first of three paragraphs on the page, …
Lorem ipsum dolor sit amet, consectetuer adipiscing …
Lorem ipsum dolor sit amet, consectetuer adipiscing …
body {
background-color: #FFFFFF;
color: #595959;
}
#content p {
font: 80%/1.6 Verdana, Geneva, Arial, Helvetica, sans-serif;
}
#content p:first-letter {
font-size: 2em;
padding: 0.1em;
color: #000000;
vertical-align: middle;
}
#content p:first-line {
color: #191970;
}
#content p:first-child {
margin-left: 2em;
}
#content p:first-child:first-line {
color: inherit;
}
Supported by Internet Explorer
#content p:first-letter {
font-size: 2em;
padding: 0.1em;
color: #000000;
vertical-align: middle;
}
#content p:first-line {
color: #191970;
}
#content p:first-child {
margin-left: 2em;
}
#content p:first-child:first-line {
color: inherit;
}

Post a Comment