Skip to content Skip to sidebar Skip to footer

Layout-neutral Tag For 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 backg

Solution 1:

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


Solution 2:

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;'


Solution 3:

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.


Solution 4:

I think you want a <fieldset>.


Solution 5:

I'd say a span tag is as neutral as they come. I don't think there's any browser that applies a margin nor a padding and it just wraps around it's contents.


Post a Comment for "Layout-neutral Tag For CSS?"