Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > the deal with my div

Reply
Thread Tools

the deal with my div

 
 
darrel
Guest
Posts: n/a
 
      11-16-2006
> I agree. But getting the window's size with JavaScript is also a bad tool.

How so? Seems that Javascript is the more applicable tool for this.

Even with tables, 100% height isn't technically a standard (even though some
browsers do support it).

Personally, I'd just give the DIV a specific height and live with it. I try
to avoid worrying about how tall the viewport is...let the page be as long
as it needs to be.

-Darrel


 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmFzb24gU3RlYXJucw==?=
Guest
Posts: n/a
 
      11-16-2006
Good point. I do generally focus on Firefox first, then tweak for IE.
Something i just tried and it worked ok in both FF2.0 and IE6 is

<HEAD>
<style>
BODY
{
min-height:100%;
}
</style>

</HEAD>

<BODY>
<div style="height:100%; border:black solid 1px;">
TEST
</div>
</BODY>

"Laurent Bugnion" wrote:

> Hi,
>
> Jason Stearns wrote:
> > Its not what tables were meant for. Tables are meant for displaying tabluar
> > data. Yes it would solve this problem just as a screwdriver could be used as
> > a pry bar.
> >
> > Using tables for page layout can cause other problems though, like CSS
> > styles not cascading down into the table and it could become cumbersome for
> > page readers for the deaf to have to read down into the <table> then the <tr>
> > then the <td> just to get to the content.
> >
> > Its just not how HTML was designed. But it would work, yes.

>
> I agree. But getting the window's size with JavaScript is also a bad
> tool. Out of two bad tools, I prefer the one which works also without
> JavaScript
>
> Just my opinion, of course.
>
> BTW, in IE, setting the height of the body to 100% solves the problem.
> In Firefox it doesn't (at least not on Windows).
>
> Greetings,
> Laurent
> --
> Laurent Bugnion, GalaSoft
> Software engineering: http://www.galasoft-LB.ch
> PhotoAlbum: http://www.galasoft-LB.ch/pictures
> Support children in Calcutta: http://www.calcutta-espoir.ch
>

 
Reply With Quote
 
 
 
 
Laurent Bugnion
Guest
Posts: n/a
 
      11-16-2006
Hi,

darrel wrote:
>> I agree. But getting the window's size with JavaScript is also a bad tool.

>
> How so? Seems that Javascript is the more applicable tool for this.


Because it's not cross browser compatible (at least not in my
experience, and I'd love to be proven wrong, so don't hesitate

http://www.howtocreate.co.uk/tutoria.../browserwindow

And also because JavaScript is sometimes disabled. I rely on JavaScript
(and people who know me know that I relied on it for a very long time,
see comp.lang.javascript archives). I use it to improve the user
experience, but the most important thing for me is that it must
absolutely degrade gracefully. In other words, if it's not available, I
want the user to notice as little as possible, and unfortunately when
you use it to set the layout, he does notice.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
 
Reply With Quote
 
Laurent Bugnion
Guest
Posts: n/a
 
      11-16-2006
Hi,

Jason Stearns wrote:
> Good point. I do generally focus on Firefox first, then tweak for IE.
> Something i just tried and it worked ok in both FF2.0 and IE6 is
>
> <HEAD>
> <style>
> BODY
> {
> min-height:100%;
> }
> </style>
>
> </HEAD>
>
> <BODY>
> <div style="height:100%; border:black solid 1px;">
> TEST
> </div>
> </BODY>


Oh, something came to my mind, and I tested again with the body height
set to 100%. It works fine with HTML 4.0 transitional DOCTYPE in both
IE6 and FF1.5.

However, even min-height fails in IE6 and FF1.5 with DOCTYPE set to XHTML...

Also, if the DIV is enclosed in a form, the form's height must also be
set to 100%.

OK, that's really off topic now.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
 
Reply With Quote
 
darrel
Guest
Posts: n/a
 
      11-16-2006
> And also because JavaScript is sometimes disabled. I rely on JavaScript
> (and people who know me know that I relied on it for a very long time, see
> comp.lang.javascript archives). I use it to improve the user experience,
> but the most important thing for me is that it must absolutely degrade
> gracefully. In other words, if it's not available, I want the user to
> notice as little as possible, and unfortunately when you use it to set the
> layout, he does notice.


I agree, though I don't see that 'enhancing layout' is not an applicable use
of javascript. Provided the markup is semantic, accessible, and is usable
without javascript, I'm fine with that.

-Darrel


 
Reply With Quote
 
=?Utf-8?B?SmFzb24gU3RlYXJucw==?=
Guest
Posts: n/a
 
      11-16-2006
Writing javascript to do x for one browser and y for another isn't hard, just
time consuming and requires good testing. But i don't think that any asp.net
application could be expected to run correctly with out javascript enabled on
the client side. As far as i'm concerned if you don't have javascript enabled
you're just not going to be able to function on today's web.

rodchar, if i were you i would just read up on the w3c specs and do what
ever works for you. there's lots of documentation on the benefits of
tableless css design, but a table would fix this problem also.

"Laurent Bugnion" wrote:

> Hi,
>
> darrel wrote:
> >> I agree. But getting the window's size with JavaScript is also a bad tool.

> >
> > How so? Seems that Javascript is the more applicable tool for this.

>
> Because it's not cross browser compatible (at least not in my
> experience, and I'd love to be proven wrong, so don't hesitate
>
> http://www.howtocreate.co.uk/tutoria.../browserwindow
>
> And also because JavaScript is sometimes disabled. I rely on JavaScript
> (and people who know me know that I relied on it for a very long time,
> see comp.lang.javascript archives). I use it to improve the user
> experience, but the most important thing for me is that it must
> absolutely degrade gracefully. In other words, if it's not available, I
> want the user to notice as little as possible, and unfortunately when
> you use it to set the layout, he does notice.
>
> HTH,
> Laurent
> --
> Laurent Bugnion, GalaSoft
> Software engineering: http://www.galasoft-LB.ch
> PhotoAlbum: http://www.galasoft-LB.ch/pictures
> Support children in Calcutta: http://www.calcutta-espoir.ch
>

 
Reply With Quote
 
Laurent Bugnion
Guest
Posts: n/a
 
      11-17-2006
Hi,

Jason Stearns wrote:
> Writing javascript to do x for one browser and y for another isn't hard, just
> time consuming and requires good testing.


Additionally, cross-browser coding is also not that hard, and more and
more possible, except for minor functionalities like the one we're
talking about.

> But i don't think that any asp.net
> application could be expected to run correctly with out javascript enabled on
> the client side. As far as i'm concerned if you don't have javascript enabled
> you're just not going to be able to function on today's web.


I think that's true for thick clients. However, don't forget all the
users (more and more each day) who access your page using mobile
devices, where only a subset (at best) of JavaScript is available.
Irrelevant point in our case, since the layout issue on a mobile device
is totally different anyway.


> rodchar, if i were you i would just read up on the w3c specs and do what
> ever works for you. there's lots of documentation on the benefits of
> tableless css design, but a table would fix this problem also.


Pragmatism and compromise are the two most important attitudes in
today's world of software engineering. I concur

Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
 
Reply With Quote
 
darrel
Guest
Posts: n/a
 
      11-17-2006
> As far as i'm concerned if you don't have javascript enabled
> you're just not going to be able to function on today's web.


In reality, that's true. In theory, it shouldn't be.

Javascript should always be treated as an 'enhancement' to the user
experience...not a requirement.

one of the major benefits of the web is the ability to make it accessible to
a much wider audience than any other medium that has come before it. Even
(oddly enough) Microsoft seems to be accepting this as the better way. It
sounds like ASP.net 2.0 and Atlas not only now support a wider range of
browsers, but Atlas has also been designed so that it can gracefully degrade
for those without javascript if one builds the site correctly.

-Darrel


 
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
<div ... /> and <div ...></div> K Viltersten ASP .Net 4 03-31-2009 07:33 PM
AMD64 or Semperon, deal or no deal? Tad Confused Computer Information 7 04-13-2006 05:43 PM
deal or no deal rbt Python 7 12-28-2005 08:57 PM
NS/FF don't change div offsetWidth when div innerHTML is added toand div becomes wider mscir Javascript 3 06-26-2005 04:04 PM
Q: Div A inside Div B is larger than Div B Dwayne Madsen Javascript 1 06-01-2005 03:02 PM



Advertisments