Jump to content

Hide Content In Div Tag


Twango

Recommended Posts

Any element can be set to display:none, and it will not appear. If it is the content of the div you want to hide, like a paragraph or an image, then give that property to the paragraph or image.If you have text in the div but not also in a paragraph or span or something, then the text can be hidden only if the div is hidden.You might be running into problems with competing definitions. Like one definition makes the display:block, and another is display:hidden. There are two answers.1. The definition closest to the element overrides any previous definitions (internal beats external, bottom of the stylesheet beats the top, inline beats stylesheet) ;2. unless the previous CSS selector is more specific. Like:#holder .wrapper inputis more specific theninput. . . so a later definition may be ignored.I usually discover and fix that problem by trial-and-error.

Link to comment
Share on other sites

Any element can be set to display:none, and it will not appear. If it is the content of the div you want to hide, like a paragraph or an image, then give that property to the paragraph or image.If you have text in the div but not also in a paragraph or span or something, then the text can be hidden only if the div is hidden.You might be running into problems with competing definitions. Like one definition makes the display:block, and another is display:hidden. There are two answers.1. The definition closest to the element overrides any previous definitions (internal beats external, bottom of the stylesheet beats the top, inline beats stylesheet) ;2. unless the previous CSS selector is more specific. Like:#holder .wrapper inputis more specific theninput. . . so a later definition may be ignored.I usually discover and fix that problem by trial-and-error.
So. there is no way to make an <input> tag inside a <div> to be hidden without making the individual elements hide/show?
Link to comment
Share on other sites

I really don't understand the question. I can't think of a reason why you cannot use the display property to hide any element. Some circumstances might require you to tweak your selector, but that's just a matter of helping CSS find the element. Hiding it is easy. display:none, just as you wrote.Now we could keep talking theoretically like this. But if you still get nowhere, post some code.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...