简体   繁体   English

按下CTRL + F5后应用CSS,但是在下一个动作上没有,直到我再次按CTRL + F5

[英]CSS applies after pressing CTRL + F5, but on next action it doesn't, until I press CTRL + F5 again

I am developing an web application using .NET Core. 我正在使用.NET Core开发Web应用程序。 I have a table where I have made some CSS changes. 我有一个表,我已经做了一些CSS更改。 On some html table cells <td> I have added a CSS class. 在一些html表格单元格<td>我添加了一个CSS类。

.text-right_custom {
   padding-right: 30% !important;
   text-align: right !important;
}

When I open the page, it doesn't reflect my changes. 当我打开页面时,它不会反映我的更改。 When I hit CTRL + F5, it refreshes with my CSS applied. 当我点击CTRL + F5时,它会刷新我的CSS。 But when I make another action, it gets back on first version, without my CSS applied. 但是当我做另一个动作时,它会回到第一个版本,而不会应用我的CSS。 When I hit CTRL + F5 than everything work, until next action. 当我点击CTRL + F5时,一切正常,直到下一步行动。 Something that might be useful, when I open inspect element when my CSS hasn't been applied, I see two CSS classes. 可能有用的东西,当我没有应用我的CSS时打开inspect元素时,我看到两个CSS类。 Can anyone help me solve this? 谁能帮我解决这个问题?

在此输入图像描述

I don't know about .NET. 我不知道.NET。 But I think it's a problem with cache. 但我认为这是缓存的问题。 If you are using chrome press ctrl+shift+i(that will open up your console. At console on Network tab check the input field named "Disabled cache". When you open refresh the page keep the console open. If you use any version number on CSS then remove all the version number during the developemnt mode. Hope this helps. 如果您正在使用chrome按ctrl + shift + i(这将打开您的控制台。在网络选项卡上的控制台上检查名为“已禁用缓存”的输入字段。当您打开刷新页面时,请保持控制台打开。如果您使用任何版本CSS上的数字然后删除开发模式期间的所有版本号。希望这会有所帮助。

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

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