为什么我的网站会自动覆盖我的 CSS 高度?
基本上,我有这个代码:
<li style = "height: 250px;"> <p>Foo</p></li>
但是,当我访问该网站时,它似乎没有改变。所以我检查了 chrome 中的元素,它说: Foo
我已正确保存并上传文件,在无缓存和隐身模式下刷新它。我也尝试过其他浏览器,但它仍然以某种方式覆盖它!
我该怎么做才能覆盖 180px
高度并将其设置为 250px
,因为我已经尝试了所有方法,但它不起作用!
Basically, I have this code:
<li style = "height: 250px;"> <p>Foo</p></li>
However, when I go to the site, it doesn't seem to change. So I inspect the element in chrome and it says this:<li style = "height: 180px;"> <p>Foo</p></li>
I have properly saved and uploaded the file, refreshed it without cache and in incognito. I have also tried other browsers, but it still overwrites it somehow!!
What can I do to overwrite the 180px
height and put make it 250px
, as I have tried everything, and it doesn't work!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最好显示您的
HTML
markup
以便更好地理解,但现在您可以像这样使用!important
:它将覆盖您的样式。
It's better if you show your
HTML
markup
for better understanding, but right now you can use!important
like this:It will override your style.
听起来像是 IDE 问题,而不是文件本身的问题。您是否尝试过其他 IDE,甚至手动 FTP 上传文件?还要确信这是正确的文件,而不是您意外上传的副本。我自己也遇到过这样的情况,只是发现我实际上是在不同的目录中上传相同的文件。
还可以尝试在顶部添加
Test
或其他内容来检查文件更改。如果也没有出现,则可以确定您的 FTP 有问题。
Sounds like an IDE problem rather than your files themselves. Did you try other IDE's or even manually FTP-upload the file? Also be positive it's the right file and not some copy you uploaded by accident. I've had this myself only to notice I was actually uploading the same file in a different directory.
Also try to add
<h1>Test</h1>
or something at the top to check your file changes. If that doesn't show up also, you can be sure there's something wrong with your FTP.