HTML中的累积布局偏移(CLS)

发布于 2025-01-28 12:03:50 字数 3490 浏览 5 评论 0原文

我在这片HTML上得到CLS,任何人都可以告诉我为什么IAM进行布局变化的原因。 IAM努力使CLS低于0.1,但没有这样做。.我猜Bootstrap类可能导致问题,但我该如何解决

<section class="page-banner Games" style="height:400px;">
  <div class="new-banner-collection-page" style="padding-bottom:1rem;">
    <div class="row" style="height:100%">
      <div class="col-md-7" style="height:100%; float:left">
        <div id="tags-new-banner" class="" style="padding-left: 32px;padding-top:17px;">

            <span class="playabe-breadcrum" max-width="100%">
                <a class="playabe-breadcrum js-track-ga" href="/" data-action="{&quot;to Page&quot;:&quot;/&quot;}" data-category="clicked bread crumb" style="display: inline;">Home</a> &gt;
            </span>

            <span class="playabe-breadcrum" max-width="100%">
                <a class="playabe-breadcrum js-track-ga" href="/search_contents/preview/games" data-action="{&quot;to Page&quot;:&quot;/search_contents/preview/games&quot;}" data-category="clicked bread crumb" style="display: inline;">Games</a> &gt;
            </span>

            <span class="playabe-breadcrum" max-width="100%">
                <a class="playabe-breadcrum js-track-ga" href="/search_contents/preview/math-games" data-action="{&quot;to Page&quot;:&quot;/search_contents/preview/math-games&quot;}" data-category="clicked bread crumb" style="display: inline;">Math Games</a> &gt;
            </span>
            <span class="playabe-breadcrum">Counting Games</span>
        </div>

        <div class="title-new-collection-page" style="">
          <h1 style="font-weight:700;">
            Counting Games for Kids
          </h1>
        </div>
             <p class="less-banner-content">
              <span>The first step to embracing math is learning to count. Children learn to identify, group and classify objects by counting. SplashLearn’s cool online counting games provide respite from the monotony of practice worksheets through colorful virtual manipulatives. Children develop a bond </span>
              <span id="js-read-more-banner-btn" onclick="readMoreFunc()" style="color:blue;">... Read more</span>
              <span id="js-read-more-banner-content" style="display:none">with numbers that will see them through advanced math in the upcoming years.</span>
             </p>
        <div class="signup-ctas-new-banner">


            <a class="new-banner-signup-link-parent" href="/parents/register#!/parent/creation">
                <button class="new-banner-signup-btn-parent">Parents, Sign Up for Free</button>
            </a>

            <a class="new-banner-signup-link-teacher" href="/teachers/register">
                <button class="new-banner-signup-btn-teacher">Teachers, Use for Free</button>
            </a>


        </div>


      </div>
      <div class="new-banner-images col-md-5" style="float:right">
            <img alt="Imge" class="" style="max-width: 100%; width: 100%;height: 100%;object-fit: contain;" src="http://localhost:8300/cms_assets/images/Common-page.jpg">
      </div>
    </div>
  </div>



</section>

I am getting CLS ON this piece of HTML can anyone tell the reason for why iam getting a layout shift. iam trying hard to get the CLS below 0.1 but failed to do so .. i guess bootstrap classes may causing the issue but how can i fix it

<section class="page-banner Games" style="height:400px;">
  <div class="new-banner-collection-page" style="padding-bottom:1rem;">
    <div class="row" style="height:100%">
      <div class="col-md-7" style="height:100%; float:left">
        <div id="tags-new-banner" class="" style="padding-left: 32px;padding-top:17px;">

            <span class="playabe-breadcrum" max-width="100%">
                <a class="playabe-breadcrum js-track-ga" href="/" data-action="{"to Page":"/"}" data-category="clicked bread crumb" style="display: inline;">Home</a> >
            </span>

            <span class="playabe-breadcrum" max-width="100%">
                <a class="playabe-breadcrum js-track-ga" href="/search_contents/preview/games" data-action="{"to Page":"/search_contents/preview/games"}" data-category="clicked bread crumb" style="display: inline;">Games</a> >
            </span>

            <span class="playabe-breadcrum" max-width="100%">
                <a class="playabe-breadcrum js-track-ga" href="/search_contents/preview/math-games" data-action="{"to Page":"/search_contents/preview/math-games"}" data-category="clicked bread crumb" style="display: inline;">Math Games</a> >
            </span>
            <span class="playabe-breadcrum">Counting Games</span>
        </div>

        <div class="title-new-collection-page" style="">
          <h1 style="font-weight:700;">
            Counting Games for Kids
          </h1>
        </div>
             <p class="less-banner-content">
              <span>The first step to embracing math is learning to count. Children learn to identify, group and classify objects by counting. SplashLearn’s cool online counting games provide respite from the monotony of practice worksheets through colorful virtual manipulatives. Children develop a bond </span>
              <span id="js-read-more-banner-btn" onclick="readMoreFunc()" style="color:blue;">... Read more</span>
              <span id="js-read-more-banner-content" style="display:none">with numbers that will see them through advanced math in the upcoming years.</span>
             </p>
        <div class="signup-ctas-new-banner">


            <a class="new-banner-signup-link-parent" href="/parents/register#!/parent/creation">
                <button class="new-banner-signup-btn-parent">Parents, Sign Up for Free</button>
            </a>

            <a class="new-banner-signup-link-teacher" href="/teachers/register">
                <button class="new-banner-signup-btn-teacher">Teachers, Use for Free</button>
            </a>


        </div>


      </div>
      <div class="new-banner-images col-md-5" style="float:right">
            <img alt="Imge" class="" style="max-width: 100%; width: 100%;height: 100%;object-fit: contain;" src="http://localhost:8300/cms_assets/images/Common-page.jpg">
      </div>
    </div>
  </div>



</section>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文