HTML中是否有NO-OP标签? [英] Is there a NO-OP tag in HTML?

查看:107
本文介绍了HTML中是否有NO-OP标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个标签,可以用来在html中标记出一个位置,然后我可以使用JQuery找到它。但是,我需要标记尽可能无用:甚至空的div和跨度可能会导致布局根据您设置的CSS规则进行更改。对于这个问题,甚至垃圾标签,HTML不明白似乎从CSS获取样式,我不认为有任何方法通过DOM遍历找到评论?



这个标签将被用来标记一段HTML的开始和结束为Ajaxed。我不想将整个块包装在div或span(我现在正在做的)中,因为这可能会影响CSS级联的方式,而且我希望html被标记为块的事实是完全的对程序员(我)是透明的。

有什么想法?

编辑:我只是想用空脚本标记。那些应该完全惰性且不可见。我会调查它

编辑:我怎么能忘记显示:无?愚蠢愚蠢

解决方案


  1. 脚本标记

  2. < a name ...>


I am looking for a tag that i can use to mark out a position in the html, which i can then find later using JQuery. However, I need the tag to be as useless as possible: even empty divs and spans can cause the layout to change depending on the CSS rules you set. For that matter, even rubbish tags that html doesn't understand seem to acquire styles from css, and I don't think there is any way to find comments via DOM traversal?

This tag will be used to mark out the start and end of a chunk of HTML to be Ajaxed. I do not want to wrap the whole chunk in a div or span (which i what i'm doing now), because this can affect how the CSS cascades and i want the fact that the html is marked out as a chunk to be completely transparent to the programmer (me).

Any ideas?

edit: I just thought of using empty script tags. Those should be completely inert and invisible. I shall look into it

edit: How could i forget about display: none? stupid stupid stupid

解决方案

  1. Script tags
  2. Anchor tags <a name...>

这篇关于HTML中是否有NO-OP标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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