(solved)HTML & CSS linking
I have an inquiry!
So I want to know how to link both CSS and html so that when I use CSS it styles html but it's not working.I have tried but it still doesn't work.
Any help would be much appreciated.
When you make a new HTML,CSS,JS repl it automatically connects them, but if your not then the code you've written above should work (just remember to put it between and )
@Galamphin Ok, I will try that.
@ZControls_Games https://repl.it/@ZControls_Games/learning
Do you have a link to the repl?
Is the link between the <head>
tags?
First check if everything is spelled correctly.
So not href="stlye.css"
but href="style.css
.
Then, does the file exist?
If these don't work...just use a <style>
tag. It's ugly, but it works.
Try writing this then <link rel="stylesheet"href="style.css">
Could we have a link to your repl, so we can make sure? Since IIRC that is the way to do it.
@ZControls_Games It's actually a very funny mistake, just a little typo, in your code you wrote the file name as stlye.css
while it's actually style.css
Please upvote if this helps.
@TheDrone7 OMG THANKS
@ZControls_Games you're welcome lol.
Also to everyone else. It's not compulsory to put the <link>
tag inside <head>
it works even if you keep it in body. IIRC, it will apply the styles to the tags that come after it.
@TheDrone7 I have another question...How would you link javascript to html?
@ZControls_Games there's a src
attribute to the script
tag which you can use. Also, refer to w3schools for things like this. It's perfect for beginners.
@TheDrone7 I would agree, I use W3Schools a LOT, its amazing for learning new things
@LarryMoe Yh I currently use it a lot now.
You have to use a
<link href="#yourcssfile" rel="stylesheet" type="text/css">
inside the<head></head>
tag (It contains all program preferences, fonts and plugins) if you want it to look neat.@coderash kk
Awesome dude worked like a charm