Impact of Google Founding Choices on CLS - pagespeed

I'm trying to performance my site, but I'm still bothered with one problem.
For example, my site and these similar: https://www.imeteo.sk/clanok/streda-prinesie-teple-a-dusne-pocasie-miestami-sa-objavia-aj-intenzivnejsie-burky have PageSpped Insights Cumulative Lyout Shift 0.31.
If I look at the issues, the only issue is with the Google Funding Choices logo. CLS problem with PageSpeed Insights:
How to eliminate this problem so that it does not affect the overall CLS?

I think that the layout shift may be caused by the fact that the browser doesn't know the size of your logo image until it is loaded. So when the popup shows up, the size of image element is 0,0. Later it changes to the size of your image (after loading) - which causes the layout shift.
I would try to define the image's width and height. Add a class to your css:
.fc-header-image {
width:200px; //put your logo dimensions here
height:100px;
}
If it doesn't help, I would consider removing the logo image whatsoever. In my case, the CLS of Google Funding Choices - popup without logo - is around 0.03, which is condidered a 'good' value by core web vitals.

Related

Fit background image in Elementor section

As far as I noticed it's super popular and common problem, but all solutions that I have tried failed at the end.
I have a test-ish website: https://mojastrona.hekko.pl/baltyk-strona-glowna/
And what I can't achieve is to fit the background image to any resolution.
Here are my settings for the elementor section:
But that doesn't provide perfect image fit. It is being cut. I tried to add some solutions into .css file, that I have found on the Internet, but none of them works.
What you're trying to do is next to impossible (within reason).
Let's say your image has dimensions of 4:3. Now what happens if someone looks at your website on a 16:9 monitor? The container (and thus the image) would have to either have some blank space above and below OR to the left and right.
There are several reliable alternatives to getting what you want:
Position your image so that the most important pieces of the motive is always present (eg. "center top" so that the text in the top of the image is always visible
Add a "min height" to the parent container - the section would be the obvious choice. Playing around with VH/%-units might give you a more reliable result
Place your image as a simple image-widget instead of as a background-image. Set the width to 100%. Make sure your section is set to "Full width/no gap". Your image will now always be the full width of the screen, without being shrunk by the parent container.
Obviously #3 comes with several limits, as placing content on top of your image is made much harder.

100% Heights vs Browser Zoom

I've looked and there doesn't appear to be another post the is exactly what I am looking for, and I am on a deadline to make this work so lets see if I can explain it better.
We have one page in development on a Drupal site that uses Panels and Views Slideshow. There are a lot of absolute and fixed position elements because of where they need to be on the page. The parent div needs to have a width and height of 100% to fill the page. Keeping in mind that the point of this page is to not have scrollbars and present everything to the user no matter what screen size they are on. So I have media queries cleaning up elements where need be on certain screen sizes.
Though when a user uses their browser to zoom into the page, the elements start shifting and stacking on top of each other. I believe this is because the 100% height/width is adhering specifically to the window size and doesn't expand beyond the window when a user zooms in.
I was able to fix it by removing the 100%'s and replacing them with pixels, but this becomes an issue because if the screen isn't the correct height or width, then you have scrollbars and the user doesn't immediately see everything on the page.
Is there any JavaScript or anything that can utilize the 100% height/width and allow them to expand beyond the page, and turn on scrollbars, during Browser Zoom?
Keep in mind that if a user is zooming in, its OK for the page to spill off and scrollbars to show, but the default screen this is not allowed.
I hope this is OK to show but an example of a page that uses Javascript to scale the entire page is pretty much what I can see myself needing but don't know how.
http://www.ammunitiongroup.com/
Any help appreciated and the quicker the better of course :)
This should help. Lets you detect the browser zoom level in mordern browsers.
https://github.com/yonran/detect-zoom
Example page:
http://htmldoodads.appspot.com/dimensions.html

Weird Google chrome image bug

I can't seem to find an answer to this rather interesting problem. In google chrome, images that have a set width and/or height, either using attributes, inline styling or css styling, refuse to show up on the page on initial load. They only seem to appear after there has been some page activity. Yet, if you let the images load to their natural size they display on page load perfectly fine. The images can be seen as it works in other browsers and when inspecting elements in chrome the image is display in the popup window.
Any know how to fix this?
define what you mean by: 'after some page activity'.
You also mentioned that the it happens when you have set width AND/OR height which leads me to believe in some of your testing your ommiting width OR height so it can be calculated by the browser. if that is the case then yes the image will never look proper and the elements will have no size on initial page load UNTIL the image is downloaded, the browser inspects the image and determines the dimensions missing to create the bounding box.
Edit:
After looking at your online site, my previous comment explains the gist of it but I can see that you're setting a width of 'auto' which requires the browser to load the image first and detect the sizes. Which will cause a delayed 'reflow' in the browser rendering. Set your widths and heights otherwise they will need to calculated by the client browser. And if you have not so good pc it looks sluggish. On my system if i hard refresh with no cache sometimes i get all the thumbs and other times I don't and the delay is very noticeable.
So in short make your images always have a width AND height.
Edit:
You also have some 404 errors that can cause some latency. http://www.webpagetest.org/result/120725_0C_3N6/1/details/
Edit:
I think your only option is to load the bg image first by getting it higher up in the order of resources downloaded so it loads in as fast as possible to be rendered.
One trick might be to load the bg image in a hidden div to preload it right away so the browser downloads it first. And even if you do that you should expect to see some flash of black background while you wait for the high res shot to download and get loaded. Can't set widths and heights on background images anyways. Going further you can speed up the response time maybe by loading all the thumbnails with an AJAX call AFTER page loads so they don't even compete with the big photo shot and start downloading until the dom is fully loaded. You can even put a nice effect in there to maybe fade in the thumbnails loading or something to that effect.

Auto resize two images in a div when browser width changes

I have looked at many different peoples answers to this problem but they only account for one image.
I am having a problem with the the two images that i have placed in my header, when i resize my browser i want them to scale down with it so that they dont displace my whole site.
i have it hosted in dropbox so you can see what my problem is: https://dl.dropbox.com/u/13722201/Dorset%20Designs/home.html
also another problem im having is un attaching the footer from the bottom of the screen and putting it below the body so users have to scroll down.
p.s I attached the footer to the bottom many months ago and I forgot how to undo it.
SORRY FOR THE TERRIBLY MESSY CODE
thanks in advance
Arran, 16
Here's how I'd do it. First, style each image using CSS to have width:100% and height:auto. This makes them respond to the sizes of their containers. Lose those width and height attributes from the img tag - I'm not even sure if those are valid anymore.
Now here's where the clever part comes. Your images are 550px and 298px wide, which is roughly a 65%:35% ratio. When the header is at its most narrow point before breaking, it's about as wide as the sum of the two. So give the big image's container max-width:65%, and the small image's container div max-width:35%.
This way, when the browser window is smaller, the images scale down correspondingly - and don't become larger than they need to be when the window is wide. I tried it out on your page, and I think it worked - see if it works for you. :)

css resizing - with browser size, zooming in and screen size

I am new to css.
I wanted to know which is the best standard technique to keep the page intact even when the browser size changes, the page is zoomed in or is used for any other screen size. I have tried centering my layout using a container but it gets disturbed when the page zooms in (i know it will, but all what I want is that the elements don't go out of the screen and if possible stay in almost the same position).
So what is the best and easy standard technique in css to achieve the
Thanks for your help.
The newest, cutting-edge method is called responsive web design. It's a bit complicated, but it's looking like the way to develop for multiple screen sizes. It is especially useful for small websites.
Check out some examples here: http://mediaqueri.es/
And some more in-depth information here: http://www.alistapart.com/articles/responsive-web-design/
If you set a set size for your body element anytime the browser is re-sized nothing within the page will change.
So the CSS you want to add is as follows:
body {
width: 960px; //being the size screen you want to accommodate your site to
}
Also this may help you: Commonly used pixel sizes for webpages and their pros/cons .

Resources