CSS的布局中性标签? [英] Layout-neutral tag for CSS?

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

问题描述

在HTML(4)中有一个隐形标记,可用于区分CSS。

Is there an "invisible" tag in HTML (4) that I can use to make CSS distinctions

tag.myclass tag.mysubclass h1 {  } 



without having any visual impact on the HTML rendered?

我的背景是我有一个属于不同组的表单中的区域。当我打开那些灯箱(长故事涉及DOM操作等,不是很重要)我不想依赖于通常的 div class = x span class = y 来设置后续元素的样式,因为我必须在这里重置边距,paddings有,等等。

My background is that I have areas in a form that belong to different groups. As I am opening those in lightboxes (long story involving DOM operations and such, not really important) I don't want to rely on the usual div class=x or span class=y to style the subsequent elements, as I would have to reset margins here, paddings there, and so on.

在这种情况下,我将需要一个布局中性的包装标签。

A layout-neutral wrapping tag would be just what I need in such situations.

推荐答案

不,没有。

(这是因为这样的元素不适合HTML的其余部分。 SPAN对周围区域的影响是因为它们分别是块和内联元素,不可见元素是什么?如果你需要完全独立的东西,绝对(或相对)定位它并给它一个更高的z-index。 )

(And that's because such an element wouldn't really fit into the rest of HTML. The only reason DIV and SPAN affect the surrounding area is because they're block and inline elements, respectively. What would an 'invisible' element be? If you need something that's completely independent, absolutely (or relatively) position it and give it a higher z-index.)

这篇关于CSS的布局中性标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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