f



Scalable page, replace JS with CSS?

I'd like to put some non-hitchhiking stuff on my http://prino.neocities.org/ 
site (to be more specific, some of the tools I developed on z/OS over the past 
three decades) and I'd like to present them in a format that looks like z/OS, 
using this

http://web.archive.org/web/20061030074042/http://www.robinandmariette.com/Mvs/spfdsl.asp?root=Rexx/Pds/&hlq=MA133.TSO

website as a kind of initial template, with

http://web.archive.org/web/20061030074224/http://www.robinandmariette.com/Mvs/spfpds.asp?root=Rexx/Pds/&hlq=MA133.TSO&pds=SYSEXEC

as a follow-up, to eventually show the actual tool on a page like

http://web.archive.org/web/20061030075116/http://www.robinandmariette.com/Mvs/spfview.asp?root=Rexx/Pds/SYSEXEC/&hlq=MA133.TSO&pds=SYSEXEC&member=COMPRESS

Useful? Not to Joe Average, but it will seem very natural to those of us using 
ISPF on z/OS.

Anyway, all of them use this little tidbit of Javascript to set the fontsize on 
the <BODY> tag:

<script type="text/javascript">
sWidth = screen.width;
fSize = parseInt(sWidth/52);
document.write('<style type="text/css">');
document.write('body { font-size:'+fSize+'px; }');
document.write('</style>');
</script>

and that shows only "half" the screen if the bookmarks sidebar is open, and 
removing the script gives me a tiny(ish) font, so

How do I scale the text either without using Javascript, which obviously should 
using something other than "screen.width", or with CSS, so that it nicely fills 
the viewport, no matter what size the browser window is, and whether the 
bookmarks are in it or not.

Robert
-- 
Robert AH Prins
robert(a)prino(d)org
No programming (yet) @ http://prino.neocities.org/
0
Robert
11/15/2016 1:01:01 AM
comp.authoring.stylesheets 8158 articles. 0 followers. mdmoura (161) is leader. Post Follow

18 Replies
151 Views

Similar Articles

[PageSpeed] 30

On 2016-11-15 22:07, Beauregard T. Shagnasty wrote:
> Robert Prins wrote:
>
>> How do I scale the text either without using Javascript, which obviously
>> should using something other than "screen.width", or with CSS, so that
>> it nicely fills the viewport, no matter what size the browser window is,
>> and whether the bookmarks are in it or not.
>
> If you do absolutely nothing at all, you will have saved a day where you
> could go fishing or something equally satisfying.

You can only repaint the inside of your house so many times, and mowing the 
grass every day might only make sense on a golf green... If your work is done in 
India by people because they are cheap, rather than knowledgeable doing this 
kind of work is very satisfying.

 > And you will not deprive
> your visitors of using their *own preferred font-size* instead of being
> subjected to whatever you feel is better for them.

All I want is to show the whole page, without horizontal scroll bar. My audience 
is not Joe Average, my audience are people who work on z/OS, and even AD 2016 a 
huge percentage of them still uses a 24x80 screen, even when ISPF, the z/OS TUI 
supports about any resolution containing less than 16,000 characters - I myself 
use a 62x162 resolution, which works well on a full HD screen.

> If you feel you must do _something_ set the font-size to 100%. Pixels are
> never a good idea.

I know, but if I use Firebug to completely zap the font-size, I get small 
characters.

Robert
-- 
Robert AH Prins
robert(a)prino(d)org
No programming (yet) @ http://prino.neocities.org/
0
Robert
11/15/2016 1:01:01 AM
On 2016-11-15 22:42, Thomas 'PointedEars' Lahn wrote:
> Robert Prins wrote:
>
>> Anyway, all of them use this little tidbit of Javascript to set the
>> fontsize on the <BODY> tag:
>>
>> <script type="text/javascript">
>> sWidth = screen.width;
>
> Display resolution != desktop size != browser window size != viewport size.
> [psf 3.7]
>
> Also, you have not declared “sWidth” a variable (using the “var” or “let”
> keyword and statement), which is error-prone.
>
>> fSize = parseInt(sWidth/52);
>
> Same problem plus the fact that parseInt() should in general be called with
> a second argument indicating the base (here: 10), and that CSS units of
> length – even “px” – support floating-point values: so there is no need for
> truncating the result of the division to an integer number.
>
> <https://www.w3.org/TR/2016/CR-css-values-3-20160929/#lengths>
>
>> document.write('<style type="text/css">');
>> document.write('body { font-size:'+fSize+'px; }');
>
> This is nonsense, too.  The font-size property specifies the x-*height*.
>
> Would you at least *please* *learn* the *basics* of CSS before you attempt
> to use it?  (The same applies to other Web technologies.)

Excuse me, but this is NOT MY CODE! I've not coded anything yet, the code you 
are looking at came (maybe) from Robin Murray!!!

Robert
-- 
Robert AH Prins
robert(a)prino(d)org
No programming (yet) @ http://prino.neocities.org/
0
Robert
11/15/2016 1:01:01 AM
Robert Prins wrote:

> How do I scale the text either without using Javascript, which obviously
> should using something other than "screen.width", or with CSS, so that
> it nicely fills the viewport, no matter what size the browser window is,
> and whether the bookmarks are in it or not.

If you do absolutely nothing at all, you will have saved a day where you 
could go fishing or something equally satisfying. And you will not deprive 
your visitors of using their *own preferred font-size* instead of being 
subjected to whatever you feel is better for them.

If you feel you must do _something_ set the font-size to 100%. Pixels are 
never a good idea.

-- 
   -bts
   -This space for rent, but the price is high
0
Beauregard
11/15/2016 10:07:04 PM
Robert Prins wrote:

> Anyway, all of them use this little tidbit of Javascript to set the
> fontsize on the <BODY> tag:
> 
> <script type="text/javascript">
> sWidth = screen.width;

Display resolution != desktop size != browser window size != viewport size. 
[psf 3.7]

Also, you have not declared “sWidth” a variable (using the “var” or “let” 
keyword and statement), which is error-prone.

> fSize = parseInt(sWidth/52);

Same problem plus the fact that parseInt() should in general be called with 
a second argument indicating the base (here: 10), and that CSS units of 
length – even “px” – support floating-point values: so there is no need for 
truncating the result of the division to an integer number.

<https://www.w3.org/TR/2016/CR-css-values-3-20160929/#lengths>

> document.write('<style type="text/css">');
> document.write('body { font-size:'+fSize+'px; }');

This is nonsense, too.  The font-size property specifies the x-*height*.

Would you at least *please* *learn* the *basics* of CSS before you attempt 
to use it?  (The same applies to other Web technologies.)

<https://www.w3.org/TR/2013/CR-css-fonts-3-20131003/#font-size-prop>

> document.write('</style>');
> </script>
> 
> and that shows only "half" the screen if the bookmarks sidebar is open,

AISB.

> and removing the script gives me a tiny(ish) font, so
> 
> How do I scale the text either without using Javascript, which obviously
> should using something other than "screen.width", or with CSS, so that it
> nicely fills the viewport, no matter what size the browser window is, and
> whether the bookmarks are in it or not.

You can use the “vw” (viewport width) unit of length, but be aware that it 
is not universally supported:

<https://www.w3.org/TR/2016/CR-css-values-3-20160929/#relative-length>
<http://caniuse.com/#search=vw> (see “Show all”, too)

In general, it is likely an ill-conceived idea that requires scaling the 
text size to the viewport.  Text should be written so that it can be 
(word-)wrapped.

In this case it is source code, which is special; but unless you want to 
make a presentation out of it, I can see no good reason for huge characters 
if I have a wide viewport.  Instead, I would expect that a wide viewport 
allows me to see more of the line of the source code in case it has to be 
written in a long line.


PointedEars
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
0
Thomas
11/15/2016 10:42:35 PM
Robert Prins wrote:

> On 2016-11-15 22:07, Beauregard T. Shagnasty wrote:
>> Robert Prins wrote:
>>> How do I scale the text either without using Javascript, which
>>> obviously should using something other than "screen.width", or with
>>> CSS, so that it nicely fills the viewport, no matter what size the
>>> browser window is, and whether the bookmarks are in it or not.
>>
>> If you do absolutely nothing at all, you will have saved a day where
>> you could go fishing or something equally satisfying.
> 
> You can only repaint the inside of your house so many times, and mowing
> the grass every day might only make sense on a golf green... If your
> work is done in India by people because they are cheap, rather than
> knowledgeable doing this kind of work is very satisfying.

That paragraph seems to be irrelevant to your solution.   :-)

>  > And you will not deprive
>> your visitors of using their *own preferred font-size* instead of being
>> subjected to whatever you feel is better for them.
> 
> All I want is to show the whole page, without horizontal scroll bar.

If you do not assign any specific sizes, widths and heights, your page 
will fill the available viewport no matter how may characters wide or tall 
it is.

>> If you feel you must do _something_ set the font-size to 100%. Pixels
>> are never a good idea.
> 
> I know, but if I use Firebug to completely zap the font-size, I get
> small characters.

Then *your* default size is too small for what you actually prefer. Fix 
that rather than punish your visitors.

-- 
   -bts
   -This space for rent, but the price is high
0
Beauregard
11/15/2016 11:58:06 PM
On Tue, 15 Nov 2016 22:07:04 -0000 (UTC), Beauregard T. Shagnasty 
wrote:
> 
> Robert Prins wrote:
> 
> > How do I scale the text either without using Javascript, which obviously
> > should using something other than "screen.width", or with CSS, so that
> > it nicely fills the viewport, no matter what size the browser window is,
> > and whether the bookmarks are in it or not.
> 
> If you do absolutely nothing at all, you will have saved a day where you 
> could go fishing or something equally satisfying. And you will not deprive 
> your visitors of using their *own preferred font-size* instead of being 
> subjected to whatever you feel is better for them.

+1

The number one mistake by Web authors is putting a lot of effort into
doing something complicated that has unexpected bad side effects. I
agree 100% with Beau's comment. Just as he says, doing nothing 
actually will do what the OP asks: filling the browser window.

That said, I personally would set 
	body { max-width:45em; margin-left:auto; margin-right:auto; }

I wrote 45em, but others have argued for somewhat above or below 
that. I don't think there's One Correct Max-Width. But many will 
agree that, when the screen is very wide, you don't want text lines 
to flow all the way across it,  because that's very fatiguing to read 
across very wide screens. 

But if you leave that out, it's still better than trying to 
overspecify things.



-- 
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
                                       http://BrownMath.com/
                                  http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator:      http://validator.w3.org/
CSS 2.1 spec:   http://www.w3.org/TR/CSS21/
validator:      http://jigsaw.w3.org/css-validator/
Why We Won't Help You: http://preview.tinyurl.com/WhyWont
0
Stan
11/16/2016 12:19:24 AM
On Wed, 16 Nov 2016 00:34:23 +0000, Robert Prins wrote:
> All I want is to show the whole page, without horizontal scroll bar. 
> 

I don't know of any browser that will give you a horizontal scroll 
bar unless you specify a width that is too large for the particular 
screen. Specifying no width at all avoids that.

(You do have to be careful about images, and perhaps serve a smaller 
version when the screen is very narrow. Or you could just specify
	img { max-width:100%; }
and keep things simple. I think that will do the job, if I remember a 
discussion we had here a few months back.)

-- 
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
                                       http://BrownMath.com/
                                  http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator:      http://validator.w3.org/
CSS 2.1 spec:   http://www.w3.org/TR/CSS21/
validator:      http://jigsaw.w3.org/css-validator/
Why We Won't Help You: http://preview.tinyurl.com/WhyWont
0
Stan
11/16/2016 12:22:55 AM
Robert Prins wrote:

> On 2016-11-15 22:42, Thomas 'PointedEars' Lahn wrote:
>> Robert Prins wrote:
>>> document.write('<style type="text/css">');
>>> document.write('body { font-size:'+fSize+'px; }');
>>
>> This is nonsense, too.  The font-size property specifies the x-*height*.
>>
>> Would you at least *please* *learn* the *basics* of CSS before you
>> attempt to use it?  (The same applies to other Web technologies.)
> 
> Excuse me, but this is NOT MY CODE! I've not coded anything yet, the code
> you are looking at came (maybe) from Robin Murray!!!

*You* copied it, and *you* expected it to work.  Which would not have been 
the case had *you* gotten yourself a minimum clue first.  You should not 
confuse this discussion group with a free support forum for Copy & Pray.

And you should read my whole posting.


PointedEars
-- 
When all you know is jQuery, every problem looks $(olvable).
0
Thomas
11/16/2016 12:25:32 AM
On Tue, 15 Nov 2016 19:22:55 -0500, Stan Brown wrote:

> about images ... you could just specify
> 	img { max-width:100%; }

How may one combine that specification with the height/width specifications
I usually use within the IMG tag, e.g., <IMG height=300 width=400 src=...>?
Goal would of course be to reduce both height and width proportionally,
maintaining aspect ratio, wherever width must get reduced.

Thanks for any insights/advice. Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.
0
tlvp
11/16/2016 2:38:54 AM
tlvp <mPiOsUcB.EtLlLvEp@att.net> wrote on 16 Nov 2016 in
comp.infosystems.www.authoring.stylesheets: 
> On Tue, 15 Nov 2016 19:22:55 -0500, Stan Brown wrote:
>> about images ... you could just specify>
>> img { max-width:100%; }
> I usually use within the IMG tag, e.g., <IMG height=300 width=400
> src=...>? 

Why, 
especially in this NG, 
do you not use style declarations,
inlined or classNamed?

<img style='height:300px;width:400px;'>

However, together with a 'maxwidth:;',
it pays of to specify only the 'width:;',
and not the 'height:;'.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
0
Evertjan
11/16/2016 10:16:17 AM
16.11.2016, 12:16, Evertjan. wrote:

> tlvp <mPiOsUcB.EtLlLvEp@att.net> wrote on 16 Nov 2016 in
[...]
>> I usually use within the IMG tag, e.g., <IMG height=300 width=400
>> src=...>?
>
> Why,
> especially in this NG,
> do you not use style declarations,
> inlined or classNamed?
>
> <img style='height:300px;width:400px;'>

Perhaps because the HTML code is simpler, with fewer opportunities for 
mistyping something? Or perhaps because 300 and 400 are the intrinsic 
dimensions of the image, thus descriptive of the content, rather than a 
stylistic setting?

In any case, normally the only reason for specifying the dimensions is 
to speed up page rendering, so that a browser can format the page 
properly even before getting the image (along with its dimension 
information) from a server. These days, I would weigh this against the 
point that hard-coding image dimensions (in HTML or in CSS) causes 
difficulties when the page content is modified. Suppose that tomorrow 
you will decide to replace the image by a better one, which happens to 
be 280 � 400 pixels. If the dimensions are hard-coded, you need to 
change them � and it may happen that you don�t realize this and don�t 
even see the effect when you quickly look at the page, so that visitors 
will see a distorted image.

> However, together with a 'maxwidth:;',
> it pays of to specify only the 'width:;',
> and not the 'height:;'.

Indeed, because this is the only way to make the width : height 
proportion retained when the browser rescales the image. And specifying 
*only* width (in HTML or in CSS) is rather pointless: it does not serve 
the purpose of faster rendering.

So the answer to the question how max-width may be combined with height 
and width specifications is: don�t; just omit the height and width 
specifications, at least when specifying max-width.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/
0
Jukka
11/16/2016 10:44:15 AM
Jukka K. Korpela wrote:

> In any case, normally the only reason for specifying the [image] 
> dimensions [with width and height attributes] is to speed up page
> rendering, so that a browser can format the page properly even
> before getting the image (along with its dimension information)
> from a server.

No, the main reason is to avoid the undesirable effect of a “jumping”  
content and an unreadable alternative text while the image is being loaded.

<https://www.w3.org/TR/2014/REC-html5-20141028/embedded-content-0.html#attr-dim-width>

> These days, I would weigh this against the point that hard-coding image
> dimensions (in HTML or in CSS) causes difficulties when the page content
> is modified. Suppose that tomorrow you will decide to replace the image by
> a better one, which happens to be 280 × 400 pixels. If the dimensions are
> hard-coded, you need to change them – and it may happen that you don’t
> realize this and don’t even see the effect when you quickly look at the
> page, so that visitors will see a distorted image.

This may be a problem for people who have never heard of HTML editors, 
server-side scripting, CMSs, or all of them.


PointedEars
-- 
    realism:    HTML 4.01 Strict
    evangelism: XHTML 1.0 Strict
    madness:    XHTML 1.1 as application/xhtml+xml
                                                    -- Bjoern Hoehrmann
0
Thomas
11/16/2016 11:11:36 AM
In comp.infosystems.www.authoring.stylesheets message
<o0ftc7$34o$1@dont-email.me>, Tue, 15 Nov 2016 23:06:24, Robert Prins
<robert@prino.org> posted:

>Anyway, all of them use this little tidbit of Javascript to set the
>fontsize on the <BODY> tag:
>
><script type="text/javascript">
>sWidth = screen.width;
>fSize = parseInt(sWidth/52);
>document.write('<style type="text/css">');
>document.write('body { font-size:'+fSize+'px; }');
>document.write('</style>');
></script>

The author of that should, if possible, be informed that JavaScript

  document.body.style.backgroundColor = S

works, therefore one should be able to set the font size more elegantly.

Also, sWidth/52 must be of type Number, with a positive valueless than
2^32 (do I mean 2^31?), so   fSize = (sWidth/52)|0  should be equivalent
and probably imperceptibly faster.

But, alas, I cannot answer your question.

-- 
 (c) John Stockton, Surrey, UK.  �@merlyn.demon.co.uk   Turnpike v6.05   MIME.
 Merlyn Web Site <                       > - FAQish topics, acronyms, & links.


0
Dr
11/16/2016 12:51:25 PM
On 2016-11-16 00:25, Thomas 'PointedEars' Lahn wrote:
 > Robert Prins wrote:
 >
 >> On 2016-11-15 22:42, Thomas 'PointedEars' Lahn wrote:
 >>> Robert Prins wrote:
 >>>> document.write('<style type="text/css">');
 >>>> document.write('body { font-size:'+fSize+'px; }');
 >>>
 >>> This is nonsense, too.  The font-size property specifies the x-*height*.
 >>>
 >>> Would you at least *please* *learn* the *basics* of CSS before you
 >>> attempt to use it?  (The same applies to other Web technologies.)
 >>
 >> Excuse me, but this is NOT MY CODE! I've not coded anything yet, the code
 >> you are looking at came (maybe) from Robin Murray!!!
 >
 > *You* copied it, and *you* expected it to work.  Which would not have been
 > the case had *you* gotten yourself a minimum clue first.  You should not
 > confuse this discussion group with a free support forum for Copy & Pray.
 >
 > And you should read my whole posting.

I didn't copy anything, I indicated how I wanted to present them, using the same 
"logic" a long gone site with similar content used to show them, but that I 
would like to use CSS rather than JS!

As for my site, grab a full copy, push everything through any of the W3C 
validators, and you'll find that, yes, there are still some minor problems, like 
a "[" in a mail-to link on <http://prino.neocities.org/>, three errors on 
<http://prino.neocities.org/VHHC/VHHC%20-%20Back%20to%20home%20from%20IHHC%204.html>), 
but I think everything else checks out OK. It's only when I get really stuck 
that I turn to this group!

As for others complaining about me forcing a certain lay-out through their throats?

Mark Zelden, a person with the same status on z/OS as Jukka K. Korpela in this 
group, has this little disclaimer on his <http://www.mzelden.com/mvsutil.html> site:

About the color theme for this site: Over the years I've had a few people 
comment that they didn't like the colors on the site or it was hard to read. 
Since this is a mainframe related site, I chose the colors based on an IBM 3279 
terminal operating with extended color attributes. I appologize if it is 
difficult to read for some of you, but maybe changing the font size larger so 
the font looks more like a 3278 model 2 or model 5 terminal would help. :-)

I have no intention to behave differently with the z/OS material I'm 
(eventually) going to put onto my site. Its target audience is, as mentioned 
before, not Joe Average, and my audience is unlikely to have any problems with a 
fixed layout, as that's what we z/OS people are used to!

BTW, I ***do*** like standards, and if you look at these three pages:

http://prino.neocities.org/zOS/ehisupp.exec.none.html
http://prino.neocities.org/zOS/ehisupp.exec.edit.html
http://prino.neocities.org/zOS/ehisupp.exec.html.html

and push them through https://validator.w3.org/, you will see that all three return:

This document was successfully checked as XHTML 1.0 Strict!

But all three use JS to set the fontsize, and the third one, using some code I 
actually paid for, and told the developer to GPL it, is the one I would like to 
use, but given that its performance sort of sucks using some browsers, see 
<http://prino.neocities.org/zOS/lift.pli.html.html>, and, **strong warning** 
expect *some* browsers to not come back for a while (IE11, also scaling issues), 
or a very long while (PaleMoon 26.5.0)!), I'd love to see how the AD 2007 JS 
could be replaced by AD 2016 CSS3.

As for the "Why?" of the "...html.html" version over the two others?

....none.html is my first try, simple html, and users can cut the text, paste it 
and upload it to z/OS,

....edit.html shows the text in a format similar to that displayed by the ISPF 
editor, but here Cut will include the ISPF sequence numbers and other irrelevant 
text (which, even though it wouldn't be too hard to remove using a simple edit 
macro in the ISPF editor, sort of sucks)

....html.html was the last one I came up with and the JS included was written by 
a then fellow member of the PCG in the UK, after I piqued his interest. He came 
up with the "T" shaped screen, which emulates a standard 80-column ISPF screen, 
with a fixed top and scroll-along fixed left side (See 
<http://prino.neocities.org/zOS/ehisupc.superc.html.html> for an example of that)

The code that actually generates the HTML is written in REXX and runs on z/OS 
(and theoretically on any white-box OS that allows you to run Regina).

Is the fancy display useful?

I'll let that decision up to you, for me the fun was more concentrated in 
figuring out how to parse legacy languages, the suite of REXX execs can process 
PL/I, COBOL, REXX, JCL, and, still work in progress, the output of SuperC.

Is the resulting HTML used? Yes, there are people using the generated HTML when 
they want to show code and don't have access to a working z/OS system!

And 1) why convert it to html5? Just ask yourself, having seen my website, 2) 
why is a 56 year old still hitchhiking?

Because 1) it would be interesting to see how much simpler the source might be, 
and 2) because it's just as interesting to meet complete strangers at a petrol 
station of 03:12 in temperatures well below 0C, and finding out about what keeps 
them ticking!

Robert

PS: for those interested in the REXX code, the eight execs are also to be found 
on my site, substitute

ehisupc.exec.html
ehirexx.exec.html
ehipli.exec.html
ehinone.exec.html
ehijcl.exec.html
ehihelp.exec.html
ehicobol.exec.html
ehiasm.exec.html

for the ??? in

http://prino.neocities.org/zOS/???

PPS: I'll look into the malformed UTF characters later today, it's now 03:20 and 
I really need to get a bit of sleep
-- 
Robert AH Prins
robert(a)prino(d)org
No programming (yet) @ http://prino.neocities.org/
0
Robert
11/17/2016 1:01:01 AM
Robert Prins wrote:

> On 2016-11-16 00:25, Thomas 'PointedEars' Lahn wrote:
> > Robert Prins wrote:
> >> Excuse me, but this is NOT MY CODE! I've not coded anything yet, the
> >> code you are looking at came (maybe) from Robin Murray!!!
> >
> > *You* copied it, and *you* expected it to work.  Which would not have
> > been the case had *you* gotten yourself a minimum clue first.  You
> > should not confuse this discussion group with a free support forum for
> > Copy & Pray.
> >
> > And you should read my whole posting.
> 
> I didn't copy anything,

You posted the URIs, did you not?  You wondered why, although it appeared to 
you that it should work, you observed that it did not, did you not?

> I indicated how I wanted to present them, using the same "logic" a long
> gone site with similar content used to show them, but that I would like to
> use CSS rather than JS!

As I told you already, the original logic is flawed.  Why do you insist to 
create something based on flawed logic?
 
> As for my site, grab a full copy, […]

Thanks, but: no, thanks.

> [tl;dr]

Get a life.  And *read* *my* *whole* *posting*.

> PPS: I'll look into the malformed UTF characters later today, it's now 
> 03:20 and I really need to get a bit of sleep

It was highly illogical of you to waste a lot our and your time with this 
useless rambling, and then complain that you cannot get enough sleep.

Next time, get some sleep first, then hopefully your replies will be more 
rational.


PointedEars, shaking his head
-- 
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
  -- Richard Cornford, comp.lang.javascript, 2011-11-14
0
Thomas
11/18/2016 2:47:46 AM
On Wed, 16 Nov 2016 12:44:15 +0200, Jukka K. Korpela wrote:

> ...
> So the answer to the question how max-width may be combined with height 
> and width specifications is: don’t; just omit the height and width 
> specifications, at least when specifying max-width.

Thanks to Jukka for this advice -- and to everyone else for bandying about
other useful thoughts regarding max-width -- I've now had a chance to put
it to good use, with a small enough graphic that a browser won't need to
shilly-shally before rending it /in toto/ -- and it fulfills its promise
suberbly :-) ! Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.
0
tlvp
11/19/2016 3:47:45 AM
On Wed, 16 Nov 2016 12:44:15 +0200, Jukka K. Korpela wrote:
> So the answer to the question how max-width may be combined with height 
> and width specifications is: don?t; just omit the height and width 
> specifications, at least when specifying max-width.

Simple and elegant -- thanks!



-- 
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
                                       http://BrownMath.com/
                                  http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator:      http://validator.w3.org/
CSS 2.1 spec:   http://www.w3.org/TR/CSS21/
validator:      http://jigsaw.w3.org/css-validator/
Why We Won't Help You: http://preview.tinyurl.com/WhyWont
0
Stan
11/20/2016 12:25:47 PM
On 16/11/2016 01:06, Robert Prins wrote:
> Anyway, all of them use this little tidbit of Javascript to set the
> fontsize on the <BODY> tag:
>
> <script type="text/javascript">
> sWidth = screen.width;
> fSize = parseInt(sWidth/52);
> document.write('<style type="text/css">');
> document.write('body { font-size:'+fSize+'px; }');
> document.write('</style>');
> </script>
>
> and that shows only "half" the screen if the bookmarks sidebar is open,
> and removing the script gives me a tiny(ish) font, so
>
> How do I scale the text either without using Javascript, which obviously
> should using something other than "screen.width", or with CSS, so that
> it nicely fills the viewport, no matter what size the browser window is,
> and whether the bookmarks are in it or not.

I got the flu and I'm not thinking very lucidly and I'm too tired to 
test it thoroughly, but shouldn't:

font-size: calc(100vw / 52);
/*
http://caniuse.com/#search=calc()
*/

do the trick, at least as well or better than the script?

-- 
Best wishes, Osmo
0
Osmo
11/21/2016 8:05:18 AM
Reply: