I am trying to @import CSS file into an HTML but it does not work. I did try linking path, It is not working either.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Lesson</title>
<meta charset="utf-8">
<style rel="stylesheet">
@import url("U5.css");
</style>
</head>
<body>
<script src="assets/script/U5.js" ></script>
</body>
But this format seems working as "http:....." ;
href="http://127.0.0.1:54149/assets/pages/U5-JS.html"
Can I convert path to http so it can work? Thank you.
Docs:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
https://developer.mozilla.org/en-US/docs/Web/CSS/@import
YESSSSSS!! I finally found how to do that. i just copied HTML path and wrote it as style path. Example for HTML;
so this is the style tag after change;
So it perfectly works. I still do not know what was wrong. Thanks again all efford guys, i appreciated.
If your CSS file is in the same directory use this:
If this HTML file is at the root use:
Use https://www.w3schools.com/Tags/tag_link.asp for more information on linking to external style sheets