热门标签 | HotTags
当前位置:  开发笔记 > 前端 > 正文

EmptyHTMLtaginaneditabledivdisappearswhenbackspaceispressedonFirefox

如何解决《EmptyHTMLtaginaneditabledivdisappearswhenbackspaceispressedonFirefox》经验,为你挑选了1个好方法。

I'm using Firefox and I have this HTML code:

This is an empty tag : and this is this is not

When I try to delete a character by pressing the "SUPPR" or "BACKSPACE" key, it removes the for no reason.

It works on Chrome.

Check here: https://jsfiddle.net/t5jgb04y/ And then try to delete a character.



1> codtex..:

我认为在这种情况下,Firefox比Chrome更加智能,因为您无法在内使用此标记执行任何操作

使用键盘箭头或鼠标导航时,尝试在标签中插入内容- 不能。因此,基本上Firefox只是在任何更改时都删除了此类标签,因为它们根本无法使用。

现在更改为这些标记之间, 或者甚至 在这些标记之间留有空白-Firefox不会在更改后自动删除该标记,并且您现在可以导航和编辑其内容。

这是您的示例:

b {
  background-color: lightblue;
  padding: 10px;
}
This is an empty tag : and this is not

推荐阅读
author-avatar
你妈咪叫你吃饭呢
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有