修复第一个 Div 并仅调整第二个 Div 的大小 - 第 2 列下的第 3 列
Fix first Div and only resize the second Div - column 3 under column 2
这实际上是一个跟进问题
实际上我想修复第一个 div 而根本不移动它
小型设备:
A column1
grade column2
column3
中型设备:
A column1 column2
grade column3
大型设备:
A column1 column2 column3
grade
并且仅根据我对原始问题的解决方案调整大小时移动其他列。
<html lang="en">
<head>
<title>Bootstrap Example</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
</head>
<body>
<div class="jumbotron text-center">
<h1>My First Bootstrap Page</h1>
<p>Resize this responsive page to see the effect!</p>
</div>
<div class="container">
<div class="row">
<div class="col-md-1">
<div class="row">
<h1>A</h1>
</div>
<div class="row">
<span>grade</span>
</div>
</div>
<div class="col-md-11">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<h3>Column 1</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<h3>Column 2</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
<div class="col-md-4 col-md-offset-0 col-sm-6 col-sm-offset-6 col-xs-12">
<h3>Column 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
您可以 flex
进行响应,它会为您处理好事情:
这里是 fiddle
和
.container>.row{
display:flex;
}
<html lang="en">
<head>
<title>Bootstrap Example</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
</head>
<body>
<div class="jumbotron text-center">
<h1>My First Bootstrap Page</h1>
<p>Resize this responsive page to see the effect!</p>
</div>
<div class="container">
<div class="row">
<div class="col-md-1 both">
<div class="row">
<h1>A</h1>
</div>
<div class="row">
<span>grade</span>
</div>
</div>
<div class="col-md-11">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<h3>Column 1</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<h3>Column 2</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
<div class="col-md-4 col-md-offset-0 col-sm-6 col-sm-offset-6 col-xs-12">
<h3>Column 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
这实际上是一个跟进问题
实际上我想修复第一个 div 而根本不移动它
小型设备:
A column1
grade column2
column3
中型设备:
A column1 column2
grade column3
大型设备:
A column1 column2 column3
grade
并且仅根据我对原始问题的解决方案调整大小时移动其他列。
<html lang="en">
<head>
<title>Bootstrap Example</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
</head>
<body>
<div class="jumbotron text-center">
<h1>My First Bootstrap Page</h1>
<p>Resize this responsive page to see the effect!</p>
</div>
<div class="container">
<div class="row">
<div class="col-md-1">
<div class="row">
<h1>A</h1>
</div>
<div class="row">
<span>grade</span>
</div>
</div>
<div class="col-md-11">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<h3>Column 1</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<h3>Column 2</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
<div class="col-md-4 col-md-offset-0 col-sm-6 col-sm-offset-6 col-xs-12">
<h3>Column 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
您可以 flex
进行响应,它会为您处理好事情:
这里是 fiddle
和
.container>.row{
display:flex;
}
<html lang="en">
<head>
<title>Bootstrap Example</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
</head>
<body>
<div class="jumbotron text-center">
<h1>My First Bootstrap Page</h1>
<p>Resize this responsive page to see the effect!</p>
</div>
<div class="container">
<div class="row">
<div class="col-md-1 both">
<div class="row">
<h1>A</h1>
</div>
<div class="row">
<span>grade</span>
</div>
</div>
<div class="col-md-11">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<h3>Column 1</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<h3>Column 2</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
<div class="col-md-4 col-md-offset-0 col-sm-6 col-sm-offset-6 col-xs-12">
<h3>Column 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>