Div - visible tag

T

tshad

I was told you could use <div id=sectionName visible=false> to control
visibility of sections of html on the screen.

But DW says:

The visible attribute of the DIV tag is not supported. [Microsoft Internet
Explorer 5.0, Microsoft Internet Explorer 5.5, Microsoft Internet Explorer
6.0, Netscape Navigator 6.0, Netscape Navigator 7.0]

Is this true?

If so how do you control areas of html visibility? This does seem to work,
however.

Thanks,

Tom
 
B

Barbara de Zoete

I was told you could use <div id=sectionName visible=false> to control
visibility of sections of html on the screen.

But DW says:

The visible attribute of the DIV tag is not supported. [Microsoft Internet
Explorer 5.0, Microsoft Internet Explorer 5.5, Microsoft Internet Explorer
6.0, Netscape Navigator 6.0, Netscape Navigator 7.0]

Is this true?

If so how do you control areas of html visibility? This does seem to work,
however.

Start reading instead of the tons of questions you keep asking:
<http://www.w3.org/TR/2002/WD-CSS21-20020802/cover.html>
We're not your personal helpdesk, you know.

Specific to this question would be:
<http://www.w3.org/TR/2002/WD-CSS21-20020802/visuren.html#display-prop>


--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
 
S

Steve Pugh

tshad said:
I was told you could use <div id=sectionName visible=false> to control
visibility of sections of html on the screen.

Whoever told you that was very mistaken. Or you didn't understand what
you were being told.
But DW says:

The visible attribute of the DIV tag is not supported. [Microsoft Internet
Explorer 5.0, Microsoft Internet Explorer 5.5, Microsoft Internet Explorer
6.0, Netscape Navigator 6.0, Netscape Navigator 7.0]

Is this true?

Yes. There is no such attribute. Check the HTML spec if in doubt.
If so how do you control areas of html visibility?

With CSS. visibility: hidden;
This does seem to work, however.

Really? In which browsers?

Steve
 
T

tshad

Steve Pugh said:
tshad said:
I was told you could use <div id=sectionName visible=false> to control
visibility of sections of html on the screen.

Whoever told you that was very mistaken. Or you didn't understand what
you were being told.
But DW says:

The visible attribute of the DIV tag is not supported. [Microsoft Internet
Explorer 5.0, Microsoft Internet Explorer 5.5, Microsoft Internet Explorer
6.0, Netscape Navigator 6.0, Netscape Navigator 7.0]

Is this true?

Yes. There is no such attribute. Check the HTML spec if in doubt.
If so how do you control areas of html visibility?

With CSS. visibility: hidden;
This does seem to work, however.

Really? In which browsers?

Mozilla 1.75, IE 6 for a couple.

I have an asp.net page where I have about 6 <div>'s, such as <div id="x"
visible=true runat="server">, that seem to work fine.

It works fine whether traditional or strict.

Tom
 
T

tshad

Barbara de Zoete said:
I was told you could use <div id=sectionName visible=false> to control
visibility of sections of html on the screen.

But DW says:

The visible attribute of the DIV tag is not supported. [Microsoft Internet
Explorer 5.0, Microsoft Internet Explorer 5.5, Microsoft Internet Explorer
6.0, Netscape Navigator 6.0, Netscape Navigator 7.0]

Is this true?

If so how do you control areas of html visibility? This does seem to work,
however.

Start reading instead of the tons of questions you keep asking:
<http://www.w3.org/TR/2002/WD-CSS21-20020802/cover.html>
We're not your personal helpdesk, you know.

If you don't want to answer, then don't.
This page didn't tell me what I was looking for.

I did find out how it's done.

It is done using styles (visibility:hidden). But this still wouldn't be
what I was looking for.

I did make a mistake and forgot to add the runat=server to my example
(asp.net):

<div id=sectionName visible=false runat=server>

instead of

<div id=sectionName visible=false>

Apparently, what happens (at least I think that is what happens based on the
html that is produced), asp.net will actually not display the html between
the <div></div> tags if visible is false.

When you add runat=server to the tag, it becomes an html control (an
htmlgenericcontrol to be precise) and html controls have visible attributes.

Thanks,

Tom
 
S

Steve Pugh

tshad said:
Mozilla 1.75, IE 6 for a couple.

Post the URL so we can check for ourselves.

My test is at http://steve.pugh.net/test/test91.html
and it shows that no browser I have does anything with the visible
attribute.
I have an asp.net page where I have about 6 <div>'s, such as <div id="x"
visible=true runat="server">, that seem to work fine.

But is the visible="true" in the code sent to the browser or is it an
instruction to the asp.net parser on the server to do something? The
runar="server" hints at the latter, in which case the whole discussion
is moot. ASP code is not part of HTML and should not be in the final
code that is sent to the browser/validator/whatever.
It works fine whether traditional or strict.

Of course it does. Neither browsers nor ASP.net servers care much
about the version of HTML being used, especially when it comes to made
up attributes.

I realise that you probably enjoy the wit and wisdom contained in my
sigs, but there's really no need to quote them. In fact a decent
newsreader would have trimmed them from your reply automatically.

Steve
 
T

tshad

Steve Pugh said:
Post the URL so we can check for ourselves.

I just figured out what is happening and when you can use visible for div
tags. There are really 2 situations. You can use <div> to hide and unhide
code. In normal html (non-asp.net) you use the style=visibility:hidden.
This can be changed programatically in Javascript.

In asp.net, you do use the visible attribute. But this is not rendered to
html.

Apparently, what happens (at least I think that is what happens based on the
html that is produced), asp.net will actually not display the html between
the <div></div> tags if visible is false.

When you add runat=server to the tag, it becomes an html control (an
htmlgenericcontrol to be precise) and html controls have visible attributes.

When the page is posted back to the server, you can change the visible
attribute at that time and it will render the code between the div tags if
set to true and won't if set to false.

I assume I can also do the Javascript option I mentioned earlier if I don't
want it to post back to the server.
My test is at http://steve.pugh.net/test/test91.html
and it shows that no browser I have does anything with the visible
attribute.


But is the visible="true" in the code sent to the browser or is it an
instruction to the asp.net parser on the server to do something? The
runar="server" hints at the latter, in which case the whole discussion
is moot. ASP code is not part of HTML and should not be in the final
code that is sent to the browser/validator/whatever.

You are right (as I mention above).

Thanks,

Tom
 
Joined
Apr 14, 2007
Messages
6
Reaction score
0
Steve Pugh said:
But is the visible="true" in the code sent to the browser or is it an
instruction to the asp.net parser on the server to do something? The
runat="server" hints at the latter

This is correct, when you add runat="server" in an asp.net application, you are creating a server tag from the div, and is handled differently than an html tag rendered by your browser.

You do have to use CSS, as in visibility:hidden and visibility:visible and in JavaScript document.getElementById("thediv").style.visibility="visible" (not document.getElementById("thediv").style="visibility:visible").

No need to be so rude, though. All you accomplish by making smarmy comments is alienate users, incite petty argument, and distract from the topic at hand. If you get some catharsis from sniping at people asking for help, restrict it to a personal blog instead.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top