gpt4 book ai didi

html - 如何更改 Bootstrap 中 div 标签的顺序?

转载 作者:太空宇宙 更新时间:2023-11-04 02:36:24 25 4
gpt4 key购买 nike

我想更改此 page 中的 div 标签的顺序,其中搜索按钮从左起放在第一个位置,然后是 who sectionwhen sectionwhere节。换句话说,我想颠倒部分的顺序。我只想在大(lg)屏幕上更改 div 的顺序。我无法更改 HTML 文件中 div 的位置。

我做错了什么?

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<!--<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">-->
<link href="bootstrap_Cerulean.min.css" rel="stylesheet" />
<link href="style.css" rel="stylesheet" />
<link href="responsive.css" rel="stylesheet" />
</head>

<body dir="rtl">

<div class="row">
<div class="form-group col-sm-6 col-md-3">
<h4 class="title">Where</h4>
<label>Your Destination</label>
<input type="text" class="input-text full-width" placeholder="enter a destination or hotel name">
</div>

<div class="form-group col-sm-6 col-md-4">
<h4 class="title">When</h4>
<div class="row">
<div class="col-xs-6">
<label>Check In</label>
<div class="datepicker-wrap">
<input type="text" class="input-text full-width hasDatepicker" placeholder="mm/dd/yy" id="dp1456316268201"><img class="ui-datepicker-trigger" src="images/icon/blank.png" alt="" title="">
</div>
</div>
<div class="col-xs-6">
<label>Check Out</label>
<div class="datepicker-wrap">
<input type="text" class="input-text full-width hasDatepicker" placeholder="mm/dd/yy" id="dp1456316268202"><img class="ui-datepicker-trigger" src="images/icon/blank.png" alt="" title="">
</div>
</div>
</div>
</div>

<div class="form-group col-sm-6 col-md-3">
<h4 class="title">Who</h4>
<div class="row">
<div class="col-xs-4">
<label>Rooms</label>
<div class="selector">
<select class="full-width">
<option value="1">01</option>
<option value="2">02</option>
<option value="3">03</option>
<option value="4">04</option>
</select>
<span class="custom-select full-width">01</span>
</div>
</div>
<div class="col-xs-4">
<label>Adults</label>
<div class="selector">
<select class="full-width">
<option value="1">01</option>
<option value="2">02</option>
<option value="3">03</option>
<option value="4">04</option>
</select>
<span class="custom-select full-width">01</span>
</div>
</div>
<div class="col-xs-4">
<label>Kids</label>
<div class="selector">
<select class="full-width">
<option value="1">01</option>
<option value="2">02</option>
<option value="3">03</option>
<option value="4">04</option>
</select>
<span class="custom-select full-width">01</span>
</div>
</div>
</div>
</div>

<div class="form-group col-sm-6 col-md-2 fixheight">
<label class="hidden-xs">&nbsp;</label>
<button type="submit" class="full-width icon-check animated bounce" data-animation-type="bounce" data-animation-duration="1" style="animation-duration: 1s; visibility: visible;">SEARCH NOW</button>
</div>
</div>

<script src="jquery.js"></script>
<script src="bootstrap.min.js"></script>

</body>
</html>

最佳答案

你应该查看 bootstrap 文档中的 column ordering 部分

对于您的示例,试试这个(注意 col-lg-push*col-lg-pull* 类):

<div class="row">
<div class="form-group col-sm-6 col-md-3 col-lg-push-9">
<h4 class="title">Where</h4>
<label>Your Destination</label>
<input type="text" class="input-text full-width" placeholder="enter a destination or hotel name">
</div>

<div class="form-group col-sm-6 col-md-4 col-lg-push-2">
<h4 class="title">When</h4>
<div class="row">
<div class="col-xs-6">
<label>Check In</label>
<div class="datepicker-wrap">
<input type="text" class="input-text full-width hasDatepicker" placeholder="mm/dd/yy" id="dp1456316268201"><img class="ui-datepicker-trigger" src="images/icon/blank.png" alt="" title="">
</div>
</div>
<div class="col-xs-6">
<label>Check Out</label>
<div class="datepicker-wrap">
<input type="text" class="input-text full-width hasDatepicker" placeholder="mm/dd/yy" id="dp1456316268202"><img class="ui-datepicker-trigger" src="images/icon/blank.png" alt="" title="">
</div>
</div>
</div>
</div>

<div class="form-group col-sm-6 col-md-3 col-lg-pull-5">
<h4 class="title">Who</h4>
<div class="row">
<div class="col-xs-4">
<label>Rooms</label>
<div class="selector">
<select class="full-width">
<option value="1">01</option>
<option value="2">02</option>
<option value="3">03</option>
<option value="4">04</option>
</select><span class="custom-select full-width">01</span>
</div>
</div>
<div class="col-xs-4">
<label>Adults</label>
<div class="selector">
<select class="full-width">
<option value="1">01</option>
<option value="2">02</option>
<option value="3">03</option>
<option value="4">04</option>
</select><span class="custom-select full-width">01</span>
</div>
</div>
<div class="col-xs-4">
<label>Kids</label>
<div class="selector">
<select class="full-width">
<option value="1">01</option>
<option value="2">02</option>
<option value="3">03</option>
<option value="4">04</option>
</select><span class="custom-select full-width">01</span>
</div>
</div>
</div>
</div>

<div class="form-group col-sm-6 col-md-2 col-lg-pull-10 fixheight">
<label class="hidden-xs">&nbsp;</label>
<button type="submit" class="full-width icon-check animated bounce" data-animation-type="bounce" data-animation-duration="1" style="animation-duration: 1s; visibility: visible;">SEARCH NOW</button>
</div>
</div>

关于html - 如何更改 Bootstrap 中 div 标签的顺序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35602376/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com