Showing posts with label HTML XHTML. Show all posts
Showing posts with label HTML XHTML. Show all posts

Thursday, June 28, 2012

โปรแกรม ColorPic สำหรับดึงค่าสีต่าง ๆ จาก Windows

โปรแกรม ColorPic สำหรับดึงค่าสีต่าง ๆ จาก Windows เป็น Freeware

เหมาสำหรับ Web Design ครับ

Download ได้ที่นี่เลย
http://www.iconico.com/download.aspx?app=ColorPic&type=free

วิธีใช้
http://www.iconico.com/colorpic/gettingStarted.aspx

Saturday, August 8, 2009

Disable auto complete on textbox

เวลาเราสร้าง Textbox ขึ้นมาถ้าเรา Input ทาง Browser มันจะมีชื่อที่เราเคย Input ใน Textbox นั้นมา ถ้าเราไม่ต้องการให้มี List ชื่อที่เราเคยป้อนเข้าใน Textbox นั้นเราก็ Disable มันซะ ตาม code ด้านล่างเลยครับ

ASP.NET
<asp:TextBox ID="txtName" runat="server" AutoCompleteType="Disabled" ></asp:TextBox>

HTML
<input name="txtName" type="text" autocomplete="off" />

Thursday, September 18, 2008

How to disable right click (Context Menu) on object in browser

Example in picture object:
<!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> new document </title>
<script language="javascript">
function disableContextMenu(obj) {
obj.oncontextmenu = function() {
return false;
}
}
function onLoad() {
disableContextMenu(document.getElementById("Pic1"));
}
</script>
</head>
<body onload="onLoad()">
<img id="Pic1" src="Pic1.jpg" alt="Picture" />
</body>
</html>

Or use this code:
<img id="Pic1" src="Pic1.jpg" alt="Picture" onmouseover="this.oncontextmenu=function(){return false}" />

Result:


XHTML table or div height in percentage (%)

<!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>Height 100%</title>
<style type="text/css">
html {
height:100%;
}
body {
height:100%;
margin:0;
padding:0;
}
</style>
</head>
<body>
<table style="height:100%; width:100%" border="1">
<tr><td>Top</td></tr>
<tr><td>Middle</td></tr>
<tr>
<td valign="bottom">
<table style="height:80px; width:100%" border="1">
<tr><td>bottom</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>

http://apptools.com/examples/tableheight.php
http://www.webmasterworld.com/forum83/200.htm

Tuesday, September 16, 2008

Auto delete text on textbox on focus and restore text on unfocus

Code:
<!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> new document </title>
<meta name="generator" content="" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>

<body>
<input type="text" id="email" value="Your e-mail here" onfocus="if(this.value=='Your e-mail here')this.value=''"
onblur="if(this.value=='')this.value='Your e-mail here'" />
</body>

</html>

Result:

Auto select all text on textbox

Code:
<!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> new document </title>
<meta name="generator" content="" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>

<body>
<input type="text" id="email" value="Your E-mail here" onfocus="this.select()" />
</body>

</html>

Result:

Saturday, August 30, 2008

HTML CSS Box reference

Margin Border and Padding Reference


http://www.w3.org/TR/css3-box

Friday, August 29, 2008

Transparent DIV SPAN for Internet Explorer, Firefox

Style sheet:
.transparency
{
filter:alpha(opacity=60);
-moz-opacity: 0.6;
opacity: 0.6;
}

Apply code:
<div class="transparency">A transparent div.</div>
<img src="image_basic.jpg" alt="Sample" class="transparency" />

Thursday, August 21, 2008

How to vertical align the text within a text box

Use padding-top tab in CSS style.

For an example
<input type="text" style="width:140px; height:24px; padding-top:4px; font-family:Tahoma; font-size:18px" />

Result