Today I Learned

hashrocket A Hashrocket project

Protocol-relative URLs are now discouraged

For a long time, I've used protocol-relative URLs as a way to serve assets from a page using the same protocol (i.e. http or https) as the parent page. They look like this:

<img src="//"/>

But now that SSL is encouraged everywhere on the web, one should always use https when an asset supports it.

<img src=""/>

According to Paul Irish, <q cite="">It’s always safe to request HTTPS assets even if your site is on HTTP, however the reverse is not true.</q>

See More #html-css TILs