【页面布局】响应式 Gulp 中文网 第十三届蓝桥杯(Web 应用开发)线上模拟赛

【页面布局】响应式 Gulp 中文网

考试需求

  1. 在 index.html 文件 < style> 中加入下述 @media 媒体查询规则

  2. 当屏幕宽度 max-width 为 1400px 时,页面效果如下(不包括图上尺寸标记)。
    001

  3. 当屏幕宽度 max-width 为 900px 时,页面效果如下(不包括图上尺寸标记)。
    002

  4. 当屏幕宽度 max-width 为 650px 时,头部导航隐藏,并在右侧显示图标,底部列表的宽度为 100%,页面效果如下。
    003

解答:

这个响应式布局我当时写的时候心里没底,但提交检测的时候通过了,本题有多种实现方法,以下仅供参考

009

index.js:

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>gulp.js - 基于流的自动化构建工具。 | gulp.js 中文网</title>
    <link rel="stylesheet" href="css/reset.css">
    <style media="screen">
        body {
     
            font-family: "Helvetica Neue", "Helvetica", "Lucida Grande", "Arial", "Hiragino Sans GB", "Microsoft Yahei", "WenQuanYi Micro Hei", "sans-serif";
            font-weight: normal;
        }

        .container>nav {
     
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 51px;
            background-color: #CD4749;
        }

        main header {
     
            height: 427px;
            background-color: #CD4749;
            text-align: center;
        }

        main header img {
     
            margin-top: 118px;
            width: 200px;
        }

        main header h3 {
     
            color: white;
            margin-top: 16px;
            font-size: 21px;
            font-weight: 200;
        }

        main header div:last-child {
     
            margin-top: 45px;
        }

        main header span {
     
            color: #efbfbf;
            box-shadow: inset 0 0 0 2px #efbfbf;
            border-radius: 2px;
            background-color: transparent;
            padding: 10px 16px;
            font-size: 18px;
        }

        main header span:hover {
     
            color: white;
            box-shadow: inset 0 0 0 2px white;
            border-color: white;
        }

        main section {
     
            width: 1137px;
            margin: 74px auto 0;
        }


        main ul {
     
            /* overflow: hidden; */
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值