首页 > 解决方案 > CSS文件未在浏览器中更新

问题描述

只是在学习基本的编码技能,当我在 css 文件中进行更改时,这些更改不会显示在我的浏览器中。

这是我的 index.html 代码:

<html>
   <head>
       <link ref="stylesheet" href="css/style.css?v=1.1">
   </head>

<body>
   <div class="ios-switch">
    <div class="switch-body"> 
        <div class="toggle"></div>
    </div>
    <label>iOS Switch Practice</label> 
    <input type="checkbox" name="check box">
</div>
    </body>
</html>

这是我的 style.css 文件:

*
{
   margin:0;
   padding:0;
}

.ios-switch{`enter code here`
    display: flex; 
    flex-direction: row; 
    align-items: center;
    margin: 10px 0; 
}

.ios-switch .switch-body{
    background-color: lightgray;
    border: solid 1px gray; 
    width: 96px;
    border-radius: 999px; 
}


.ios-switch .switch-body .toggle{
    width:48px; 
    height:48px;
    background-color: white;
    border-radius: 50%; 
}

最后,当我在网上查找这个问题时,有人建议去谷歌浏览器中的开发者工具,我注意到有这个错误消息:

VM25:1047 WebSocket 连接到 'ws://localhost:8125/' 失败:连接建立错误:net::ERR_CONNECTION_REFUSED

非常感谢您的时间。

标签: htmlcss

解决方案


转到 DeveloperTools (F12) 而不是设置 (F1),然后在网络首选项检查(禁用缓存(在 DevTools 打开时)-刷新页面


推荐阅读