លំហាត់ CSS- លក្ខណ:ពិសេស Browser

លំហាត់ CSS- លក្ខណ:ពិសេស Browser
លំហាត់អនុវត្តសរសេរកូដ ជាមួយកម្មវិធី CSS
aលំហាត់ទី១: បង្កើតព៌ណ របស់ scrollbars

a សរសេរកូដ
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Changing the scrollbar colors</title>
<meta http-equiv=”content-type”
content=”text/html; charset=iso-8859-1″ />
<style type=”text/css”>
.largetext {
scrollbar-3dlight-color: #B0C4DE;
scrollbar-arrow-color: #FFFFFF;
scrollbar-base-color: #8BA9CF;
scrollbar-darkshadow-color: #436DA3;
scrollbar-face-color: #34547E;
scrollbar-highlight-color: #E6ECF4;
scrollbar-shadow-color: #000000;
}
html {
scrollbar-3dlight-color: #B0C4DE;
scrollbar-arrow-color: #34547E;
scrollbar-base-color: #8BA9CF;
scrollbar-darkshadow-color: #436DA3;
scrollbar-face-color: #E6ECf4;
scrollbar-highlight-color: #FFFFFF;
scrollbar-shadow-color: #34547E;
}
</style>
</head>
<body>
<textarea name=”mytext” id=”mytext” rows=”6″ cols=”40″
class=”largetext”>
Lorem ipsum dolor sit amet, consectetuer …</textarea>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. …</p>
</body>
</html>

លំហាត់ទី២  ការបង្កើត menu ប្រើ page scrolls បាន
a

សរសេរកូដ

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Stage &amp; Screen – theatre and film reviews</title>
<meta http-equiv=”content-type”
content=”text/html; charset=iso-8859-1″ />
<link rel=”stylesheet” type=”text/css” href=”fixedmenu.css” />
</head>
<body>
<div id=”content”>
<h1>Welcome to Stage &amp; Screen</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing …</p>
</div>
<div id=”nav”>
<ul>
<li><a href=”#”>Play Reviews</a></li>
<li><a href=”#”>Film Reviews</a></li>
<li><a href=”#”>Post a Review</a></li>
<li><a href=”#”>About this site</a></li>
<li><a href=”#”>Contact Us</a></li>
</ul>
<h2>Latest Reviews</h2>
<ul>
<li><a href=”#”>The Passion of The Christ</a></li>
<li><a href=”#”>Finding Nemo</a></li>
<li><a href=”#”>Stomp</a></li>
<li><a href=”#”>The Lion King 3</a></li>
</ul>
</div>
</body>
</html>
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–>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Stage &amp; Screen – theatre and film reviews</title>
<meta http-equiv=”content-type”
content=”text/html; charset=iso-8859-1″ />
<link rel=”stylesheet” type=”text/css” href=”fixedmenu2.css” />
<!–[if IE]>
<style type=”text/css” media=”screen”>
body
{
overflow-y: hidden;
}
div#content
{
height: 100%;
overflow: auto;
}
</style>
<![endif]–>
</head>
<body>
<div id=”content”>
<h1>Welcome to Stage &amp; Screen</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing …</p>
<p>…</p>
</div>
<div id=”nav”>
<ul>
<li><a href=”#”>Play Reviews</a></li>
<li><a href=”#”>Film Reviews</a></li>
<li><a href=”#”>Post a Review</a></li>
<li><a href=”#”>About this site</a></li>
<li><a href=”#”>Contact Us</a></li>
</ul>
<h2>Latest Reviews</h2>
<ul>
<li><a href=”#”>The Passion of The Christ</a></li>
<li><a href=”#”>Finding Nemo</a></li>
<li><a href=”#”>Stomp</a></li>
<li><a href=”#”>The Lion King 3</a></li>
</ul>
</div>
</body>
</html>
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

aសរសេរកូដ
<!–force IE into Quirks Mode–>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Stage &amp; Screen – theatre and film reviews</title>
<meta http-equiv=”content-type”
content=”text/html; charset=iso-8859-1″ />
<link rel=”stylesheet” type=”text/css” href=”footerframe.css” />
<!–[if IE]>
<style type=”text/css”>
body
{
overflow-y: hidden;
}
div#wrapper
{
height: 100%;
overflow: auto;
}
</style>
<![endif]–>
</head>
<body>
<div id=”wrapper”>
<div id=”header”>
<img src=”stage-logo.gif” width=”187″ height=”29″
alt=”Stage &amp; Screen” />
<span>theatre and film reviews</span>
</div>
<div id=”content”>
<h1>Welcome to Stage &amp; Screen</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing …</p>
<p>…</p>
</div>
<div id=”nav”>
<ul>
<li><a href=”#”>Play Reviews</a></li>
<li><a href=”#”>Film Reviews</a></li>
<li><a href=”#”>Post a Review</a></li>
<li><a href=”#”>About this site</a></li>
<li><a href=”#”>Contact Us</a></li>
</ul>
<h2>Latest Reviews</h2>
<ul>
<li><a href=”#”>The Passion of The Christ</a></li>
<li><a href=”#”>Finding Nemo</a></li>
<li><a href=”#”>Stomp</a></li>
<li><a href=”#”>The Lion King 3</a></li>
</ul>
</div>
</div>
<div id=”footer”>
<a href=”#”>Contact us</a> | <a href=”#”>Discussion forum</a>
</div>
</body>
</html>
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?
aសរសេរកូដ
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>CSS Flyout menus</title>
<meta http-equiv=”content-type”
content=”text/html; charset=iso-8859-1″ />
<link rel=”stylesheet” type=”text/css” href=”menus.css” />
</head>
<body>
<ul id=”nav”>
<li><a href=”#”>Starters</a>
<ul>
<li><a href=”">Fish</a></li>
<li><a href=”">Fruit</a></li>
<li><a href=”">Soups</a></li>
</ul>
</li>
<li><a href=”#”>Main courses</a>
<ul>
<li><a href=”">Meat</a></li>
<li><a href=”">Fish</a></li>
<li><a href=”">Vegetarian</a></li>
</ul>
</li>
<li><a href=”#”>Desserts</a>
<ul>
<li><a href=”">Fruit</a></li>
<li><a href=”">Puddings</a></li>
<li><a href=”">Ice Creams</a></li>
</ul>
</li>
</ul>
</body>
</html>
#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;
}
a<ul id=”nav”>
<li><a href=”#”>Starters</a>
<ul>
<li><a href=”">Fish</a></li>
<li><a href=”">Fruit</a></li>
<li><a href=”">Soups</a></li>
</ul>
</li>

លំហាត់ទី៦ បង្កើត ស៊ុមជុំវិញអត្ថបទ មានរាងជាចតុកោណជ្រុងមូលសងខាង
aសរសេរកូដ
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Rounded Corners</title>
<meta http-equiv=”content-type”
content=”text/html; charset=iso-8859-1″ />
<link rel=”stylesheet” type=”text/css” href=”corners1.css” />
</head>
<body>
<div>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing …</p>
</div>
</body>
</html>

.curvebox {
width: 250px;
padding: 1em;
background-color: #B0C4DE;
border: 2px solid #33527B;
color: #33527B;
-moz-border-radius: 25px;
}
ជ្រុងកែង
-moz-border-radius: 25px;
aលំហាត់ទី៧ បង្កើត cross-browser ស៊ុមជ្រុងព័ទ្ធជុំវិញ
aសរសេរកូដ
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Rounded Corners</title>
<meta http-equiv=”content-type”
content=”text/html; charset=iso-8859-1″ />
<link rel=”stylesheet” type=”text/css” href=”corners2.css” />
</head>
<body>
<div id=”box”>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. …
</div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>

#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;
}
a<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Rounded corners</title>
<meta http-equiv=”Content-Type”
content=”text/html; charset=iso-8859-1″ />
<link rel=”stylesheet” type=”text/css” href=”corners3.css” />
</head>
<body>
<div>
<div><img src=”topleft.gif” alt=”" width=”30″
height=”30″ /></div>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing …</p>
<div><img src=”bottomleft.gif” alt=”"
width=”30″ height=”30″ /></div>
</div>
</body>
</html>
.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?
aសរសេរកូដ
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Translucency</title>
<meta http-equiv=”content-type”
content=”text/html; charset=iso-8859-1″ />
<link rel=”stylesheet” type=”text/css” href=”translucent.css” />
</head>
<body>
<div id=”container”>
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing …</p>
</div>
</div>
</body>
</html>

#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;
}
aMozilla browsers.
opacity: 0.6;
Internet Explorer
filter: alpha(opacity=60);
លំហាត់ទី៩ តើធ្វើយ៉ាងណា ប្រើ CSS ដើម្បីបង្ហាញអ្នកមើលអោយដឹងថាមាន link?

a
សរសេរកូដ

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>External Links</title>
<meta http-equiv=”Content-Type”
content=”text/html; charset=iso-8859-1″ />
<link rel=”stylesheet” type=”text/css” href=”external.css” />
<body>
<p>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
<a href=”foo.html”>internal</a> (within the site) or
<a href=”http://www.google.com/”>external</a> (pointing to
another site).</p>
</body>
</html>

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

<div id=”footer”>
<a href=”#”>Contact us</a> | <a href=”#”>Discussion forum</a>
</div>

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

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Pseudo-Elements</title>
<meta http-equiv=”content-type”
content=”text/html; charset=iso-8859-1″ />
<link rel=”stylesheet” type=”text/css” href=”first.css” />
</head>
<body>
<div id=”content”>
<p>This is the first of three paragraphs on the page, …</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing …</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing …</p>
</div>
</body>
</html>

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;
}
a

Related product you might see:

Share this product :

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. ទឹកអំពៅ - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger