Sorry, this video is for subscribers only.

Click here to subscribe!

isElementCenteredInPage()

Our first CSS test doesn’t check much. Let’s do something harder. A quintessential layout problem is centering elements on the page. Can we make an assertion about that? Maybe—but maybe not. We can figure out the element’s size and location, but how can we detect the page width?

comments powered by Disqus