CSS to hide DIV, but keep space in use.

N

Noozer

I'm sure I've seen this, but it's been a while and cannot remember how it
was done.

If I set the "display" CSS property to 'block' makes the DIV take space up
in the HTML page and displays it's content. Setting this property to 'none'
makes the DIV disappear as though it never existed. BUT, I'm sure I've seen
another value that will hide the content of the DIV, but will STILL use up
the space in the HTML page.

Does this make sense? Does anyone know how it's done?
 
E

Els

Noozer said:
I'm sure I've seen this, but it's been a while and cannot remember how it
was done.

If I set the "display" CSS property to 'block' makes the DIV take space up
in the HTML page and displays it's content. Setting this property to 'none'
makes the DIV disappear as though it never existed. BUT, I'm sure I've seen
another value that will hide the content of the DIV, but will STILL use up
the space in the HTML page.

Does this make sense? Does anyone know how it's done?

visibility:hidden;
 
N

Noozer

If I set the "display" CSS property to 'block' makes the DIV take space
visibility:hidden;

Thanks Els... I was looking for "visible" and having no luck at all.
 
G

Greg N.

Noozer said:
will hide the content of the DIV, but will STILL use up
the space in the HTML page.

If you're trying to do this in order to make Search bots see some
content that the users are not supposed to see, _don't!_

Google is supposedly working very hard to detect such tricks and has
announced to penalize pages that use such tactics. Whether you really
intend SE deception or not will obviously not matter.
 
T

Toby Inkster

Greg said:
If you're trying to do this in order to make Search bots see some
content that the users are not supposed to see, _don't!_

Gievn that the OP doesn't want the space taken up by the text to collapse,
I would assume that this isn't the intention.

Rather the OP probably wants to hide the text, and then re-show it in
response to some user action.
 
G

Greg N.

Toby said:
Gievn that the OP doesn't want the space taken up by the text to collapse,
I would assume that this isn't the intention.

I think so, too. But Google, in its growing anti-spam fury, might not
be smart enough to understand.

I must admit I'm getting paranoid. Any text color too close to the
background color, any overflow:hidden, visibility:hidden, display:none,
any positioning that might under some circumstances move off the
viewport - I think twice. Yes, paranoia... maybe. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top