|
|
Subscribe / Log in / New account

NoScript

NoScript

Posted Nov 17, 2017 12:04 UTC (Fri) by jpnp (guest, #63341)
In reply to: NoScript by cas
Parent article: Firefox 57

> more to the point, hard-coding specific widths in pixels for specific hardware devices is moronic - it's not a
> solution to the problem, it **IS** the problem.

> The *only* sensible ways to specify widths or heights are em units (or percentages).

In CSS lengths expressed in pixels don't map to device pixels. 1px in CSS is a device dependent number of screen pixels intended to be approximately the size of a pixel on a 100dpi device at "arms length". If your device is higher res then px should be adjusted accordingly in your user agent. If your viewing distance is not typical (such as a TV viewed from several meters) then px would map to a greater number of display pixels.

Most websites specify a maximum width for text as long lines of text are harder to read, and it's considered bad practice to set very long lines of text. It's the same reason that newspapers set text in columns, also books printed at small font sizes such as dictionaries.

It's possible your browser's idea of pixel size is not appropriate for your viewing conditions. Firefox does provide a zoom setting to compensate for this.


to post comments

NoScript

Posted Nov 18, 2017 2:12 UTC (Sat) by cas (guest, #52554) [Link]

You are missing the point. I have no objection to CSS that sets maximum widths for elements, as long as they do it using sane units like em or %, and not px. As you say, there are often good reasons for max-widths - for most things, lines that are very long are hard to read (for other things, like log files and programming code, long non-wrapped lines can be beneficial making it easier to see the structure or understand the code, or see recurring patterns in logs).

> It's possible your browser's idea of pixel size is not appropriate for your viewing conditions. Firefox does provide a zoom setting to compensate for this.

It's generally a good idea to read previous posts in a thread before commenting. that way you can avoid making a point which has already been made and then shown to not be the panacea you're suggesting it is. As noted in previous comments, zoom does not fix all problems and often (generally due to morons who specify widths and other sizes in pixels) causes other problems....e.g. a 2-3 word wide text column is at least as unreadable as a text column that is too wide. As are columns that either hide the overflow or have a horizontal scroll bar instead of wrapping text. All of which are extremely common occurrences with even moderate zoom levels.

the root causes of these problems are web designers who think that a) the design is more important than the content, and b) that the correct way to view a page is the way they envisioned it in their glorious design (including, e.g., small fonts, fashionable light-grey text on bright white or whatever) when, in fact, the correct way to view a page is however the viewer wants (or needs) to view it - and that's completely variable depending on the viewer, the device they're using and the circumstances (e.g. sometimes you're leaning forward, or in a darkened room, and small fonts aren't a problem and sometimes you're leaning back in your chair, or out in bright daylight, and need larger fonts and/or greater contrast between text & background for text to be legible).


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds