โดย md040 » 14/11/2016 11:02 am
Transparency คือ ค่าความโปร่งใส ในที่นี้เป็นการปรับค่าพื้นหลังของข้อความ
ซึ่งมีค่าอยู่ระหว่าง 0 - 1 (เป็นค่าทศนิยม)
การปรับค่าความโปร่งใสพื้นหลังข้อความใน
css โดยการกำหนดที่คำสั่ง
0 คือ โปร่งใส (มองไม่เห็น)
โค้ด: เลือกทั้งหมด
<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color: red;
opacity: 0.2;
filter: Alpha(opacity=50);
}
</style>
</head>
<body>
<div>Test Opacity = 0.2</div>
</body>
</html>
ตัวอย่างผลการรัน:
- Selection_301.png (16.28 KiB) Viewed 3096 times
1 คือ ทึบแสง
โค้ด: เลือกทั้งหมด
<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color: red;
opacity: 1;
filter: Alpha(opacity=50);
}
</style>
</head>
<body>
<div>Test Opacity = 1</div>
</body>
</html>
ตัวอย่างผลการรัน:
- Selection_300.png (16.58 KiB) Viewed 3096 times
สามารถหาความรู้เพิ่มเติมได้ที่ :
>>
https://www.mindphp.com/%E0%B8%9A%E0%B8% ... 9-css.html
>>
http://www.w3schools.com/css/default.asp
[url=https://www.mindphp.com/forums/viewtopic.php?f=73&t=25773]Transparency[/url] คือ ค่าความโปร่งใส ในที่นี้เป็นการปรับค่าพื้นหลังของข้อความ
ซึ่งมีค่าอยู่ระหว่าง 0 - 1 (เป็นค่าทศนิยม)
การปรับค่าความโปร่งใสพื้นหลังข้อความใน [url=https://www.mindphp.com/%E0%B8%9A%E0%B8%97%E0%B9%80%E0%B8%A3%E0%B8%B5%E0%B8%A2%E0%B8%99%E0%B8%AD%E0%B8%AD%E0%B8%99%E0%B9%84%E0%B8%A5%E0%B8%99%E0%B9%8C/%E0%B8%9A%E0%B8%97%E0%B9%80%E0%B8%A3%E0%B8%B5%E0%B8%A2%E0%B8%99-css/2656-%E0%B8%9A%E0%B8%97%E0%B8%97%E0%B8%B5%E0%B9%88-1-%E0%B8%84%E0%B8%A7%E0%B8%B2%E0%B8%A1%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B9%80%E0%B8%9A%E0%B8%B7%E0%B9%89%E0%B8%AD%E0%B8%87%E0%B8%95%E0%B9%89%E0%B8%99%E0%B9%80%E0%B8%81%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%A7%E0%B8%81%E0%B8%B1%E0%B8%9A-css3.html]css[/url] โดยการกำหนดที่คำสั่ง
[code] opacity: ค่าตัวเลขในช่วง 0 - 1;[/code]
0 คือ โปร่งใส (มองไม่เห็น)
[code]<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color: red;
opacity: 0.2;
filter: Alpha(opacity=50);
}
</style>
</head>
<body>
<div>Test Opacity = 0.2</div>
</body>
</html>[/code]
ตัวอย่างผลการรัน:
[attachment=1]Selection_300.png[/attachment]
1 คือ ทึบแสง
[code]<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color: red;
opacity: 1;
filter: Alpha(opacity=50);
}
</style>
</head>
<body>
<div>Test Opacity = 1</div>
</body>
</html>[/code]
ตัวอย่างผลการรัน:
[attachment=0]Selection_301.png[/attachment]
สามารถหาความรู้เพิ่มเติมได้ที่ :
>> https://www.mindphp.com/%E0%B8%9A%E0%B8%97%E0%B9%80%E0%B8%A3%E0%B8%B5%E0%B8%A2%E0%B8%99%E0%B8%AD%E0%B8%AD%E0%B8%99%E0%B9%84%E0%B8%A5%E0%B8%99%E0%B9%8C/%E0%B8%9A%E0%B8%97%E0%B9%80%E0%B8%A3%E0%B8%B5%E0%B8%A2%E0%B8%99-css.html
>> http://www.w3schools.com/css/default.asp