久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術文章
文章詳情頁

CSS響應式導航原理,下圖那個具體怎么做出來的?

瀏覽:156日期:2023-02-06 10:44:58

問題描述

CSS響應式導航原理,下圖那個具體怎么做出來的?

問題解答

回答1:

原理就是利用css的媒體查詢(media query)來檢測屏幕寬度,根據屏幕寬度來改變導航的css樣式。

類似下面這樣:

@media screen and (min-width: 40em) { .nav-collapse ul li { width: 18%; }}.navbox { background: #1e9f3d; height: 40px;}.search { margin-top: 50px;}.servicePhone{ margin-top: 60px; height: 60px; line-height: 60px;}.phoneIcon { width: 10%; float: left; height: 30px; line-height: 30px; text-align: center;}.phoneNumber { width: 80%; float: left; margin-left: 10%; margin-top: -10%; line-height: 30px;}@media screen and (max-width:768px) and (min-width:640px){ .search{ float: right;} .servicePhone {float: left;} .logo{ float: left; width: 220px;} .contactInfo h6 {line-height: 20px;} .contactTit h5 { line-height: 50px;}}@media screen and (max-width: 640px){ .servicePhone { display: none;} .search { display: none;} .fixed-bottom {display: block;} .contactInfo h6 {line-height: 20px;} .contactTit h5 { line-height: 50px;} .footerBtm { margin-bottom: 100px;}}

=======================================補充線:我的下面這篇博文詳細闡述過,可以參考:

利用Responsive Nav.js插件制作響應式導航

標簽: CSS
主站蜘蛛池模板: 如东县| 莆田市| 化州市| 新泰市| 汝阳县| 乌鲁木齐市| 将乐县| 固安县| 莱阳市| 上蔡县| 彰武县| 旺苍县| 襄垣县| 沅陵县| 密山市| 厦门市| 隆德县| 稻城县| 峨山| 天祝| 井陉县| 克东县| 怀仁县| 泾源县| 云和县| 紫云| 象山县| 朝阳县| 荆州市| 宾川县| 海伦市| 鱼台县| 盐池县| 和林格尔县| 贵定县| 阆中市| 新竹市| 江山市| 会昌县| 呼玛县| 腾冲县|