zoukankan      html  css  js  c++  java
  • 一个满屏 品 字布局 如何设计?

    需要用到的技术

    1.     元素水平居中对齐

    1)        使用margin对齐(推荐)

    2)        使用left:50%

    3)        使用text-align

    2.  元素对相对窗口定位

    1)        使用filxed(推荐)

    2)        使用absolute定位

    3)        使用html和body的width和height填?这个窗口

    3.     元素左右定位

    1)        使用float左右浮动

    2)        使用绝对定位进行左右定位(推荐)

    具体实现的代码

    html

    1 <div class="main">  
    2  <div class="wrapper-up">  
    3    <div class="div-square-up"></div>  
    4  </div>  
    5  <div class="wrapper-down">  
    6    <div class="div-square-left"></div>  
    7    <div class="div-square-right"></div>  
    8  </div>  
    9 </div>   

    css

        body{  
              height: 1200px;  
          }  
          .main {  
              position: fixed;  
              left: 0;  
              top: 0;  
              height: 100%;  
              width: 100%;  
          }  
          .wrapper-up {  
              height: 50%;  
          }  
      
          .wrapper-down {  
              height: 50%;  
              position: relative;  
          }  
          .div-square-up {  
              width: 50%;  
              margin: 0 auto;  
              border: 2px solid red;  
              height: 96%;  
              box-sizing: border-box;  
          }  
      
          .div-square-left {  
              position: absolute;  
              left: 0;  
              width: 48%;  
              height: 100%;  
              box-sizing: border-box;  
              border: 2px solid red;  
          }  
      
          .div-square-right {  
              position: absolute;  
              right: 0;  
              width: 48%;  
              height: 100%;  
              border: 2px solid red;  
              box-sizing: border-box;  
          } 
  • 相关阅读:
    ecshop简单结构
    关于dwt文件和lbi文件
    ecshop各个文件夹作用
    修改ecshop模板体会
    PHP的字符串函数
    数组的相关处理函数
    PHP连接数据库
    Headless谷歌selenium使用
    关于无界面浏览器、request模块、tesseract模块的部分笔记
    爬取某城市公交钱路--xpath过滤
  • 原文地址:https://www.cnblogs.com/guorange/p/7149999.html
Copyright © 2011-2022 走看看