Search code examples
htmlcssgithub-pages

Mixed Content with GitHub page


In <head> of index.html I using this links successfully on localhost:

<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Noto+Sans:400,700' rel='stylesheet' type='text/css'>

but GitHub page shows error for all this links in console ad does not shows content:

Mixed Content: The page at 'https://mypage.net/' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Noto+Sans:400,700'. This request has been blocked; the content must be served over HTTPS.

if I use:

<footer id="footer"> 
  <div class="container">
    <div class="row">
      <div class="col-xs-12 text-center">
        <p class="social">           
          <a target="_blank" href="https://www.youtube.com/channel/MyChannelID?view_as=subscriber">
            <span class="fa-stack fa-lg">
              <i class="fa fa-circle fa-stack-2x"></i>
              <i class="fa fa-youtube fa-stack-1x fa-inverse"></i>
            </span> 
          </a> 
          <a target="_blank" href="https://github.com/myGitHub">
            <span class="fa-stack fa-lg">
              <i class="fa fa-circle fa-stack-2x"></i>
              <i class="fa fa-github fa-stack-1x fa-inverse"></i>
            </span>
          </a>    
          <a target="_blank" href="https://www.facebook.com/myFacebook">
            <span class="fa-stack fa-lg">
              <i class="fa fa-circle fa-stack-2x"></i>
              <i class="fa fa-facebook fa-stack-1x fa-inverse"></i>
            </span>
          </a>
        </p>
      </div>
    </div>
  </div> 
</footer> 

Solution

  • The "s" in https stands for "secure". This means your page and your content is encrypted as it's sent over the internet. What's happening is you are calling a non-secure url (http) to load your fonts. To fix this, change the url from "http" to "https":

    https://fonts.googleapis.com/css?family=Noto+Sans:400,700