Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Layout-neutral tag for CSS?

Tags:

html

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?

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.

like image 403
Pekka Avatar asked Nov 17 '09 21:11

Pekka


People also ask

How to display none CSS?

You can hide an element in CSS using the CSS properties display: none or visibility: hidden . display: none removes the entire element from the page and mat affect the layout of the page. visibility: hidden hides the element while keeping the space the same.

What is default display CSS?

The default display value for most elements is block or inline . Click to show panel. This panel contains a <div> element, which is hidden by default ( display: none ). It is styled with CSS, and we use JavaScript to show it (change it to ( display: block ).

What is layout tag?

The <layout> tag must be the root tag when you are using DataBinding . Doing so you are telling the compiler that you are using DataBinding and your layout will have special tags like <variable> or <import> , so you have to embed your layout within that tag.

How to write display none in HTML?

style. display = "none"; To show an element, set the style display property to “block”.


3 Answers

No, there is not.

(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.)

like image 163
Sam DeFabbia-Kane Avatar answered Nov 15 '22 22:11

Sam DeFabbia-Kane


If you want to group elements use a div or a span tag as a wrapper element. Apply your id or class to this, and style it accordingly.

EDIT

There isn't an 'invisible' tag - but margins and padding can be easily reset 'margin: 0; padding: 0;'

like image 31
codeinthehole Avatar answered Nov 15 '22 22:11

codeinthehole


While all browsers give default styling to many HTML tags, at it's core HTML only describes data, it doesn't format it.

What you're probably looking for is a DIV tag, because no browser gives any default styling to that tag.

like image 35
Tim Hettler Avatar answered Nov 15 '22 21:11

Tim Hettler