右側の列のテキストの上部と左側の列の上部を同じレベルに設定する方法が見つかりません。
これが私が「すべて」を使用したコードです:
<div class="container" style="background: white">
<div class="row">
<div class="col-xs-2" style="padding: 0px; vertical-align: top; background: yellow; border-width: 0px 0px 0px 0px ;">
<h4 style="vertical-align: top; padding: 0px; background: whitesmoke; border-width: 0px 0px 0px 0px;">First Left Heading</h4>
</div>
<div class="col-xs-10">
<p th:each="paragraph : ${resumeMap.get('personal').get('interests')}" th:text="${paragraph}">default str</p>
</div>
</div>
ブートストラップが追加さ10px
にmargin-top
し、margin-bottom
要素(見出し上<h1>
への<h6>
)。したがって、テキストを上に揃えたい場合margin-top
は、最初にこれを追加する<p>
か10px
padding-top
、col-xs-10
クラスにを追加する必要があります。
例1:使用 margin-top:10px
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class="container" style="background:white">
<div class="row">
<div class="col-xs-2 bg-warning">
<h4 style="background:whitesmoke;">First Left Heading</h4>
</div>
<div class="col-xs-10 bg-info">
<p style="margin-top:10px">first paragraph</p>
<p>Second paragraph</p>
<p>Third paragraph</p>
<p>Four paragraph</p>
<p>Five paragraph</p>
</div>
</div>
</div>
例2:使用 padding-top:10px
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class="container" style="background:white">
<div class="row">
<div class="col-xs-2 bg-warning">
<h4 style="background:whitesmoke;">First Left Heading</h4>
</div>
<div class="col-xs-10 bg-info" style="padding-top:10px;">
<p>first paragraph</p>
<p>Second paragraph</p>
<p>Third paragraph</p>
<p>Four paragraph</p>
<p>Five paragraph</p>
</div>
</div>
</div>
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加