Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Div - visible tag

Reply
Thread Tools

Div - visible tag

 
 
tshad
Guest
Posts: n/a
 
      03-01-2005
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


 
Reply With Quote
 
 
 
 
Barbara de Zoete
Guest
Posts: n/a
 
      03-01-2005
On Tue, 01 Mar 2005 22:55:08 GMT, tshad <(E-Mail Removed)> wrote:

> 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 |
`-------------------------------------------------- --<--@ ------------'
 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      03-01-2005
"tshad" <(E-Mail Removed)> wrote:

>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

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      04-16-2005

"Steve Pugh" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "tshad" <(E-Mail Removed)> wrote:
>
> >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
>
> Steve
>
> --
> "My theories appal you, my heresies outrage you,
> I never answer letters and you don't like my tie." - The Doctor
>
> Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>



 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      04-16-2005

"Barbara de Zoete" <(E-Mail Removed)> wrote in message
newspsmzea5etx5vgts@zoete_b...
> On Tue, 01 Mar 2005 22:55:08 GMT, tshad <(E-Mail Removed)>

wrote:
>
> > 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.

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

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

>
> --
> ,-- --<--@ -- 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 |
> `-------------------------------------------------- --<--@ ------------'



 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      04-16-2005
"tshad" <(E-Mail Removed)> wrote:
>"Steve Pugh" <(E-Mail Removed)> wrote:
>> "tshad" <(E-Mail Removed)> wrote:
>>
>> >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.
>>
>> > This does seem to work, however.

>>
>> Really? In which browsers?

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

>> --
>> "My theories appal you, my heresies outrage you,
>> I never answer letters and you don't like my tie." - The Doctor
>>
>> Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>


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

--
"Grab reality by the balls and squeeze." - Tempus Thales

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      04-18-2005

"Steve Pugh" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "tshad" <(E-Mail Removed)> wrote:
> >"Steve Pugh" <(E-Mail Removed)> wrote:
> >> "tshad" <(E-Mail Removed)> wrote:
> >>
> >> >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.
> >>
> >> > This does seem to work, however.
> >>
> >> Really? In which browsers?

> >
> >Mozilla 1.75, IE 6 for a couple.

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


You are right (as I mention above).

Thanks,

Tom
>
> >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.
>
> >> --
> >> "My theories appal you, my heresies outrage you,
> >> I never answer letters and you don't like my tie." - The Doctor
> >>
> >> Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>

>
> 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
>
> --
> "Grab reality by the balls and squeeze." - Tempus Thales
>
> Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>



 
Reply With Quote
 
Shiggity Shiggity is offline
Junior Member
Join Date: Apr 2007
Posts: 7
 
      02-26-2008
Quote:
Originally Posted by Steve Pugh
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="visibilit y: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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I hide a div, the image in the div still visible in internetexplorer Faraz.ya@gmail.com Javascript 4 12-25-2007 11:03 PM
Select text within a div tag by clicking on content of div tag or a button? visu Javascript 4 11-22-2006 06:25 AM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Select text within a div tag by clicking on content of div tag? M Wells Javascript 0 10-06-2004 11:04 AM
Border lines in hidden div bleed through into visible div Jon Javascript 2 05-07-2004 04:06 PM



Advertisments