آخر الأخبار والمعلومات والقصص المخصّصة لمطوّري البرامج

عند تحسين الفيديو لتتوافق مع "مؤشرات أداء الويب الأساسية"، احرص على ضبط width سمات height في العلامة <video>. اعتمادًا على الموقف، يمكنك تريد أيضًا استخدام السمة poster. السمتان width و height: لمنع متغيّرات التصميم، اضبط width و height في

  • HTML
  • CSS

22 أغسطس 2024

Display images without causing layout shifts

    27 فبراير 2025

    Creating placeholders for page content can sometimes be as simple as adding a background effect to existing page elements. In this example, all list items share the same underlying HTML structure. However, the placeholders are styled with a gray

    • CSS
    • HTML
    • JavaScript

    27 فبراير 2025

    Reserve space for future page content

      27 فبراير 2025

      It is incredibly important to deliver fonts quickly: faster font delivery not only means that text will be visible to the user sooner - but it also has a large impact on whether a font causes layout shifts. If a font cannot be delivered before it is

      • HTML

      27 فبراير 2025

      Avoid layout shifts when using infinite scroll

        27 فبراير 2025

        Banners and notices that don't cause layout shifts

          27 فبراير 2025

          This carousel uses CSS scroll snap to create smooth, performant slide transitions that do not cause layout shifts. This carousel can be navigated in a variety of ways: in addition to navigation controls, it supports keyboard navigation and swiping.

          • HTML
          • JavaScript
          • CSS

          27 فبراير 2025

          Animated GIFs can be 5-20x larger than the equivalent MP4 video. However, MP4 videos can be configured to look and feel like GIFs by including the autoplay loop muted playsinline attributes on the <video> tag. In addition, to prevent layout

          • HTML

          27 فبراير 2025

          This animated footer slides-in from the bottom of the page. The effect is created by using the CSS transform property. The result is a performant animation that does not cause layout shifts.

          • CSS
          • JavaScript
          • HTML

          27 فبراير 2025

          Performant carousels

            27 فبراير 2025

            Responsive images are often implemented with the srcset attribute. The srcset attribute is a comma-separated list of image filenames and their width or density descriptors. To prevent layout shifts, set the width and height attributes on <img>

            • HTML

            27 فبراير 2025

            This infinite scroll implementation is designed to ensure that there are never any layout shifts - regardless of how long it takes the server to respond with new content. One of the most common issues with many infinite scroll implementations is

            • CSS
            • HTML
            • JavaScript

            27 فبراير 2025

            Performant Video

              27 فبراير 2025

              Sticky footers are a popular way of displaying notices. Notices placed in the footer are less likely to obscure page elements like navigation bars, branding, and banner ads. In addition, sticky footers do not cause layout shifts when they are

              • CSS
              • JavaScript
              • HTML

              27 فبراير 2025

              Modals can be used as an alternative to banner notices. Because modals get displayed on top of existing page content, they do not cause layout shifts when they are displayed. This modal grows in size to fit its contents.

              • JavaScript
              • HTML
              • CSS

              27 فبراير 2025

              Load fonts quickly

                27 فبراير 2025

                Self-hosted fonts are font files that are served from your own servers - rather than those of a third-party font provider (for example, Google Fonts). It is incredibly important to deliver fonts quickly: faster font delivery not only means that text

                • HTML

                27 فبراير 2025

                Setting the width and height attributes on <img> tags helps prevent layout shifts. This information allows the browser to reserve the correct amount of space for the image. Set the width and height attributes: The values of these attributes

                • HTML

                27 فبراير 2025