Div - visible tag

Discussion in 'HTML' started by tshad, Mar 1, 2005.

  1. tshad

    tshad Guest

    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
     
    tshad, Mar 1, 2005
    #1
    1. Advertising

  2. On Tue, 01 Mar 2005 22:55:08 GMT, tshad <> 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 |
    `-------------------------------------------------- --<--@ ------------'
     
    Barbara de Zoete, Mar 1, 2005
    #2
    1. Advertising

  3. tshad

    Steve Pugh Guest

    "tshad" <> 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 <> <http://steve.pugh.net/>
     
    Steve Pugh, Mar 1, 2005
    #3
  4. tshad

    tshad Guest

    "Steve Pugh" <> wrote in message
    news:...
    > "tshad" <> 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 <> <http://steve.pugh.net/>
     
    tshad, Apr 16, 2005
    #4
  5. tshad

    tshad Guest

    "Barbara de Zoete" <> wrote in message
    news:eek:psmzea5etx5vgts@zoete_b...
    > On Tue, 01 Mar 2005 22:55:08 GMT, tshad <>

    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 |
    > `-------------------------------------------------- --<--@ ------------'
     
    tshad, Apr 16, 2005
    #5
  6. tshad

    Steve Pugh Guest

    "tshad" <> wrote:
    >"Steve Pugh" <> wrote:
    >> "tshad" <> 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 <> <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 <> <http://steve.pugh.net/>
     
    Steve Pugh, Apr 16, 2005
    #6
  7. tshad

    tshad Guest

    "Steve Pugh" <> wrote in message
    news:...
    > "tshad" <> wrote:
    > >"Steve Pugh" <> wrote:
    > >> "tshad" <> 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 <> <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 <> <http://steve.pugh.net/>
     
    tshad, Apr 18, 2005
    #7
  8. tshad

    Shiggity

    Joined:
    Apr 14, 2007
    Messages:
    6
    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.
     
    Shiggity, Feb 26, 2008
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    871
    John C. Bollinger
    Jan 27, 2006
  2. Jon
    Replies:
    2
    Views:
    198
  3. M Wells
    Replies:
    0
    Views:
    144
    M Wells
    Oct 6, 2004
  4. visu
    Replies:
    4
    Views:
    315
  5. Replies:
    4
    Views:
    181
Loading...

Share This Page