Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Sunday, June 4, 2017

< input type=“number” > not working in IE10

IE doesn't have support for input type="number" but you can use a polyfill to make it work.
Here is the solution : http://html5please.com/#number

@reference_1_stackoverflow
<input type=“number”> not working in IE10

Sunday, May 21, 2017

HTML < ol > type Attribute

Syntax

<ol type="1|a|A|i|I"> 

Attribute Values

Value Description
1 Default. Decimal numbers (1, 2, 3, 4)
a Alphabetically ordered list, lowercase (a, b, c, d)
A Alphabetically ordered list, uppercase (A, B, C, D)
i Roman numbers, lowercase (i, ii, iii, iv)
I Roman numbers, uppercase (I, II, III, IV)
  
 
 

Saturday, November 26, 2016

Tips - CSS Layout

*{margin: 0px;} // 去缝隙
header_t_l{... float:left;} // 对齐方式
header_t_r{... float:left;} // 用display:inline?
header_b{... float:left;}  // (?)<div>是block级别的
@reference_1

The Old Way - using {float: left;}{clear: left;}
The New Way - using {display: inline-block;}
@reference_2

...CSS box model中,width/height不算入padding和border...
@reference_3

img{vertical-align:middle;} //图片和input输入框水平对齐

Thursday, November 24, 2016

:nth-child & :nth-of-type

.first span:nth-child(2n+1),
.second span:nth-child(2n+1), 
.third span:nth-of-type(2n+1) { 
background-color: lime; 
}
--------------------
Responsive Table
A responsive table will display a horizontal scroll bar if the screen is too small to display the full content.
Add a container element (like <div>) with overflow-x:auto around the <table> element to make it responsive:
<div style="overflow-x:auto;">
<table>
... table content ...
</table>
</div>
------------------------
display: block;
display: inline;
display: none;
visibility: hidden;
@reference_2

position: static;
position: relative;
position: fixed;
position: absolute;
An element with position: absolute; is positioned relative to the nearest positioned ancestor (instead of positioned relative to the viewport, like fixed).
However; if an absolute positioned element has no positioned ancestors, it uses the document body, and moves along with page scrolling.
Note: A "positioned" element is one whose position is anything except static.
@reference_3

Monday, November 14, 2016

HTML Constraint Validation

HTML5 introduced a new HTML validation concept called constraint validation.
HTML constraint validation is based on:
Constraint validation HTML Input Attributes
Constraint validation CSS Pseudo Selectors
Constraint validation DOM Properties and Methods
Pseudo-class
http://www.w3schools.com/js/js_validation.asp

Wednesday, November 9, 2016

onclick=""

<img src="pin.php" id = "refresh" align="absmiddle" onclick="javascript:this.src='pin.php?tm='+Math.random()">

浏览器对图片,JS等文件会进行缓存
当浏览器访问图片的时候,浏览器会查看缓存中是否有这张图片
如果有则使用缓存图片,没有则对服务器重新发起访问
而浏览器判断是否存在缓存文件是通过文件的url进行识别的
如果url不同,浏览器就会对服务器发起新的请求
所有加上一个随机参数就能实现验证码图片的刷新
因为随机数不同,所以url就不同,所以每次浏览器都会对验证码图片发起新的访问,达到刷新验证码的功能
无论是img.src = "imgcode.php?"+Math.random();
还是imgcode.php?tm="+Math.random();
都是为了不要使用浏览器中图片缓存
其中tm没有任何意思,你可以随便取你想要的名字
甚至就像第一种情况不用给名字

http://wenwen.sogou.com/z/q251179201.htm

Saturday, November 5, 2016

MIME Type

https://zhidao.baidu.com/question/306468835963644404.html
http://blog.csdn.net/gulianchao/article/details/19963955
http://www.dreamdu.com/xhtml/mime_type/

Friday, November 4, 2016

upload a file




<form enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

<input type="hidden" name="MAX_FILE_SIZE" value="32768" />

<input type="file" id="screenshot" name="screenshot" />


built-in PHP superglobal variable named $_FILES, which is similar to the $_POST superglobal we’ve used to access form data. Like $_POST, $_FILES is an array, and within it is not only the name of the uploaded file, but also some other information about the file that might prove useful.
$_FILES['screenshot']['type']

move_uploaded_file($_FILES['screenshot']['tmp_name'], $target);

@unlink($_FILES['screenshot']['tmp_name']);
The unlink() function deletes a file from the web server. We suppress its error reporting with @ in case the file upload didn't actually succeed.

(from: Head First PHP and MySQL P237/277)

Thursday, November 3, 2016

square brackets

echo '<input type="checkbox" value="' . $row['id'] . '" name="todelete[]">';The square brackets result in the creation of an array within $_POST that stores the contents of the value attribute of every checked checkbox in the form. 
 The square brackets at the end of the checkbox name automatically put the
checkbox values in an array we've named “todelete[]”.


(from: Head First PHP and MySQL P215/255)