CSS:这两个部分有什么区别吗? [英] CSS: Is there any difference between these two parts?

查看:104
本文介绍了CSS:这两个部分有什么区别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么区别吗?我没有看到。第一个不工作,第二个工作。
它是同一个文件(其他文件不接触)。






如果我用 / * * / 注释第一部分将被web浏览器使用),所有的工作,但如果我评论与 / * * / 第二部分(第一部分将被web浏览器使用)



我在不同的网络浏览器上尝试过。我重置浏览器清理所有的缓存。但是...没有结果。



可能有一些实用程序可以做二进制比较吗?你能给我举个例子吗?



更新:我道歉,截图是有点误导。我在测试时只使用其中一个部分(当我测试时,其中一个部分用 / * * / 注释)。



UPDATE 2:看看这个,更全面的style.css文件:



现在看,我添加了 display:none 到原来的 #items 块。 没有影响在网络浏览器!(不要说我关于缓存,我试过不同的浏览器,不同的笔记本电脑,重新启动和清理所有的网络浏览器的缓存)。只要注意到 display:none 已添加:




像以前一样工作,像我们甚至没有写 display:none



现在让我们尝试以下操作:






它的工作原理! ( display:none 工程)

为什么?

解决方案

问题是在一个神秘的字符(在屏幕截图上的81行)。我只在代码编辑器中没有使用显示不可见字符选项。







我删除了这个角色,问题解决了。我真的不知道,这个字符(ASCII 0x8(退格))出现在这里。



感谢所有回答这个问题的人,解决方案。



UPD:我创建了相关问题,将MacBook上的0x08字符放入文本:如何使用MacBook将0x08 ascii字符?


Is there any difference? I do not see. The first doesn't work, the second works. It is the same file (other files are not touched).


If I comment with /* */ the first part (the second will be used by web-browser), all works, but if I comment with /* */ the second part (the first will be used by web-browser), nothing works.

Is it magic?

I've tried it on different web-browsers. I was resetting the browsers cleaning all their caches. But... no result.

May be there are some utilities exist that can do a binary comparison? Could you please give me examples of such programs?

UPDATE: I apologise, the screenshot is little mislead. I use only one of the parts when I do testing (one of the parts is commented with /* */ when I test).

UPDATE 2: look at this, more full part of the style.css file:
Now look, I've added display: none to the original #items block. There is no affect in the web-browsers! (do not say me about cache, I've tried on different browsers, different laptops, was reseting and cleaning all the caches of web-browsers). Just notice that display: none has been added:

All works like before, like we even didn't write display: none.

Now let's try the following:


It works! (display: none works)
Why?

解决方案

The problem was in the one mystic character (on line 81 on the screenshot). I've only been not using an option 'Show invisible characters' in my code editor.


I've removed this character and the problem was solved. I don't really know, how this character (ASCII 0x8 ("backspace")) appeared here.

Thank you all the people who responded on this question and advised different solutions.

UPD: I've created the related question, about putting 0x08 character on MacBook into a text: How can I put 0x08 ascii character using MacBook?

这篇关于CSS:这两个部分有什么区别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆