I'm currently trying to integrate the weather icons. But if I embed everything and insert it into my HTML, then no icon is displayed. The following is my folder structure and the index.html.
My folder structure looks like:
css
weather-icons-wind.min.css
font
weathericons-regular-webfont.eot
weathericons-regular-webfont.svg
weathericons-regular-webfont.ttf
weathericons-regular-webfont.woff
weathericons-regular-webfont.woff2
index.html
index.html:
<!DOCTYPE html>
<html lang="de">
<head>
<title>weather</title>
<link rel="stylesheet" href="css/weather-icons-wind.min.css">
</head>
<body>
<h1>testgt</h1>
<i class="wi wi-day-sunny"></i>
</body>
You need to include the weather-icons.css file and not weather-icons-wind.css
See here, it works fine.
<!DOCTYPE html>
<html lang="de">
<head>
<title>weather</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/weather-icons/2.0.9/css/weather-icons.css">
</head>
<body>
<h1>testgt</h1>
<i class="wi wi-day-sunny"></i>
</body>
Related
I am working in VS code and I am beginner. I know how to write css in html style but css doesn´t work in external file.
My code:
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>WHY</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="style" href="style.css">
<style>
</style>
<body>
<h1>rozkaz</h1>
<p>smiech</p>
<b>haha</b>
<em>hehe</em>
<mark style="background-color: blue;">hihi</mark>
<p>Das ist <del>ein</del> kein Hund.</p>
<p>Das ist <del>ein</del> <ins>kein</ins> Hund.</p>
<sup>hoho</sup>
</body>
</html>
CSS:
h1 {
color: bisque;
}
I tried lot of tutorials but it didn´t work.
<head>
<link rel="stylesheet" href="style.css">
</head>
rel="style" should be replaced with rel="stylesheet".
also, it is better to include stylesheets inside a <head> tag
You have an error in the link tag. The rel attribute should be "stylesheet" instead of "style".
<link rel="stylesheet" href="style.css">
I am trying to change background color of a web page.
To do so I am linking style.css externally to index.html using href:
<!DOCTYPE html>
<html>
<head>
<!-- <meta charset="utf-8"> -->
<!-- <link rel="stylesheet" href="css/style.css" media=”screen”/> -->
</head>
<body>
<!-- body of...body -->
</body>
</html>
My CSS is simply:
body
{
background-color: aqua;
}
My project structure is:
Note index.html resides by itself on the project folder (freebookz), whereas style.css resides in a dedicated folder (css). Hence the reason for
href="css/style.css"
The problem is that the CSS is not linking.
I'm using Vscode and I've also tried replicating this project in Notepad++ and CSS still does not work.
I've tried force-reloading the page with SHIFT+CTRL+R to no avail.
Can someone point me to the error?
I've exhausted all attempts to make this work.
In your tag check your media attribute, instead of double quotation mark, you have used this Unicode character “”” (U+201D) .
Here is my code, paste it in your code, it would work.
<link rel="stylesheet" href="css/style.css" media="screen"/>
Let me know whether it is working or not ?
That's right, have you tried uncommenting it?
Example:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/style.css" media=”screen”/>
</head>
<body>
<!-- body of...body -->
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<p>hello this is paragraph</p>
</body>
</html>
I've spend several hours trying to figure out what's wrong with the following html.
<!DOCTYPE=html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Location Status</title>
<link rel="stylesheet" type="text/css" href="location_status.css">
<meta http-equiv="refresh" content="900">
</head>
validator w3.org tells me:
The character encoding was not declared.
End of file seen without seeing a doctype first. Expected <!DOCTYPE html>
Element head is missing a required instance of child element title
Your <!DOCTYPE html> wasn't right and you forgot to close the <html> tag.
Here's the code in the right format:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Location Status</title>
<link rel="stylesheet" type="text/css" href="location_status.css">
<meta http-equiv="refresh" content="900">
</head>
<body>
// Your page code here
</body>
</html>
You have forgotten to close your <html> tag. You should always remember to close the html tags otherwise it can create unecessary problems.
You have not used <!DOCTYPE html> correctly.
<head> requires a <title> tag which specifies the title of your page and it will appear whenever you will open your html page in the browser.
Generally <head> contains all the metadata.
You can do like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title of your page</title>
<link rel="stylesheet" type="text/css" href="yourCSSFile.css">
<meta http-equiv="refresh" content="900">
</head>
<body>
// Your Code
</body>
</html>
Hello I am trying to set an image as a background using a css file in an index.html, however I use the css declaration the image will not be displayed even if you put it on html, can you please help me figure it out, thank you
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>Solution</title>
<style>
body{
background: url("img/notarde.png")
}
</style>
</head>
<body>
HI
</body>
</html>
CssFile
body{
background: url("img/notarde.png")
}
If you have your style in <style></style> it is not needed to add the same content in a CSS file to do it.
However, if you wants to use an external CSS file you can add this line between the <head></head> :
<link rel="stylesheet" type="text/css" href="THE_PATH_OF_YOUR_FILE">
Your code works, it must be the path of the image that went wrong.
See it here
You need to include the stylesheet in the index.html file.
<link rel="stylesheet" type="text/css" href="[your css file path]">
I hope that helps :D
Have you referenced the CSS file in your HTML Page?
<link rel="stylesheet" type="text/css" href="mystyle.css">
Specify the CSS file name and path in href like href="CSS/filename.css"
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>Solution</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
HI
</body>
</html>
I have a folder with my loginform.html and a CSS subdirectory with a simple CSS file:
<!DOCTYPE HTML>
<html>
<header>
<title>Login Forms</title>
<link href="CSS/LoginForm_CSS_1.css" rel="stylesheet">
</header>
<body>
</body>
</html>
The problem is that I cannot link them, and I cannot understand why, I tried:
<link href="CSS/LoginForm_CSS_1.css" rel="stylesheet">
and
<link href="/CSS/LoginForm_CSS_1.css" rel="stylesheet">
and
<link href="../CSS/LoginForm_CSS_1.css" rel="stylesheet">
but nothing works, when I put the LoginForm_CSS_1.css file in the same directory as the html file and use <link href="LoginForm_CSS_1.css" rel="stylesheet"> everything are ok. Any idea what I am doing wrong?
<!DOCTYPE html>
<html>
<head>
<title></title>
<link href="CSS/LoginForm_CSS_1.css" rel="stylesheet">
</head>
<body>
</body>
</html>
head tag is for root, header tag should be in the body!