Category Archives: CSS / HTML

CSS and HTML Tech note

How to use background image for email

Put background image into table tag.

<table background=’http://uniapple.net/images/test.jpg’ ~~~~></table>

Posted in CSS / HTML, Tech Note | Tagged | Leave a comment

[HTML/CSS] How to set footer for printing

		@media screen {
			div.footer {
				display:none;
			}
		}
		@media print {
			div.footer {
				position: fixed;
				width:100%;
				text-align:center;
				bottom: 0;
			}
		}


Position : fixed = The element is positioned relative to the browser window.

Posted in CSS / HTML, Tech Note | Tagged , , | Leave a comment

Firefox & IE word-wrap, word-break

.myDiv {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
white-space: pre;
white-space: -hp-pre-wrap; /* HP Printers */
white-space: pre-line;
}
Posted in CSS / HTML, Tech Note | Tagged , , , | 1 Comment

Prevent to submit form automatically, when press enter key in single textbox in a form.

<form method=”get”>
<input type=’text’ name=”test” />
<input type=”button” value=”Submit”
onclick=”do_something()” />
</form>

Like above form that has only one text box,
type some letter in the text box and press enter key then, the form will be submit automatically.
But I need to do something before submit my form. then, How we can do?
Here is the solution ::

<form method=”get” onsubmit=’return false;’>
<input type=’text’ name=’test’ onkeypress=”if(event.keyCode==13) do_something()” />
<input¬† type=”button” value=”Submit”
onclick=”do_something()”/>
</form>
Posted in CSS / HTML | Tagged , | 4 Comments

CSS for print

<style rel=’stylesheet’ type=’text/css’ href=’style.css’ media=’print’ />

I knew above that way, but I didn’t know this way :

<style type=’text/css’>
@media print {
#testDiv {display:none}
}
</style>
Posted in CSS / HTML | Tagged , , | 1 Comment