简体   繁体   English

Style.css 未加载

[英]Style.css not loading

As the title suggests, my style.css isn't loading.正如标题所示,我的 style.css 没有加载。 This is the head section off my html code:这是我的 html 代码的开头部分:

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Caculator</title>
    <style type="text/css" src="style.css"></style>
</head>

This is the first part off my style.css:这是我风格的第一部分。css:

button   {
    font-size: 50pt;
    font-family: Arial, Helvetica, sans-serif;
    color: grey;
    border-radius: 7pt;
    border: 1pt solid grey;
    background-color: lightgrey;
    width: 54pt;
    height: 70pt;
    margin: 2pt;
}

Does anyone know why this isn't working?有谁知道为什么这不起作用?

Edit: all my files are in the same folder, no subfolders编辑:我所有的文件都在同一个文件夹中,没有子文件夹

Try using <link href="style.css" rel="stylesheet"> instead of <style type="text/css" src="style.css"></style> .尝试使用<link href="style.css" rel="stylesheet">而不是<style type="text/css" src="style.css"></style>

add this to your head tag将此添加到您的头部标签

<link rel="stylesheet" href="style.css" />

instead of the link tag currently in yout html而不是当前在你 html 中的链接标签

Stylesheet import method try.样式表导入方法试试。

Sample: https://www.w3schools.com/tags/att_link_rel.asp样品: https://www.w3schools.com/tags/att_link_rel.asp

<link rel="stylesheet" type="text/css" href="style.css">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM