I am making a website by watching this video: https://www.youtube.com/watch?v=oYRda7UtuhA&t=490s. timing: 25:10. I did as shown in the video, but the icons on the site are not displayed for me. When I add these commands, my section texts are moved to the center. and there are no icons. I looked on the Internet to solve this problem, but I did not find anything.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>InkoGreat Website - Everything about programming</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?
family=Anek+Odia:wght#100;300;500;700;800&display=swap" rel="stylesheet">
<link rel="https://cdn.jsdelivr.net/npm/#fortawesome/fontawesome-
free#5.15.4/css/fontawesome.min.css">
</head>
<body>
<section class="header">
<nav>
<img src="images/profile-logo.jpg">
<div class="nav-links">
<i class="fa-solid fa-xmark"></i>
<ul>
<li>HOME</li>
<li>ABOUT</li>
<li>COURSE</li>
<li>BLOG</li>
<li>CONTACT</li>
</ul>
</div>
<i class="fa-solid fa-bars"></i>
</nav>
<div class="text-box">
<h1>Welcome to InkoGreat's website!</h1>
<p>This site publishes useful programs for programming,
new chips, tips and much more!<br>Python/HTML/CSS/JavaScript</p>
Visit Us To Know More
</div>
</section>
</body>
</html>
Change your font-awesome cdn url to https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css. The link used by you seems to be invalid. Changing the link should solve your issue
This thing has happened multiple times to me. Most of the time, when using Edge, it does not display the icons.
This is probably a compatibility issue. So you are recommended to remove the line
<link rel="https://cdn.jsdelivr.net/npm/#fortawesome/fontawesome- free#5.15.4/css/fontawesome.min.css">. As a developer, a more recommended way is to go to https://fontawesome.com/start (The latest version of FontAwesome) and create an ID. There, you will have more customisability to your icon pack and hence, make your icon pack light. You will also be provided with an option to add a js file in the HTML file which works without any problems.
Related
I have an HTML project that I want to convert into an executable. I've managed to do so however some bits don't work well. The html basically allows me to download another executable that is in the same directory as a project. The project is something like the NVidia website where you go to download drivers etc. The downloads work just fine when I run the project in my browser however when I compile the html to an executable the download button doesn't work. my code is given below
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title></title>
<link rel="stylesheet" href="style.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght#0,100;0,900;1,100&display=swap"
rel="stylesheet"
/>
</head>
<body>
<section class="header">
<nav>
<img src="images/logo.png" />
<div class="nav-links">
<ul>
<li>HOME</li>
<li></li>
<li>ABOUT</li>
<li></li>
<li>FAQ</li>
<li></li>
<li>HELP</li>
<li></li>
<li>FORUMS</li>
<li></li>
</ul>
</div>
<div class="textboxim2">
<h5>Instrument Monitor</h5>
<p>some random text about the software etc etc</p>
<a href="./instrumentmonitor.exe" class="herobtn"
>Download Instrument monitor</a
>
</div>
</nav>
<img src="images/IM.jpg" class="instrumentmonitor" />
</section>
</body>
</html>
I've tried using a URL instead of path thinking that maybe when I compile it the path changes, but then again it works in the browser and not in the compiled html. I'm currently using 'HTML compiler' to compile my projects.
This is the code for the site I'm trying to make and there are to main problem i'm having i have to clear my web cache every time I search something and the second being that font-awesome icon wont show up
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght#100;300;400&display=swap" rel="stylesheet">
<link rel="stylesheet" href="Home.css">
<script src="https://kit.fontawesome.com/yourcode.js"></script>
</head>
<body>
<nav>
<input type="checkbox" id-"check">
<label for="check">
<i class="fa fa-bars"></i>
</label>
<label class="logo"> Logo</label>
<ul>
<li><a class="active" href="#">Home</a></li>
<li>PROJECTS</li>
<li>CONTACT</li>
</ul>
</nav>
</body>
</html>```
Regarding the Font Awesome issue, have a look at the link in your script. You have it set to a placeholder link which doesn't lead anywhere. You need to replace where it says "yourcode" with your Font Awesome account's kit code. See here: https://www.w3schools.com/icons/fontawesome5_intro.asp
I hosted a site on Github pages, and the material icons are not showing. The issue is that they are showing when I launch the index.html page from my browser (instead of going to the hosted page).
Here's the html for this part:
<head>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<link rel="stylesheet" type="text/css" href="style.css"/>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<div class="row">
<div class="col s12 m6">
<div class="card">
<div class="card-content blue-text text-darken-2">
<span class="card-title">Olivier Grech</span>
<p>Text</p>
<div><i class="material-icons">phone</i><em>Phone</em></div>
<div><i class="material-icons">email</i><em>mail</em></div>
</div>
</div>
</div>
<!--Rest of the page-->
Replace http with https and it will work:
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
If you open your developer tools(right click anywhere and click inspect, then go to the console), it would tell you whats wrong. In this case you were accessing the github page over https but were trying to load the font using http which is not considered safe and was blocked by the browser.
I have a static website and I tried adding font-awesome. I already have bootstrap and jquery.
On firefox it displays a weird symbol, on chrome it displays nothing. Resources shows the font-awesome css. But it does not show the fonts. Resources -> fonts -> does not contain a fontawesome font. I looked at the directory structure/filenames and it checks out.
<link href="../../dist/css/bootstrap.min.css" rel="stylesheet">
<link href="amara.css" rel="stylesheet">
<link rel="stylesheet" href="f-a/css/font-awesome.min.css">
<ul class="nav navbar-nav pull-right">
<li> <i class="fa fa-twitter"></i>s</li>
</ul>
Only error that I get is :
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. jquery-1.10.2.js:5374
Does anyone know what could possibly be the issue?
It is bootstrap stylesheet that is floating right and adding margin to it...
I just created this fiddle to show you what i mean
http://jsfiddle.net/fj5vj/2/
now if you add in some styles to override bootstrap you will see it now
http://jsfiddle.net/fj5vj/1/
.pull-right {float:none !important}
.navbar-nav {margin:0 !important}
And the last fiddle i removed the booptstrap style sheet just so you can see it
http://jsfiddle.net/fj5vj/3/
the following should work locally in chrome (floated to upper right):
<html>
<head>
<title>test</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
</head>
<body>
<ul class="nav navbar-nav pull-right">
<li> <i class="fa fa-twitter"></i>s</li>
</ul>
</body>
</html>
without the http: it won't work locally:
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"
I'm trying to use a CDN on Bootstrap to increase performance to my website. However when referencing the CSS directly it works whereas using the CDN doesn't.
How would I go about resolving this- my code is attached bolow. ?
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<html>
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="#">Matt's Homepage</a>
<ul class="nav">
<li class="active">Home</li>
<li>Website</li>
<li>Twitter</li>
</ul>
</div>
</div>
<div class="btn">Click Here to Visit my Blog
</div>
</html>
As others have mentioned, using a CDN is usually as easy as adding:
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"
rel="stylesheet">
into your HTML. But this doesn't work when you are loading your html from a local file.
The reason is the missing protocol. When using a CDN, it's usually a good idea not to specify the protocol, so that your browser will use either http or https depending on the protocol used to get your html in the first place.
This is important because if your server is using https, it is better to have all references using https to avoid browsers (specially IExplorer) complaining about mixing content. On the other hand, using a protocol-less URL for CDN is more cache friendly (http://encosia.com/cripple-the-google-cdns-caching-with-a-single-character/).
Unfortunately, a protocol-less URL is a bad idea if the protocol is file://. So if you are creating private HTML that will be loaded from your disk, then you should add the protocol and use the CDN like this:
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"
rel="stylesheet">
I hope this will be useful to someone...
Hi Akkatracker I appreciate your question; it helped me. You can use a CDN for Bootstrap. Here is a simple complete html example where you do not have to download bootstrap since you are linking to a public content distributed network of the css & js files.
Simple Bootstrap CDN HTML Example
<html>
<head>
<title>Bootstrap CDN Simple Example</title>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<h1> Bootstrap CDN Simple Complete HTML Example</h1>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
</body>
</html>
Please note JQuery needs to come before bootstrap.js. The order of our JavaScript libraries is significant.
Hope this helps
follow this fiddle cdn usage http://jsfiddle.net/MgcDU
css
#import url('http://twitter.github.com/bootstrap/assets/css/bootstrap.css');
.container {
margin-top: 10px;
}
html
<div class="container">
<div class="hero-unit">
<h1>Bootstrap jsFiddle Skeleton</h1>
<p>Fork this fiddle to test your Bootstrap stuff.</p>
<p>
<a class="btn btn-primary btn-large" href="http://twitter.github.com/bootstrap/index.html" target="_blank">
Learn more about Bootstrap
</a>
</p>
</div>
Make your HTML look like this:
<!DOCTYPE html>
<html>
<head>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
</head>
<body>
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="#">Matt's Homepage</a>
<ul class="nav">
<li class="active">Home</li>
<li>Blog</li>
<li>Twitter</li>
</ul>
</div>
</div>
<div class="btn">Click Here to Visit my Blog </div>
</body>
</html>
I am new to using Twitter Bootstrap as well as BootstrapCDN. I did some brief experimenting tonight and I made my site look correct, well almost, using the following 'Head'.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My Project Site</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
<!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
<!--script src="js/less-1.3.3.min.js"></script-->
<!--append ‘#!watch’ to the browser URL, then refresh the page. -->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-
combined.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js">
</script>
<!-- my custom stylesheet -->
<link href="/word/css/style.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="img/favicon.png">
</head>
So I have replaced the old style sheets with the ones provided at BootstrapCDN.com. I am not sure if it is proper to replace the existing stylesheets, but here goes to experimentation and my result is so so...
This gets everything styled almost right; well maybe its styled totally right. I am still stepping through the DOM tools to see why my modals are non-functional. I suspect my issue with the modals is the JavaScript and the fact the site was just migrated from a local folder.
Using Microsoft Ajax Content Delivery Network as Bootstrap CDN:
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Demo</title>
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.4.min.js"></script>
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h1>Bootstrap Demo</h1>
</div>
</body>
</html>