zoukankan      html  css  js  c++  java
  • div垂直水平居中

    .block {
    			text-align: center;
    		}
    
    		.block:before {
    			display: inline-block;
    			height: 100%;
    			vertical-align: middle;
    			content: '';
    			margin-right: -0.25em;
    		}
    		.centered{
    			display: inline-block;
    			vertical-align: center;
    			 50%;
    		}
    		    
    
    <div class="block" style="height: 300px;">
    	    <div class="centered">
    	        <h1>haorooms案例题目</h1>
    	        <p>haorooms案例内容,haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容</p>
    	        <p>haorooms案例内容,haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容</p>
    	        <p>haorooms案例内容,haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容haorooms案例内容</p>
    	    </div>
    	</div>
    
    <table style=" 100%; height: 300px;background: blue;">
    	  <tr>
    	     <td style="text-align: center; vertical-align: middle;">
    	          Unknown stuff to be centered.
    	     </td>
    	  </tr>
    	</table>
    
  • 相关阅读:
    枚举-完美立方
    list
    undefined reference to `typeinfo for xxx 报错
    bubble排序
    Iframe跨域传值
    Iframe------父子页面传值
    LDAP 概念
    覆盖equals()要覆盖HashCode()
    HashSet和TreeSet的实现与原理
    jvm调优
  • 原文地址:https://www.cnblogs.com/caijw/p/8024726.html
Copyright © 2011-2022 走看看