Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the proper way to hide any HTML tag?

Tags:

html

css

What is Proper CSS for hiding any HTML. Example- Like <div> tag. I use to do this:

div {display:none; visibility:hidden;}

Does the CSS Supports all the major browsers to Hide that div. Especially Does it Support I.E.

like image 435
Asif Avatar asked Feb 24 '12 04:02

Asif


People also ask

How do you hide a tag in HTML?

You can hide an element by using the Boolean attribute hidden with the element. When you specify the hidden attribute in the HTML file, then the browser will not display that element, which is specified with this attribute.

How do you hide a tag?

Tap in the top right, then tap Settings. Tap Privacy, then tap Posts. Tap Manually Approve Tags, then tap Edit next to Tagged Posts. Select the posts you'd like to hide from your profile, then tap Hide [number] at the bottom.

How do I hide an area in HTML?

Use 'hidden' or hidden='hidden'. Both are valid.

How do I hide something in HTML 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.


1 Answers

In HTML5 there is a new global attribute called hidden.

From https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden :

The hidden global attribute is a Boolean attribute indicating that the element is not yet, or is no longer, relevant. For example, it can be used to hide elements of the page that can't be used until the login process has been completed. Browsers won't render elements with the hidden attribute set.

Beware that hidden has a semantic meaning compared to display and visibility. That is why it is not a CSS attribute, but an HTML attribute.

like image 135
Krisztián Balla Avatar answered Oct 21 '22 23:10

Krisztián Balla