移动端flex布局携程网首页案例制作(技术选型,搭建文件夹结构,设置视口标签以及引入初始化样式,常见flex布局思路,背景线性渐变,CSS初始化样式(公共样式,首页样式),首页代码,最终效果)

移动端flex布局携程网首页案例制作

访问地址:m.ctrip.com

技术选型

方案:采取单独制作移动页方案

技术:采取flex布局

搭建文件夹结构

设置视口标签以及引入初始化样式

禁止用户缩放,设置最大最小缩放比例为1.0

<!-- 添加了三个:禁止用户缩放,最大最小缩放为1.0 -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/index.css">

常见flex布局思路

这样可以实现居中对齐

背景线性渐变

背景渐变必须加浏览器私有前缀,起始方向可以是方位名词或者度数,如果省略默认top,一般PC端不用

CSS初始化样式

公共样式

/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */

/**
 * 1. Change the default font family in all browsers (opinionated).
 * 2. Correct the line height in all browsers.
 * 3. Prevent adjustments of font size after orientation changes in
 *    IE on Windows Phone and in iOS.
 */

/* Document
   ========================================================================== */

html {
  font-family: sans-serif; /* 1 */
  line-height: 1.15; /* 2 */
  -ms-text-size-adjust: 100%; /* 3 */
  -webkit-text-size-adjust: 100%; /* 3 */
}

/* Sections
   ========================================================================== */

/**
 * Remove the margin in all browsers (opinionated).
 */

body {
  margin: 0;
}

/**
 * Add the correct display in IE 9-.
 */

article,
aside,
footer,
header,
nav,
section {
  display: block;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

/* Grouping content
   ========================================================================== */

/**
 * Add the correct display in IE 9-.
 * 1. Add the correct display in IE.
 */

figcaption,
figure,
main { /* 1 */
  display: block;
}

/**
 * Add the correct margin in IE 8.
 */

figure {
  margin: 1em 40px;
}

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

pre {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/* Text-level semantics
   ========================================================================== */

/**
 * 1. Remove the gray background on active links in IE 10.
 * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
 */

a {
  background-color: transparent; /* 1 */
  -webkit-text-decoration-skip: objects; /* 2 */
}

/**
 * Remove the outline on focused links when they are also active or hovered
 * in all browsers (opinionated).
 */

a:active,
a:hover {
  outline-width: 0;
}

/**
 * 1. Remove the bottom border in Firefox 39-.
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */

abbr[title] {
  border-bottom: none; /* 1 */
  text-decoration: underline; /* 2 */
  text-decoration: underline dotted; /* 2 */
}

/**
 * Prevent the duplicate application of `bolder` by the next rule in Safari 6.
 */

b,
strong {
  font-weight: inherit;
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

b,
strong {
  font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

code,
kbd,
samp {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/**
 * Add the correct font style in Android 4.3-.
 */

dfn {
  font-style: italic;
}

/**
 * Add the correct background and color in IE 9-.
 */

mark {
  background-color: #ff0;
  color: #000;
}

/**
 * Add the correct font size in all browsers.
 */

small {
  font-size: 80%;
}

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* Embedded content
   ========================================================================== */

/**
 * Add the correct display in IE 9-.
 */

audio,
video {
  display: inline-block;
}

/**
 * Add the correct display in iOS 4-7.
 */

audio:not([controls]) {
  display: none;
  height: 0;
}

/**
 * Remove the border on images inside links in IE 10-.
 */

img {
  border-style: none;
}

/**
 * Hide the overflow in IE.
 */

svg:not(:root) {
  overflow: hidden;
}

/* Forms
   ========================================================================== */

/**
 * 1. Change the font styles in all browsers (opinionated).
 * 2. Remove the margin in Firefox and Safari.
 */

button,
input,
optgroup,
select,
textarea {
  font-family: sans-serif; /* 1 */
  font-size: 100%; /* 1 */
  line-height: 1.15; /* 1 */
  margin: 0; /* 2 */
}

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */

button,
input { /* 1 */
  overflow: visible;
}

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */

button,
select { /* 1 */
  text-transform: none;
}

/**
 * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
 *    controls in Android 4.
 * 2. Correct the inability to style clickable types in iOS and Safari.
 */

button,
html [type="button"], /* 1 */
[type="reset"],
[type="submit"] {
  -webkit-appearance: button; /* 2 */
}

/**
 * Remove the inner border and padding in Firefox.
 */

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/**
 * Restore the focus styles unset by the previous rule.
 */

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/**
 * Change the border, margin, and padding in all browsers (opinionated).
 */

fieldset {
  border: 1px solid #c0c0c0;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
}

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    `fieldset` elements in all browsers.
 */

legend {
  box-sizing: border-box; /* 1 */
  color: inherit; /* 2 */
  display: table; /* 1 */
  max-width: 100%; /* 1 */
  padding: 0; /* 3 */
  white-space: normal; /* 1 */
}

/**
 * 1. Add the correct display in IE 9-.
 * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */

progress {
  display: inline-block; /* 1 */
  vertical-align: baseline; /* 2 */
}

/**
 * Remove the default vertical scrollbar in IE.
 */

textarea {
  overflow: auto;
}

/**
 * 1. Add the correct box sizing in IE 10-.
 * 2. Remove the padding in IE 10-.
 */

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box; /* 1 */
  padding: 0; /* 2 */
}

/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */

[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/**
 * Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
 */

[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/* Interactive
   ========================================================================== */

/*
 * Add the correct display in IE 9-.
 * 1. Add the correct display in Edge, IE, and Firefox.
 */

details, /* 1 */
menu {
  display: block;
}

/*
 * Add the correct display in all browsers.
 */

summary {
  display: list-item;
}

/* Scripting
   ========================================================================== */

/**
 * Add the correct display in IE 9-.
 */

canvas {
  display: inline-block;
}

/**
 * Add the correct display in IE.
 */

template {
  display: none;
}

/* Hidden
   ========================================================================== */

/**
 * Add the correct display in IE 10-.
 */

[hidden] {
  display: none;
}

首页样式

body {
    /* 缩放最大/最小宽度 */
    max-width: 540px;
    min-width: 320px;
    margin: 0 auto;
    font: normal 14px/1.5 Tahoma, "Lucida Grande" , Verdana, "Microsoftrahei" ,STxihei,hei;
    color: #000;
    background: #f2f2f2;
    /* 隐藏水平滚动条 */
    overflow-x: hidden;
    /* 防止元素点击后高亮 */
    -webkit-tap-highlight-color: transparent;
}

ul{
    list-style: none;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    color: #222;
}

div {
    box-sizing: border-box;
}

/* 搜索模块 */
.search-index {
    display: flex;
    /* 固定定位,让他一直在屏幕某个位置(脱标) */
    position: fixed;
    /* 同时固定定位必须搭配两个方向的距离 */
    top: 0;
    /* 先向右移动页面的50%,再向左移动自身的50%即可实现居中(固定定位无法使用margin居中) */
    left: 50%;
    /* 兼容老版本浏览器 */
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    /* 固定的盒子必须有宽度 */
    width: 100%;
    min-width: 320px;
    max-width: 540px;
    height: 44px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}
.search {
    /* 子绝父相 */
    position: relative;
    height: 26px;
    /* 因为设置了c3的盒子模型,所以实现文字居中要减去上下边框 */
    line-height: 24px;
    border: 1px solid #ccc;
    /* 自适应缩放,同时父亲需要转换为flex */
    flex: 1;
    font-size: 12px;
    color: #666;
    margin: 7px 10px;
    padding-left: 25px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.search::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    width: 15px;
    height: 15px;
    background: url(../images/sprite.png) no-repeat -59px -279px;
    /* 上边是二倍图缩小后的位置,所以下边对应要将缩放后的长宽写上,写一个,另一个会自动缩放 */
    background-size: 104px auto;
}
.user {
    width: 44px;
    height: 44px;
    font-size: 12px;
    text-align: center;
    color: #2eaae0;
}
.user::before {
    content: "";
    display: block;
    width: 23px;
    height: 23px;
    background: url(../images/sprite.png) no-repeat -59px -194px;
    background-size: 104px auto;
    margin: 4px auto -2px;
}

/* 焦点图模块 */
.focus {
    padding-top: 44px;
}
.focus img{
    width: 100%;
}

/* 局部导航栏 */
.local-nav {
    display: flex;
    height: 64px;
    background-color: #fff;
    margin: 3px 4px;
    border-radius: 8px;
}
.local-nav li {
    flex: 1;
}
.local-nav a {
    display: flex;
    /* 主轴设置为Y轴(竖着排列) */
    flex-direction: column;
    /* 侧轴居中对其(因为是单行所以用items) */
    align-items: center;
    font-size: 12px;
}
.local-nav li [class^="local-nav-icon"]{
    width: 32px;
    height: 32px;
    margin-top: 8px;
    background: url(../images/localnav_bg.png) no-repeat 0 0;
    background-size: 32px auto;
}
.local-nav li .local-nav-icon-icon2 {
    background-position: 0 -32px;
}
.local-nav li .local-nav-icon-icon3 {
    background-position: 0 -64px;
}
.local-nav li .local-nav-icon-icon4 {
    background-position: 0 -96px;
}
.local-nav li .local-nav-icon-icon5 {
    background-position: 0 -128px;
}

/* 主导航栏 */
nav {
    overflow: hidden;
    border-radius: 8px;
    margin: 0 4px 3px;
}
.nav-common {
    display: flex;
    height: 88px;
    background-color: pink;
}
.nav-common:nth-child(1) {
    /* 前面加-webkit是浏览器私有前缀,不加可能无法生效,一般PC端不用 */
    background: -webkit-linear-gradient(left, #FA5A55, #FA994D);
}
.nav-common:nth-child(2)
{
    margin: 3px 0;
    background: -webkit-linear-gradient(left, #4B90ED, #53BCED);
}
.nav-common:nth-child(3) {
    background: -webkit-linear-gradient(left, #34C2A9, #6CD559);
}
.nav-items {
    /* 不冲突 */
    flex: 1;
    display: flex;
    flex-direction: column;
}
.nav-items a {
    flex: 1;
    text-align: center;
    line-height: 44px;
    color: #fff;
    font-size: 14px;
    text-shadow: 1px 1px rgba(0,0,0,.2);
}
.nav-items:nth-child(1) a {
    background: url(../images/hotel.png) no-repeat bottom center;
    background-size: 121px auto;
}
.nav-items a:nth-child(2) {
    border-top: solid 1px #fff;
}
/* -代表从后往前,也就是从2开始往前数(因为之前设置了c3盒子模型所以这里不会超出范围) */
.nav-items:nth-child(-n+2) {
    border-right: solid 1px #fff;
}

/* 侧导航栏 */
.subnav-entry {
    display: flex;
    border-radius: 8px;
    background-color: #fff;
    margin: 0 4px;
    flex-wrap: wrap;
    padding: 5px 0 0;
    box-shadow: 1px 1px rgba(0,0,0,.2);
}
.subnav-entry li {
    flex: 20%;
}
.subnav-entry a {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.subnav-entry-icon {
    width: 28px;
    height: 28px;
    background: url(../images/subnav-bg.png) no-repeat 0 0;
    background-size: 28px auto;
}

/* 销售模块 */
.sales-box {
    border-top: solid 1px #bbb;
    background-color: #fff;
    margin: 4px;
}
.sales-hd {
    position: relative;
    height: 44px;
    border-bottom: solid 1px #ccc;
}
.sales-hd h2{
    position: relative;
    text-indent: -999px;
    overflow: hidden;
}
.sales-hd h2::after {
    position: absolute;
    top: 7px;
    left: 20px;
    content: "";
    width: 79px;
    height: 15px;
    background: url(../images/hot.png) no-repeat 0 -20px;
    background-size: 79px auto;
}
.more {
    position: absolute;
    right: 5px;
    top: 0px;
    background: -webkit-linear-gradient(left, #FF506C, #FF6BC6);
    border-radius: 15px;
    padding: 3px 20px 3px 10px;
    color: #fff;
}
.more::after {
    content: "";
    position: absolute;
    top: 11px;
    right: 9px;
    width: 7px;
    height: 7px;
    border-top: 1px solid #fff;
    border-right: 1px solid #fff;
    /* 旋转盒子,默认顺时针,单位是deg */
    transform: rotate(45deg);
}
.row {
    display: flex;
    border-bottom: 1px solid #eee;
}
.row a {
    flex: 1;
}
.row a:nth-child(1) {
    border-right: 1px solid #eee;
}
.row a img {
    width: 100%;
}

首页代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 添加了三个:禁止用户缩放,最大最小缩放为1.0 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0">
    <title>携程旅行</title>
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/index.css">
</head>
<body>
    <!-- 顶部搜索 -->
    <div class="search-index">
        <div class="search">搜索:目的地/酒店/旅游/嘿嘿嘿</div>
        <a href="#" class="user">我 的</a>
    </div>
    <!-- 焦点图模块 -->
    <div class="focus">
        <img src="upload/focus.jpg" alt="">
    </div>
    <!-- 局部导航栏 -->
    <ul class="local-nav">
        <li>
            <a href="#" title="景点·玩乐">
                <span class="local-nav-icon-icon1"></span>
                <span>景点·玩乐</span>
            </a>
        </li>
        <li>
            <a href="#" title="周边游">
                <span class="local-nav-icon-icon2"></span>
                <span>周边游</span>
            </a>
        </li>
        <li>
            <a href="#" title="美食林">
                <span class="local-nav-icon-icon3"></span>
                <span>美食林</span>
            </a>
        </li>
        <li>
            <a href="#" title="一日游">
                <span class="local-nav-icon-icon4"></span>
                <span>一日游</span>
            </a>
        </li>
        <li>
            <a href="#" title="当地攻略">
                <span class="local-nav-icon-icon5"></span>
                <span>当地攻略</span>
            </a>
        </li>
    </ul>
    <!-- 主导航栏 -->
    <nav>
        <div class="nav-common">
            <div class="nav-items">
                <a href="#">海外酒店</a>
            </div>
            <div class="nav-items">
                <a href="#">海外酒店</a>
                <a href="#">特价酒店</a>
            </div>
            <div class="nav-items">
                <a href="#">海外酒店</a>
                <a href="#">特价酒店</a>
            </div>
        </div>
        <div class="nav-common">
            <div class="nav-items">
                <a href="#">海外酒店</a>
            </div>
            <div class="nav-items">
                <a href="#">海外酒店</a>
                <a href="#">特价酒店</a>
            </div>
            <div class="nav-items">
                <a href="#">海外酒店</a>
                <a href="#">特价酒店</a>
            </div>
        </div>
        <div class="nav-common">
            <div class="nav-items">
                <a href="#">海外酒店</a>
            </div>
            <div class="nav-items">
                <a href="#">海外酒店</a>
                <a href="#">特价酒店</a>
            </div>
            <div class="nav-items">
                <a href="#">海外酒店</a>
                <a href="#">特价酒店</a>
            </div>
        </div>
    </nav>
    <!-- 侧导航栏 -->
    <ul class="subnav-entry">
        <li>
            <a href="#">
                <span class="subnav-entry-icon"></span>
                <span>话费</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon"></span>
                <span>话费</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon"></span>
                <span>话费</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon"></span>
                <span>话费</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon"></span>
                <span>话费</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon"></span>
                <span>话费</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon"></span>
                <span>话费</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon"></span>
                <span>话费</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon"></span>
                <span>话费</span>
            </a>
        </li>
        <li>
            <a href="#">
                <span class="subnav-entry-icon"></span>
                <span>话费</span>
            </a>
        </li>
    </ul>
    <!-- 销售模块 -->
    <div class="sales-box">
        <div class="sales-hd">
            <h2>热门活动</h2>
            <a href="#" class="more">获取更多福利</a>
        </div>
        <div class="sales-bd">
            <div class="row">
                <a href="#">
                    <img src="upload/pic1.jpg" alt="">
                </a>
                <a href="#">
                    <img src="upload/pic2.jpg" alt="">
                </a>
            </div>
            <div class="row">
                <a href="#">
                    <img src="upload/pic3.jpg" alt="">
                </a>
                <a href="#">
                    <img src="upload/pic4.jpg" alt="">
                </a>
            </div>
            <div class="row">
                <a href="#">
                    <img src="upload/pic5.jpg" alt="">
                </a>
                <a href="#">
                    <img src="upload/pic6.jpg" alt="">
                </a>
            </div>
        </div>
    </div>
</body>
</html>

最终效果

 

携程首页flex布局-移动端
03-08
flex布局练习
移动端携程网首页制作
WangZhang_521的博客
01-18 1060
index.html文件 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- 第一步,设置标准的视口标签 --> <meta name="viewport" content="width=device-wid
移动端携程首页制作
qq_44757223的博客
04-07 3038
移动端携程首页制作 背景线性渐变
携程网首页案例制作移动端
guai_guai_guai的博客
02-07 1151
直接添加图片即可,但因为上面搜索区域是固定定位,不占据位置,下方图片某部分会被搜索区域覆盖住,因此要设置焦点图区域的padding-left使其往下方移动。搜索模块是一个固定定位,它与父亲没有关系,只与视口有关,所以设定位置为水平居中时,要以视口为标准。background:linear-gradient(起始方向,颜色1,颜色2,...);通常要设置最大宽度,最小宽度,水平居中,字体设置背景颜色以及相关初始化。伪元素添加定位之后就变成行内块元素。三个子盒子就用到了线性渐变。固定定位的盒子要有宽度。
仿携程网移动端首页
weixin_46610818的博客
03-08 964
仿携程网移动端首页 网页实现预览图: css部分: body{ max-width: 540px; min-width: 320px; background-color: #f2f2f2; margin: 0 auto; color: #000; } a{ text-decoration: none; color: white; } *{ margin: 0; padding: 0; } .search-box{
制作 携程网移动端首页
chenyiboke的博客
11-21 4092
1. 技术选型 方案: 我们采取单独制作移动页面方案 技术: 布局采取flex布局 2. 设置视口标签以及引入初始化样式 <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale...
使用flex布局编写携程网移动端首页
qq_40247817的博客
04-15 587
使用flex布局编写携程网移动端首页效果展示HTML代码index.css 效果展示 HTML代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>携程网</title&gt
移动WEB开发之flex布局--携程网首页案例制作
薛定谔的猫
11-30 714
做法:1.打开PS缩放一半 2.量出需要的图标,在css设置top和left负值 3.css中将缩放后的大小重新给就是background-size。起始方向可以是: 方位名词 或者 度数 , 如果省略默认就是top。方案:我们采取单独制作移动页面方案。要设置为主轴为y轴,侧轴居中。背景渐变必须添加浏览器私有前缀。技术:布局采取flex布局。利用属性选择器更换背景图片。sales-bd模块制作。第一个a要取消下边框。
移动WEB开发之flex布局-携程网案例
qq_46199553的博客
09-09 519
1.1 传统布局与flex布局 建议: 如果是PC端页面布局,我们还是传统布局。 如果是移动端或者不考虑兼容性问题的PC端页面布局,我们还是使用flex弹性布局 传统布局  兼容性好  布局繁琐  局限性,不能再移动端很好的布局 flex 弹性布局  操作方便,布局极为简单,移动端应用很广泛  PC 端浏览器支持情况较差  IE 11或更低版本,不支持或仅部分支持 2.1 布局原理 flex 是 flexible Box 的缩写,意为"弹性布局",用来为盒状模型提供最大的灵活性,任何一个容器
前端学习之携程网移动端首页制作
Cai_Smallwhite的博客
10-20 4580
目录1、准备工作2、搜索模块制作3、焦点图模块制作4、1.1 技术选型1.2 搭建相关文件(夹)1.3 设置视口标签以及引入初始化样式2.1 布局分析2.2 user用户小模块 1、准备工作 2、搜索模块制作 3、焦点图模块制作 4、 1.1 技术选型 方案:采取单独制作移动端页面方案 技术:布局采取flex布局 1.2 搭建相关文件(夹) 1.3 设置视口标签以及引入初始化样式 <meta name="viewport" content="width=device-width, initial-s
flex布局携程网移动端首页案例
weixin_55701027的博客
12-21 896
html + css 前端flex布局基础案例
前端移动Web第二天:Flex伸缩布局-携程首页案例.zip
04-16
携程首页代码
前端小白移动端布局总结(含四大实战项目)及笔记
01-08
那么我们正式步入正题吧,为了方便大家查阅,我把页面效果,部分源代码,以及我整理的学习笔记,以文本和xmind的格式导出了,如有需要,可以私信。 1.移动端基础 浏览器现状 国内的UC和QQ等手机浏览器都是根据...
移动端布局之动态rem的实现
01-19
动态rem 1. 首先我们先介绍当下的长度单位 px 像素 em 一个M的宽度 / 一个汉字的宽度 1em == 自身的 font-size ...vh 全称 viewport height 100vh == 视口高度 vw 全程 viewport width 100vw == ...移动端的布局一般就两
CAD布局及视口、批量打印(比例设置).doc
01-19
CAD布局及视口、批量打印(比例设置).doc
浩辰CAD快速入门教程(三十七)使用布局视口.pdf
09-30
浩辰CAD快速入门教程(三十七)使用布局视口.pdf
这是一个简单的照明材料网站,后续还会更新
最新发布
m0_64180190的博客
04-29 2369
产品中心|联系方式|新闻动态网页首页|产品中心|联系方式|新闻动态
CSS的box-shadow 用法
于坤
04-28 398
CSS的box-shadow属性是一个强大的工具,用于向框(盒子)元素添加阴影效果。它可以添加一个或多个阴影,并可以定制阴影的大小、模糊程度、颜色等。
前端科举八股文-CSS
星海拾遗
04-25 1021
BFC 块级格式化上下文,它是指页面的一块独立的渲染区域,和其他区域相互独立出来互不干扰。它可以解决外边距折叠和高度塌陷的问题。根据它的定义,可以设置position不为static,overflow不为visible,或者设置浮动都可以设置BFC。
flex布局代码, pc端一行显示2个,切换到移动端一行显示一个
07-23
你可以使用Flex布局实现在PC端一行显示两个元素,而在移动端一行只显示一个元素的效果。以下是一个示例代码: ```css .container { display: flex; flex-wrap: wrap; } .item { flex-basis: 50%; } @media ...

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
写文章

热门文章

  • 网页开发工具介绍,VS Code安装与使用和插件安装 6431
  • Matplotlib(plt.plot在图表中绘制一条线,plt.scatter绘制散点图,plt.bar绘制柱状图(条形图),plt.barh绘制横向柱状图(条形图),plt.hist绘制直方图) 5632
  • HTML简介(网页的基本组成,什么是HTML,Web标准的三大组成部分),HTML标签(HTML语法规范,标签关系),HTML结构标签(第一个HTML) 3787
  • sort函数排序 3572
  • CSS的背景(背景颜色,背景图片,背景平铺,背景图片位置,背景图片固定(图片附着),背景复合写法) 3292

分类专栏

  • 前端必修技能点 2篇
  • 《JavaScript》第三站 16篇
  • 《移动端布局》第二站 15篇
  • 《HTML5+CSS3》第一站 33篇
  • 《价值五位数的算法竞赛培训课》 11篇
  • 《算法刷题》 33篇
  • 《小技巧》 6篇
  • c++ 7篇
  • 搜索算法 1篇
  • python 27篇
  • 算法/思想 2篇
  • 排序算法 8篇
  • 经典代码 3篇
  • 南华课程 2篇
  • 理论基础 3篇
  • 蓝桥杯真题 1篇
  • 刷题 2篇
  • bfs概论+题目 4篇
  • dfs概论+题目 6篇
  • dp模型 6篇

最新评论

  • rem适配布局苏宁网移动端首页(less+rem+媒体查询)(技术选型,搭建相关文件夹结构,设置视口标签以及引入初始化样式,设置公共common.less文件,新建index.less文件)

    拼命の努力!: 行高怎么隐藏了,加上高度有问题

  • 二倍精灵图做法

    m0_61544264: 有个问题,为什么盒子宽高是18*15,精灵图缩小2倍200px,却可以在这么小的盒子里显示出来呢?

  • vscode px转换rem插件 px to rem & rpx & vw (cssrem)

    NuanXinWeiyI.: 为啥我用这个 转换的值不准确啊

  • 摹客PS插件

    Sylvianna1: 感谢博主,我下的一直是beta版一直用不了

  • 摹客PS插件

    m0_65560780: 我下载正式版的时候,说什么安全问题不让我解压表情包表情包表情包

您愿意向朋友推荐“博客详情页”吗?

  • 强烈不推荐
  • 不推荐
  • 一般般
  • 推荐
  • 强烈推荐
提交

最新文章

  • Web APIs和JS基础关联性(JS的组成、JS基础阶段以及Web APIs阶段)、API和Web API(API、Web API、API和Web API总结)
  • JavaScript简单类型与复杂类型(简单类型与复杂类型、堆和栈、简单类型的内存分配、复杂类型的内存分配、简单类型传、参复杂类型传参)
  • JavaScript内置对象(内置对象、查文档(MDN)、Math对象、日期对象、数组对象、字符串对象)
2022年123篇
2021年67篇

目录

目录

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序员shy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或 充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值

深圳SEO优化公司达州关键词排名公司青岛阿里店铺托管报价湖州设计公司网站公司莆田网站设计价格揭阳设计网站推荐清远如何制作网站哪家好益阳网络营销价格襄阳网站关键词优化多少钱宁德模板推广公司海南推广网站价格安阳百度网站优化排名推荐天门建网站推荐民治企业网站制作价格厦门网站开发报价平湖seo优化公司广安模板网站建设报价南通网站优化按天计费报价乌海推广网站价格清徐百度seo德阳建网站价格茂名网站开发哪家好黑河网站推广工具推荐赤峰百度seo哪家好垦利网站建设推荐咸阳百度网站优化报价阜阳高端网站设计推荐玉林优秀网站设计公司松原百度标王哪家好大芬网站搜索优化多少钱鹰潭网络推广报价歼20紧急升空逼退外机英媒称团队夜以继日筹划王妃复出草木蔓发 春山在望成都发生巨响 当地回应60岁老人炒菠菜未焯水致肾病恶化男子涉嫌走私被判11年却一天牢没坐劳斯莱斯右转逼停直行车网传落水者说“没让你救”系谣言广东通报13岁男孩性侵女童不予立案贵州小伙回应在美国卖三蹦子火了淀粉肠小王子日销售额涨超10倍有个姐真把千机伞做出来了近3万元金手镯仅含足金十克呼北高速交通事故已致14人死亡杨洋拄拐现身医院国产伟哥去年销售近13亿男子给前妻转账 现任妻子起诉要回新基金只募集到26元还是员工自购男孩疑遭霸凌 家长讨说法被踢出群充个话费竟沦为间接洗钱工具新的一天从800个哈欠开始单亲妈妈陷入热恋 14岁儿子报警#春分立蛋大挑战#中国投资客涌入日本东京买房两大学生合买彩票中奖一人不认账新加坡主帅:唯一目标击败中国队月嫂回应掌掴婴儿是在赶虫子19岁小伙救下5人后溺亡 多方发声清明节放假3天调休1天张家界的山上“长”满了韩国人?开封王婆为何火了主播靠辱骂母亲走红被批捕封号代拍被何赛飞拿着魔杖追着打阿根廷将发行1万与2万面值的纸币库克现身上海为江西彩礼“减负”的“试婚人”因自嘲式简历走红的教授更新简介殡仪馆花卉高于市场价3倍还重复用网友称在豆瓣酱里吃出老鼠头315晚会后胖东来又人满为患了网友建议重庆地铁不准乘客携带菜筐特朗普谈“凯特王妃P图照”罗斯否认插足凯特王妃婚姻青海通报栏杆断裂小学生跌落住进ICU恒大被罚41.75亿到底怎么缴湖南一县政协主席疑涉刑案被控制茶百道就改标签日期致歉王树国3次鞠躬告别西交大师生张立群任西安交通大学校长杨倩无缘巴黎奥运

深圳SEO优化公司 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化