摘要:不做過多解釋主要是記錄一個(gè)完整的布局樣式,實(shí)現(xiàn)頁面大致三列其中左右兩列是自適應(yīng)寬度,中間固定寬度效果。
不做過多解釋:主要是記錄一個(gè)完整的布局樣式,實(shí)現(xiàn)頁面大致三列其中左右兩列是自適應(yīng)寬度,中間固定寬度效果。
不多少代碼奉上:
/******************** *公共標(biāo)簽樣式 ********************/ /********************* *main 外邊框自適應(yīng)區(qū)域 ***********************/ .main { width: 100%; min-width: 1100px; padding-bottom: 30px; box-sizing: border-box; background-color: #FFF; border-radius: 6px; box-shadow: 0px 4px 6px 0px rgba(70, 95, 106,.25); } /*title 標(biāo)題 */ .main-title { height: 36px; line-height: 36px; text-align: center; font-size: 1em; font-weight: bold; color: #263135; background-color: #d1d6da; border-top-left-radius: 6px; border-top-right-radius: 6px; } /********************* *頭部文號區(qū):70px ***********************/ .content_title { width: 100%; margin: 0 auto; text-align: center; height: 30px; padding-top: 20px; padding-bottom: 20px; line-height: 30px; } /********************** *區(qū)域塊設(shè)置 **********************/ .area { height:500px; } .area_left { float: left; width: calc(50% - 75px); height: 100%; background-color: bisque; } .area_center { float: left; width: 150px; height: 100%; background-color: black; } .area_right { float: left; width: calc(50% - 75px); height: 100%; background-color: bisque; } /************************** *footer底部區(qū)域 ***************************/ .footer { margin: 40px 0; } /* 提交 */ .submit { height: 40px; } /* 提交按鈕*/ .submit-btn { height: 40px; width: 200px; display: block; margin: 0 auto; border-radius: 5px; color: #fff; text-decoration: none; text-align: center; line-height: 40px; font-size: 1.1em; background-color: #1bbc9b; cursor: pointer; } /******************** *公共標(biāo)簽?zāi)J(rèn)屬性設(shè)置 ********************/ body { margin: 0; font-size: 15px; padding: 20px 20px 0 20px; margin-bottom: 0 !important; background-color: #f0f0f0; } input { border: none; }
?
@{ Layout = null; } DOCTYPE html> <html> <head> <meta http-equiv="x-ua-compatible" content="IE=9" /> <title>三列布局title> <link href="~/Content/css/StyleTemplate/Index.css" rel="stylesheet" /> head> <body> <div class="main"> <div class="main-title"> div> <div class="content"> <div class="content_title"> <div class="flLeft padigLeft_15"> <span class="fontBold">名稱/文號:span> <input class="int" value="發(fā)文文號001" /> div> div> <div class="area"> <div class="area_left">左邊div> <div class="area_center">中間div> <div class="area_right">右邊div> div> div> div> <div class="footer"> <div class="submit"> <a class="submit-btn" onclick="window.print()"> 流程轉(zhuǎn)交 a> div> div> body> html>
最終效果展示:
?
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/1952.html
【第一列或某兩列固定寬度,最后一列占據(jù)頁面剩余寬度(即寬度自適應(yīng))】 寫這篇文章主要是為了解決一個(gè)實(shí)際遇到的問題:左右兩列布局,左側(cè)寬度固定,右側(cè)寬度自適應(yīng)(或左中右三列布局,左側(cè)和中間寬度固定,右側(cè)寬度自適應(yīng)),當(dāng)頁面寬度變化時(shí),怎樣使右側(cè)元素中的內(nèi)容始終在頁面剩余寬度中居中顯示,將右側(cè)元素設(shè)置了text-align: center;之后,問題其實(shí)也就是怎樣讓右側(cè)元素的寬度占據(jù)頁面剩余所有寬度。...
【第一列或某兩列固定寬度,最后一列占據(jù)頁面剩余寬度(即寬度自適應(yīng))】 寫這篇文章主要是為了解決一個(gè)實(shí)際遇到的問題:左右兩列布局,左側(cè)寬度固定,右側(cè)寬度自適應(yīng)(或左中右三列布局,左側(cè)和中間寬度固定,右側(cè)寬度自適應(yīng)),當(dāng)頁面寬度變化時(shí),怎樣使右側(cè)元素中的內(nèi)容始終在頁面剩余寬度中居中顯示,將右側(cè)元素設(shè)置了text-align: center;之后,問題其實(shí)也就是怎樣讓右側(cè)元素的寬度占據(jù)頁面剩余所有寬度。...
摘要:因?yàn)槎撕鸵苿佣瞬季植町愝^大,所以我將兩端布局分開講,本文章將針對端的布局進(jìn)行講解,以下代碼只寫關(guān)鍵代碼。為了提高網(wǎng)頁性能,考慮到,表格元素盡量少用,有其他選擇的情況盡量用其他布局。 前言 此文章是 解剖CSS布局原理 的續(xù)集,之前那篇文章講的都是理論,本文章講具體的實(shí)例,根據(jù)自己對布局的理解與開發(fā)經(jīng)驗(yàn)分為以下幾類。 因?yàn)镻C端和移動端布局差異較大,所以我將兩端布局分開講,本文章將針對P...
摘要:本文概要本文將介紹如下幾種常見的布局其中實(shí)現(xiàn)三欄布局有多種方式,本文著重介紹圣杯布局和雙飛翼布局。借助等高布局正負(fù)可解決,下文會介紹雙飛翼布局特點(diǎn)同樣也是三欄布局,在圣杯布局基礎(chǔ)上進(jìn)一步優(yōu)化,解決了圣杯布局錯(cuò)亂問題,實(shí)現(xiàn)了內(nèi)容與布局的分離。 本文概要 本文將介紹如下幾種常見的布局: showImg(https://segmentfault.com/img/remote/14600000...
摘要:本文概要本文將介紹如下幾種常見的布局其中實(shí)現(xiàn)三欄布局有多種方式,本文著重介紹圣杯布局和雙飛翼布局。借助等高布局正負(fù)可解決,下文會介紹雙飛翼布局特點(diǎn)同樣也是三欄布局,在圣杯布局基礎(chǔ)上進(jìn)一步優(yōu)化,解決了圣杯布局錯(cuò)亂問題,實(shí)現(xiàn)了內(nèi)容與布局的分離。 本文概要 本文將介紹如下幾種常見的布局: showImg(https://segmentfault.com/img/remote/14600000...
閱讀 3206·2021-09-10 10:51
閱讀 3405·2021-08-31 09:38
閱讀 1689·2019-08-30 15:54
閱讀 3165·2019-08-29 17:22
閱讀 3243·2019-08-26 13:53
閱讀 1994·2019-08-26 11:59
閱讀 3310·2019-08-26 11:37
閱讀 3343·2019-08-26 10:47