自学web前端练手——用Bootstrap实现简易版响应式页面

主要采用了Bootstrap的栅格系统、导航条、按钮组、巨幕、列表组,今晚刚学这个也太好用了吧!!
不用自己写代码只需要改成中文内容就行了O(∩_∩)O哈哈~

效果如下:

pc端显示效果如下:
自学web前端练手——用Bootstrap实现简易版响应式页面_第1张图片
调用F12点击切换设备工具栏后显示效果如下:(我自己用手机打开该页面测试过,就是下面这个效果)
自学web前端练手——用Bootstrap实现简易版响应式页面_第2张图片

代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	
	<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>

	<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
	
	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
<!-- <nav class="navbar navbar-default">导航栏灰色 -->
<nav class="navbar navbar-inverse"><!-- 导航栏黑色 -->
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">web前端开发</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">视频<span class="sr-only">(current)</span></a></li>
        <li class="dropdown"><!-- 下拉菜单 -->
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">资料 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">PPT</a></li>
            <li><a href="#">源代码</a></li>
            <li><a href="#">扩展阅读</a></li>
          </ul>
        </li>
        <li><a href="#">作业</a></li>
        <li><a href="#">讨论</a></li>
      </ul>
      <form class="navbar-form navbar-left">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search">
        </div>
        <button type="submit" class="btn btn-default">搜索</button>
      </form>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>
<div class="container">
	<div class="row">
		<div class="col-sm-9">
			<div class="jumbotron">
			  <h1>web前端开发</h1>
			  <p>Web前端开发是创建网页或APP界面呈现给用户的过程。Web前端开发技术主要包括HTML,CSS及JavaScript、JQuery以及衍生出来的各种技术、框架。本课程由高校与企业联合打造,百度前端技术学院做技术支持,将坚实的基础、实用的案例以及企业级的应用贯通交融,可以作为Web前端开发入门课程。</p>
			  <p><a class="btn btn-primary btn-lg" href="#" role="button">加入学习</a></p>
			</div>
			<!-- 详细内容 -->
			<div class="row">
				<div class="col-xs-6 col-lg-4">
					<h2>HTML</h2>
					<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia aliquam eligendi rerum placeat vel quam facere, adipisci, deserunt rem aliquid eaque! Commodi eos dolor consequatur quia vel quasi error iure?</p>
					<p><a href="#" class="btn btn-default">开始学习</a></p><!-- 按钮默认样式 -->
				</div>
				<div class="col-xs-6 col-lg-4">
					<h2>HTML</h2>
					<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia aliquam eligendi rerum placeat vel quam facere, adipisci, deserunt rem aliquid eaque! Commodi eos dolor consequatur quia vel quasi error iure?</p>
					<p><a href="#" class="btn btn-default">开始学习</a></p><!-- 按钮默认样式 -->
				</div>
				<div class="col-xs-6 col-lg-4">
					<h2>HTML</h2>
					<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia aliquam eligendi rerum placeat vel quam facere, adipisci, deserunt rem aliquid eaque! Commodi eos dolor consequatur quia vel quasi error iure?</p>
					<p><a href="#" class="btn btn-default">开始学习</a></p><!-- 按钮默认样式 -->
				</div>
				<div class="col-xs-6 col-lg-4">
					<h2>HTML</h2>
					<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia aliquam eligendi rerum placeat vel quam facere, adipisci, deserunt rem aliquid eaque! Commodi eos dolor consequatur quia vel quasi error iure?</p>
					<p><a href="#" class="btn btn-default">开始学习</a></p><!-- 按钮默认样式 -->
				</div>
				<div class="col-xs-6 col-lg-4">
					<h2>HTML</h2>
					<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia aliquam eligendi rerum placeat vel quam facere, adipisci, deserunt rem aliquid eaque! Commodi eos dolor consequatur quia vel quasi error iure?</p>
					<p><a href="#" class="btn btn-default">开始学习</a></p><!-- 按钮默认样式 -->
				</div>
				<div class="col-xs-6 col-lg-4">
					<h2>HTML</h2>
					<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia aliquam eligendi rerum placeat vel quam facere, adipisci, deserunt rem aliquid eaque! Commodi eos dolor consequatur quia vel quasi error iure?</p>
					<p><a href="#" class="btn btn-default">开始学习</a></p><!-- 按钮默认样式 -->
				</div>
			</div>
			<!-- 详细内容结束 -->
		</div>
		<div class="col-sm-3">
			<ul class="list-group">
			  <li class="list-group-item">最新公告</li>
			  <li class="list-group-item">最新讨论</li>
			  <li class="list-group-item">最新作业</li>
			</ul>
		</div>
	</div>
</div>
</body>
</html>

你可能感兴趣的:(自学web前端)