1.Using the label element allows the user to click on the text associated with the form control instead of having to click the radio button, check box, select box, etc.
2.To associate a label with another control implicitly, the control element must be within the contents of the Label element. In this case, the Label may only contain one control element. The label itself may be positioned before or after the associated control.
Example:-
<html>
<body>
// For Radio Button
<label for=”radio1″>Radio Button – Click this Label</label>
<input type=”radio” value=”Selected” name=”Radio” id=”radio1″>
// For CheckBox
<label for=”check”>Checkbox – Click this Label</label>
<input type=”checkbox” value=”Selected” name=”check” id=”check”>
</body>
</html>
Demo Link
Popularity: 15% [?]
To set the background color of the textbox, use the ‘backgroundColor’ property.
eg.
<input type="text" style='background:#fce09a' value='www.fordevs.com'>
If you want to set the background color on text focus then use the ‘onfocus’ event.
The following example illustrates you how to set the color in ‘onfocus’ event. When the texbox loses the focus then normal background color is retained.
<html>
<body>
<br><input class="searchInput" id="searchtextbox" onblur="this.style.backgroundColor='#ffffff';"
onfocus="this.style.backgroundColor='#fce09a';value=''" accesskey="s" value="[Enter your name]" name="searchtextbox" autocomplete="off"> <br>
<br>
</html>
Demo link
Popularity: 2% [?]
To make DIV position same for different resolution, we should make the div style property position to absolute.
zzz
Ex :
<div style=”position:absolute; top:100px; left:200px; background-color:Gray; font-size:12px; color:White; font-family:Arial; height:45px”>
….
….
</div>
Popularity: 1% [?]
To text over a SWF,we should use the “wmode” in object embed tab as “opaque”.By doing this we get the html text overlapping the swf content in the page at same position.
Coding :
<object classid=”clsid:d27cdb6e-ae6d-11cf-96b8-444553540000″ codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0″ width=”300″ height=”150″ id=”s” align=”middle”>
<param name=”allowScriptAccess” value=”sameDomain” />
<param name=”allowFullScreen” value=”false” />
<param name=”movie” value=”s.swf” />
<param name=”quality” value=”high” />
<param name=”bgcolor” value=”#370037″ />
<param name=”wmode” value=”opaque” />
<embed wmode=”opaque” src=”s.swf” quality=”high” bgcolor=”#370037″ width=”300″ height=”150″ name=”s” align=”middle” allowScriptAccess=”sameDomain” allowFullScreen=”false” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer” />
</object>
Demo Link
Popularity: 1% [?]