gpt4 book ai didi

css - Eclipse Web 应用程序元素。引入的 CSS 属性不起作用

转载 作者:太空宇宙 更新时间:2023-11-04 14:53:09 26 4
gpt4 key购买 nike

我创建了一个新的 Web 应用程序元素。但是,如果我编辑我的 war/Sandbox_Project.csslocalhost:8080/Sandbox_Project 网页不会受到影响。例如,如果我添加一个新属性 body 和一些值,则没有任何效果。但如果我更改自动添加的示例属性,一切正常。

创建元素时自动添加。它有效。

h1 {
font-size: 2em;
font-weight: bold;
color: #777777;
margin: 40px 0px 70px;
text-align: center;
background: fuchsia; // I added it
}

.sendButton {
display: block;
font-size: 16pt;
font-style: italic; // I added it
}

我添加了这个属性,但它不起作用。

body {
background: green;
}

最佳答案

这里有一些您可以尝试的事情。

  1. 清除缓存并重试。
  2. 重命名您的 CSS 文件
  3. !important 可能值得一试。
  4. 编辑您的 CSS 文件,然后确保更改在链接到您页面的文件中
  5. 创建一个新的 css 文件,将其链接起来,然后重试。
  6. 使用 chrome 开发工具查看发生了什么。

试试这个

body{
background: #FF0 !important; // Just to see if it works.
}

开发工具步骤

  • Open Chrome dev tools (i use F12)
  • Right click on the body and click inspect element.
  • Look at the css panel to see whats going on.
  • if the background color is crossed out then something else is over-riding it
  • else it's more than likely a cache issue.
  • Rename your css file. or you can add something like this to your css something.css?this=renameIngYourCSSFile

通过尝试所有这些,您应该对正在发生的事情有所了解。

关于css - Eclipse Web 应用程序元素。引入的 CSS 属性不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17212087/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com