{"id":2926,"date":"2021-10-28T13:29:32","date_gmt":"2021-10-28T11:29:32","guid":{"rendered":"https:\/\/davidperezgar.com\/?p=2926"},"modified":"2024-08-04T10:46:08","modified_gmt":"2024-08-04T08:46:08","slug":"detect-elements-cls-high-web","status":"publish","type":"post","link":"https:\/\/davidperezgar.com\/en\/blog\/web-development\/detect-elements-cls-high-web\/","title":{"rendered":"Detect high CLS elements of a Web (Core Web Vitals)"},"content":{"rendered":"\n

The CLS Cumulative Layout Shift<\/strong>, or unexpected content movement, is a user-centric metric for measuring visual stability, and helps to see how many users experience changes in web layout unexpectedly.<\/p>

The CLS Cumulative Layout Shift<\/strong> is a user-centric metric for measuring visual stability, and helps to see how many users experience changes in web layout unexpectedly.\n\n\n\n

Within Web Development<\/a>, CLS is a measure that gives us Google Page Speed<\/a> and should be less than 0.1. The lower it is, the more stable the loading will be.<\/p>

.\n\n\n\n

\"medicion<\/figure>\n\n\n\n

But since this blog is development. Let’s see, because there are times when Page Speed<\/strong>, points us to a total measurement, but we want to detect where this problem is caused. Many times, it is not as intuitive as we usually put in many examples.\n\n\n\n

If we use Google Chrome, in the console, we can activate the option
Layout Shift Regions, which colors the rendering and shows us the points on the web that cause a larger CLS.<\/p>\n\n\n\n

  1. Three dots<\/li>
  2. Run Command > Show Rendering<\/li>
  3. Enable Layout Shift Regions<\/li><\/ol>.\n\n\n\n
    \"cls<\/figure><\/div>\n\n\n\n

    And to have even more information, in the console tab, we can implement this code, which will give us exact values of the elements causing such problems.<\/p>\n\n\n\n