<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 7 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 7 年前。
所以我正在为一个类(class)创建一个网站,但我终究无法弄清楚为什么我的 <p>
当我尝试在 css 中修改它时,标记无法正常工作。如果有人能提供帮助,那就太好了。
HTML:
<body>
<section>
<section id="pictures">
<div>
<img src="images/ritual4.jpg" id="slide" class="floatLeft" alt="This is a picture of a group of young men posing and smiling">
<script language="JavaScript">slideIt();</script>
<p>Ritual and Mills Music Mission</p>
<img src="images/ossian.jpg" alt="This is a picture of a group of dressed up men posing with an older gentleman.">
<p>Spaghetti Dinner Fall 2015</p>
</div>
</section>
<section id="main">
<h1>About Phi Mu Alpha</h1>
<hr>
<div>
<p id="text">Phi Mu Alpha Sinfonia:</p>
<p id="text1">Phi Mu Alpha Sinfonia was established on October 6th, 1898</p>
<p id="text">
Gamma Beta Chapter:
</p>
</section>
</section>
</div>
</body>
CSS:
#main h1{
text-align: center;
font-size: 28px;
}
hr{
color:#FFFFFF;
}
#main #text{
text-indent: 5%;
font-family: courier new, Georgia, Times;
padding-left: 15px;
padding-right: 15px;
font-size: 20px;
text-decoration: underline;
}
#main #text1{
text-indent: 5%;
font-family: courier new, Georgia, Times;
padding-left: 15px;
padding-right: 15px;
font-size: 16px;
text-decoration: underline;
}
body #main p{
text-indent: 8%;
font-family: courier new, Georgia, Times;
padding-left: 15px;
padding-right: 15px;
font-size: 18px;
text-decoration: underline;
}
最佳答案
老实说,您的代码一团糟。我更改了一些,但如果您想让它更整洁,我可以更改您的代码,但如果没有,请查看以下代码:
HTML:
<section id="pictures">
<div>
<img src="images/ritual4.jpg" id="slide" class="floatLeft" alt="This is a picture of a group of young men posing and smiling">
<script language="JavaScript">slideIt();</script>
<p>Ritual and Mills Music Mission</p>
<img src="images/ossian.jpg" alt="This is a picture of a group of dressed up men posing with an older gentleman.">
<p>Spaghetti Dinner Fall 2015</p>
</div>
</section>
<section id="main">
<h1>About Phi Mu Alpha</h1>
<hr>
<div>
<p id="text">Phi Mu Alpha Sinfonia:</p>
<p id="text1">Phi Mu Alpha Sinfonia was established on October 6th, 1898</p>
<p id="text">
Gamma Beta Chapter:
</p>
</div>
</section>
CSS:
hr {
color:#fff;
}
#main h1 {
text-align: center;
font-size: 2em;
}
#main p {
text-indent: 8%;
font-family: "Courier New", Georgia, Times;
padding-left: 15px;
padding-right: 15px;
font-size: 18px;
text-decoration: underline;
}
#main #text {
text-indent: 5%;
font-size: 20px;
}
#main #text1 {
text-indent: 5%;
font-size: 16px;
}
关于html 和 css 标签不能正常工作可能是 descender 标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34099411/