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>
    
  • 相关阅读:
    swt 更新主UI线程
    java中 快捷键输入System.out.println();
    原型设计工具
    JAVA笔记
    转:java读取配置文件的几种方法
    Server Message Block
    安全标识符
    BitLocker:如何启用网络解锁
    imageX.exe
    组策略首选项
  • 原文地址:https://www.cnblogs.com/caijw/p/8024726.html
Copyright © 2011-2022 走看看