2 回答
TA贡献1777条经验 获得超3个赞
只需对代码中的这两行进行以下更改:
ul {
text-align: left;
font-size: 12pt;
/*float: left;*/ /* delete this line */
display: inline-table; /* change this to inline-table */
}
然后删除外部<ul>标签,如下完整代码所示:
完整代码:
CSS:
ul {
text-align: left;
font-size: 12pt;
display: inline-table;
}
ul p {
text-decoration: underline;
}
.section {
border-radius: 10px;
border: 2px solid black;
margin: 5px;
}
.section h1 {
margin-left: 20px;
}
HTML:
<div class="section">
<h1>My Abilities</h1>
<ul>
<p>Hacking</p>
<li>Disable Alarms</li>
<li>Access Security Cameras</li>
<li>Delay Camera and Alarm response time</li>
<li>Disable Guard Pagers</li>
</ul>
<ul>
<p>Gunmanship</p>
<li>Able to handle any type of weapon, big or small</li>
<li>Resourcefull with ammo</li>
<li>Deadshot</li>
<li>Can play many roles, from Heavy to Stealth</li>
<li>Great Getaway driver</li>
<li>Fast reloader with little recoil</li>
<li>Excellent at training others</li>
<li>Military grade training</li>
</ul>
</div>
TA贡献1852条经验 获得超1个赞
这只是您是否可以使用引导程序的另一种选择。
ul {
text-align: left;
font-size: 12pt;
float: left;
display: inline;
}
ul p {
text-decoration: underline;
}
.section {
border-radius: 10px;
border: 2px solid black;
margin: 5px;
}
h1{
margin-left: 20px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<div class="content section">
<div class="row">
<h1>My Abilities</h1>
</div>
<div class="row">
<div class="col-6">
<ul>
<p>Hacking</p>
<li>Disable Alarms</li>
<li>Access Security Cameras</li>
<li>Delay Camera and Alarm response time</li>
<li>Disable Guard Pagers</li>
</ul>
</div>
<div class="col-6">
<ul>
<p>Gunmanship</p>
<li>Able to handle any type of weapon, big or small</li>
<li>Resourcefull with ammo</li>
<li>Deadshot</li>
<li>Can play many roles, from Heavy to Stealth</li>
<li>Great Getaway driver</li>
<li>Fast reloader with little recoil</li>
<li>Excellent at training others</li>
<li>Military grade training</li>
</ul>
</div>
</div>
</div>
- 2 回答
- 0 关注
- 110 浏览
添加回答
举报