html 和 css 标签不能正常工作可能是 descender 标签?

标签 html css tags

<分区>


关闭 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/

上一篇:css - 使用 Emmet 在 Sublime Text 3 中扩展多值缩写

下一篇:javascript - 仅为智能手机加载不同的javascript

相关文章:

javascript - 切换而不是悬停函数 jQuery

html - 是否可以使用 CSS 定位 div 的第一个子元素?

java - 如何在 map View 中获得透明状态栏?

jquery - 你如何用 jquery 中的另一个标签替换 HTML 标签?

javascript - 如何创建没有名称的 "Empty"<Label> 标记

javascript - jquery nth-child 追加(dl 中的第一个和第二个 dd)麻烦

Jquery - 自动计算输入字段

css - 在 SharePoint 2010 中覆盖默认 css 的最佳方式

javascript - 自动完成仅匹配单词开头

html - 导航 Sprite 未对齐