gpt4 book ai didi

html - 如何通过媒体查询提前打破列?

转载 作者:行者123 更新时间:2023-11-28 00:11:42 25 4
gpt4 key购买 nike

我在我的元素中使用了这段代码。我希望卡片在其正常断点之前断开。我尝试在窗口大小为 700 像素时断开卡片。但它保持不变,如何做到这一点?谁能帮我?在此先感谢您的帮助:)

<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i" rel="stylesheet">
<!--jQuery library-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!--Latest compiled and minified JavaScript-->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
.card-body {
padding: 0 !important;
}
.card-content {
padding: 1.25rem;
}
</style>
</head>
<body>
<div class="row my-4">
<div class="col">
<div class="container-fluid">
<div class="row">
<div class="col-sm d-flex">
<div class="card card-body flex-fill">
<div class="card-header"><center>Education</center></div>
<div class="card-content">
<h5 class="card-title">● hello hello hello hello hello 2019</h5>
<p class="card-text"><br>blah blah blah blah blah blah blah</p>
<h5 class="card-title"> ●hello hello hello hello helooo</h5>
<p class="card-text">something...................................................</p>
<h5 class="card-title"> ● hello hello hello hello hello</h5>
<p class="card-text">sometthing here........................</p>
</div>
</div>
</div>
<div class="col-sm d-flex">
<div class="card card-body flex-fill">
<div class="card-header"><center>Traings & Online Courses</center></div>
<div class="card-content">
<h5 class="card-title">TRAINING</h5>
<p class="card-text">● .........................................................<br> ● ..............................................</p>
<h5 class="card-title">ONLINE COURSE 2015</h5>
<p class="card-text">● blah blah blah blah..... <br>
●blah blah blah blah blah.</p>
<h5 class="card-title">ONLINE COURSE 2015</h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

最佳答案

看看这个

 
.card-body {
padding: 0 !important;
}
.card-content {
padding: 1.25rem;
}
@media only screen and (max-width: 992px) {
#edu1 .card {width:700px;height:700px;background:red;}
}
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i" rel="stylesheet">
<!--jQuery library-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!--Latest compiled and minified JavaScript-->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
.card-body {
padding: 0 !important;
}
.card-content {
padding: 1.25rem;
}
</style>
</head>
<body>
<div class="row my-4">
<div class="col">
<div class="container-fluid">
<div class="row">
<div class="col-sm d-flex " id="edu1">
<div class="card card-body flex-fill">
<div class="card-header"><center>Education</center></div>
<div class="card-content">
<h5 class="card-title">● hello hello hello hello hello 2019</h5>
<p class="card-text"><br>blah blah blah blah blah blah blah</p>
<h5 class="card-title"> ●hello hello hello hello helooo</h5>
<p class="card-text">something...................................................</p>
<h5 class="card-title"> ● hello hello hello hello hello</h5>
<p class="card-text">sometthing here........................</p>
</div>
</div>
</div>
<div class="col-sm d-flex" id="edu2">
<div class="card card-body flex-fill">
<div class="card-header"><center>Traings & Online Courses</center></div>
<div class="card-content">
<h5 class="card-title">TRAINING</h5>
<p class="card-text">● .........................................................<br> ● ..............................................</p>
<h5 class="card-title">ONLINE COURSE 2015</h5>
<p class="card-text">● blah blah blah blah..... <br>
●blah blah blah blah blah.</p>
<h5 class="card-title">ONLINE COURSE 2015</h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

关于html - 如何通过媒体查询提前打破列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55361009/

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