首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 ><h1></h1>标记仅部分响应

<h1></h1>标记仅部分响应
EN

Stack Overflow用户
提问于 2022-08-10 01:24:07
回答 5查看 69关注 0票数 -2

我在代码中使用的第一个h1标记与我要使用的样式一起工作,但是第二个和第三个标记不起作用。第二个标签根本没有成为标题(只是简单的小文本),第三个标签太大了。

代码语言:javascript
复制
h1 {
    color: #2B2B2B;
    white-space: normal;
    word-break: break-all;
    font-family: Georgia;
    text-align: center;
}
代码语言:javascript
复制
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <img src="Logo.png" alt:"">
    <div class="container">
        <nav>
            <ul>
                <li>About Us</li>
                <li>Services</li>
                <li>Continuing Education Courses</li>
                <li>Support Groups & Workshops</li>
                <li>First Appointment & Fees Insurance</li>
                <li>Blog</li>
                <li>Contact</li>
            </ul>
        </nav>
        <hr>
        <div class="profile-box">
            <img src="Group 1.png" alt="" align="center" width="300px" height="100px">
            <main>
                <section>
                    <h1>Grounding and Resourcing Technique Giveaway</h1>
                    <h2>
                        Being a mental health clinician can be such an empowering and rewarding role. You can change,
                        help, and nourish so many of those struggling with everyday life. Through the responsibilities
                        you take on while helping others, it’s so important to practice grounding and resourcing
                        techniques with your clients.
                    </h2>
                </section>

                <div class="child-one child" <h1>Bill Maceus, Co-Founder of XYZ is giving away a FREE handout for
                    grounding and resourcing methods.</h1>
                    <img src="Rectangle 817.png" alt="" align="left">
                    <h2>
                        Learn ways to keep your client grounded by establishing comfortability, learning breathing and
                        body awareness techniques, object-based resourcing, and so much more. This handout will help you
                        overcome some of those challenges you face daily as a mental health clinician while working with
                        clients.
                    </h2>
                    <hr>
                    <h1>Simply fill out the form below to download.</h1>
                    <h2>You will be sent a copy to your email.</h2>
                </div>
            </main>
        </div>
    </div>
</body>

EN

回答 5

Stack Overflow用户

发布于 2022-08-10 01:31:29

HTML中有一个语法错误。以下一行不完整:

<div class="child-one child"

在这一行之后的任何事情都可能产生意想不到的结果。您需要完成开始的div标记(如果这是完整的代码,也可以在某个地方关闭它)。

<div class="child-one child">

票数 1
EN

Stack Overflow用户

发布于 2022-08-10 01:34:09

使用<style>标记将css括起来。

代码语言:javascript
复制
<style>
h1 {
    color: #999999;
    white-space:normal;
    word-break: break-all;
    font-family: Georgia;
    text-align:center;
}
</style>

您也忘记了div的结束标记,尽管不完全确定要将结束标记的位置放在哪里。

代码语言:javascript
复制
<div class="child-one child"></div>
票数 0
EN

Stack Overflow用户

发布于 2022-08-10 01:55:13

如果您正在使用VS代码编辑器,如果您还没有避免这种问题和更漂亮的扩展,请安装自动关闭标记扩展,这对您查看代码的组织和容易看出出了什么问题有很大帮助。

链接:

自动关闭标记扩展- https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag

更漂亮的扩展- https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73299684

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档