我试图设置垂直的图标,在配置文件照片卡内的div是在中间的白色框(Div),但不知道为什么它不工作。当我将style="width: 300px; height: 300px;用于div正方形时,我可以将它集中在水平上,但不能垂直地:/有人能解释我做错了什么吗?
无论如何,除了显示器-1??有任何方法来调整引导图标的大小吗??
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div class="container-sm offset-md">
<h1 class="p-4 m-4">Nastavení profilu</h1>
<div class="row">
<div class="col">
<div class="card p-4 m-4">
Osobní údaje
<input type="text" name="name" class="form-control" placeholder="Jméno">
<input type="text" name="surname" class="form-control" placeholder="Příjmení">
<input type="email" name="email" class="form-control" placeholder="E-Mail">
<input type="date" name="name" class="form-control">
</div>
</div>
<div class="col-4">
<div class="card p-4 m-4 bg-light">
Profilová fotografie
<div class=" square text-center border display-1 m-3 bg-white mx-auto">
<i class="bi bi-person-fill align-middle justify-content-center text-secondary"></i>
</div>
<input type="file" id="customFile" name="file" hidden="">
<div class="text-center">
<button class="btn btn-success" for="customFile">Nahrát</button>
<button type="button" class="btn btn-danger">Smazat</button>
<p class="text-muted mt-3 mb-0">Poznámka: Minimální velikost 300px x 300px</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="card p-4 m-4">
Změna hesla
</div>
</div>
<div class="col">
<div class="card p-4 m-4">
Zobrazit/skrýt podrobnosti
</div>
</div>
</div>
</div>
发布于 2022-05-07 09:13:44
这是因为引导设置了vertical-align,
只需添加.bi::before, [class^="bi-"]::before, [class*=" bi-"]::before{ vertical-align:0 !important; }
.bi::before, [class^="bi-"]::before, [class*=" bi-"]::before{
vertical-align:0 !important;
}<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div class="container-sm offset-md">
<h1 class="p-4 m-4">Nastavení profilu</h1>
<div class="row">
<div class="col">
<div class="card p-4 m-4">
Osobní údaje
<input type="text" name="name" class="form-control" placeholder="Jméno">
<input type="text" name="surname" class="form-control" placeholder="Příjmení">
<input type="email" name="email" class="form-control" placeholder="E-Mail">
<input type="date" name="name" class="form-control">
</div>
</div>
<div class="col-4">
<div class="card p-4 m-4 bg-light">
Profilová fotografie
<div class=" square text-center border display-1 m-3 bg-white mx-auto">
<i class="bi bi-person-fill align-middle justify-content-center text-secondary"></i>
</div>
<input type="file" id="customFile" name="file" hidden="">
<div class="text-center">
<button class="btn btn-success" for="customFile">Nahrát</button>
<button type="button" class="btn btn-danger">Smazat</button>
<p class="text-muted mt-3 mb-0">Poznámka: Minimální velikost 300px x 300px</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="card p-4 m-4">
Změna hesla
</div>
</div>
<div class="col">
<div class="card p-4 m-4">
Zobrazit/skrýt podrobnosti
</div>
</div>
</div>
</div>
https://stackoverflow.com/questions/72149856
复制相似问题