What's the Difference Between // and Http or Https

I could only find answers about http and https comparison but I would like to ask: Is there any difference if I will use in code // rather than https://? (In addition to reducing the code)

For example:

<a href="//website.com">test></a>

And:

<a href="">test></a>
1

2 Answers

In a URL, // means "current protocol"; either http or https depending on which you're currently using.

Just to be crystal clear, the difference between using // rather than https:// is that the second specifies the protocol (https), whereas the first uses the current protocol (which could be http or https, like wizzwizz4 answered). See this question for more details

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest