After declaring document mode, the following code height 100% fails to achieve the effect in IE.
1. Do not use the method commented in the header;
2. Do not use the given height.
Is there any good way? Help!
|
html,body{height:100%;}
html,body{height:100%;}
html,body{height:100%;}
html,body{height:100%;}
html,body{height:100%;}
Oh. Then there is no need for height:100%. This attribute is only effective when the parent defines the height.
You just use position:absolute;top:50%, and then adjust it according to the height: The height of the content block is written as margin-top: - content block height 1/2
Oh. Then there is no need for height:100%. This attribute is only valid when the parent defines the height.
Just position:absolute;top:50%, and then write margin-top:- content block height 1/2 according to the height of the content block
td:nth-child(odd){border-left:2px solid red}td:nth-child(even){border-left:2px solid blue}
<!DOCTYPE html><html><head><title>无标题页</title><style type="text/css">/*CSS3 nth-child() 选择器*/td:nth-child(odd){border-left:2px solid red}td:nth-child(even){border-left:2px solid blue}</style><script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script><script type="text/javascript">/*$(document).ready(function(){ $("#mytable").find("td").css("border-left", "2px solid red"); $("#mytable").find("td:odd").css("border-left", "2px solid blue");});*/</script></head><body><table id="mytable"> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr></table></body></html>
td:nth-child(odd){border-left:2px solid red}td:nth-child(even){border-left:2px solid blue}
<!DOCTYPE html><html><head><title>无标题页</title><style type="text/css">/*CSS3 nth-child() 选择器*/td:nth-child(odd){border-left:2px solid red}td:nth-child(even){border-left:2px solid blue}</style><script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script><script type="text/javascript">/*$(document).ready(function(){ $("#mytable").find("td").css("border-left", "2px solid red"); $("#mytable").find("td:odd").css("border-left", "2px solid blue");});*/</script></head><body><table id="mytable"> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr></table></body></html>