Home Training Dreamweaver training เปลี่ยนสีให้กับ TextBox 3 Style

เปลี่ยนสีให้กับ TextBox 3 Style

อีเมล พิมพ์ PDF

เปลี่ยนสีให้กับ TextBox 3 Style อย่างเพิ่งงงกับชื่อของหัวข้อนะครับ เห็นหลายๆ คนถามถึงและมันก็มีวิธีในหารทำหลายแบบด้วยกัน แต่ทั้ง 3 ขั้นตอนนั้นก็ไม่ยากครับ เพื่อให้ง่ายผมขออธิบายด้วยโค้ดละกัน มาดูการทำกันเลย

ขั้นตอนการทำ
1. เขียน Style ใสลงใน TextBox โดยตรง

<html>
<head>
<title>แบบที่ 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
</head>
<body bgcolor="#FFFFFF">
<form name="form1" method="post" action="">
<input type="text" name="test1" style="width:110px; height:20px; font-family:Tahoma; font-size:11px; color: #FF9900 ">
<input type="submit" name="Submit" value="Submit">

</form>
</body>
</html>

2. แบบที่เรากำหนดจาก CSS Style แล้วเราเรียกใช้จาก Class

<html>
<head>
<title>แบบที่ 2</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<style type="text/css">
<!--
.color { color: #3300FF}
-->
</style>

</head>
<body bgcolor="#FFFFFF">
<form name="form1" method="post" action="">
<input type="text" name="test2">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>

3. กำหนดจากโค้ด HTML Tag

<html>
<head>
<title>แบบที่ 3</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<style type="text/css">
<!--
input {
color: #FF00FF;
}
-->
</style>

</head>
<body bgcolor="#FFFFFF">
<form name="form1" method="post" action="">
<input type="text" name="test2">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>

4. ลองนำไปใช้กันดูนะครับ ส่วนใครมีวิธีแปลกๆ ส่งมาได้ครับ

แหล่งที่มาข้อมูล  www.webthaidd.com

 
ป้ายโฆษณา

รับติดตั้งจานดาวเที่ยม กล้องวงจรปิด

เนื้อโคขุนโพนยางคำ

Login Form


Polls

ปกติใช้คอมพิวเตอร์ for ?
 

Who's Online

เรามี 3 บุคคลทั่วไป ออนไลน์

Counter

จำนวนครั้งเปิดดูบทความ : 2523649

RSS