【发布时间】:2018-04-15 16:25:36
【问题描述】:
我的测试网站是https://lilio.000webhostapp.com/
我正在尝试使 底部 上的图像转到顶部图像的 右侧 侧。我试过 margin 和 padding
您可以在下面看到我的代码。这是我走了多远的中间结果。:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>The Hot List</title>
<style>
#THL
{
font-family: Tahoma;
font-weight: bold;
color: #ffffff;
}
#HB
{
width: 596px;
background-color: #19AF52;
padding: 0.1px;
margin: -10px;
margin-bottom: 26px;
}
#PGImg
{
margin-top: 8px;
}
#PGTitle
{
margin-top: 0px;
padding: 0px;
font-family: Tahoma;
font-size: 11.50px;
font-weight: bold;
}
#PGCreator
{
margin-top: -13px;
padding: 0px;
font-family: Tahoma;
font-size: 8.75px;
color: #19AF52;
}
#PGInfo
{
margin-top: -9px;
padding: 0px;
font-family: Tahoma;
font-size: 8.50px;
color: #c9c9c9;
}
</style>
</head>
<body>
<!--Heading Bar-->
<div id="HB">
<h1 align="center" id="THL">The Hot List</h1>
</div>
<!--Programs-->
<!--PG1-->
<p></p>
<img class="PG1" id="PGImg"
href="https://www.something.com/123"
src="https://www.something.com/123.png" alt="Program 1 Image"
height="130" width="130"
style="border-color:#c9c9c9;" border="1px">
<!--PG1 Title-->
<p id="PGTitle">Hard Working (UPDA...</p>
<p id="PGCreator">CodingChamp01</p>
<p id="PGInfo">109 Votes · 49 Spin-Offs</p>
<!--PG2-->
<p></p>
<img class="PG2" id="PGImg"
href="https://www.something.com/123"
src="https://www.something.com/123.png" alt="Program 1 Image"
height="130" width="130"
style="border-color:#c9c9c9;" border="1px">
<!--PG2 Title-->
<p id="PGTitle">Hard Working (UPDA...</p>
<p id="PGCreator">CodingChamp01</p>
<p id="PGInfo">109 Votes · 49 Spin-Offs</p>
</body>
</html>
希望你能帮我解决这个问题,我会很高兴的。
【问题讨论】:
标签: html css image margin padding