Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Knute Johnson Newsgroups: comp.lang.java.programmer Subject: Re: determining screen resolution over the web Date: Thu, 31 Jul 2014 16:40:35 -0700 Organization: A noiseless patient Spider Lines: 36 Message-ID: References: <7fjlt9d0e20gdsn3feh9vlu5jq9035qofu@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 31 Jul 2014 23:40:32 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="aba33539224e5c782fe0c4053f7756fd"; logging-data="11184"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/6h6i99sr/ODg/6A1eKEOx" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 In-Reply-To: <7fjlt9d0e20gdsn3feh9vlu5jq9035qofu@4ax.com> Cancel-Lock: sha1:heNzJftBB2zA03OEaUU1wgaUV8A= Xref: csiph.com comp.lang.java.programmer:29469 On 7/31/2014 16:15, Roedy Green wrote: > On Thu, 31 Jul 2014 16:02:24 -0700, Knute Johnson > wrote, quoted or indirectly quoted someone > who said : > >> Do all your CSS in percentages rather than pixels or ems. > > Still to do it properly you have to send different content, not just > format it differently. > > You need smaller chunks with more requests for more. > > I am writing an essay on the problem at > http://mindprod.com/jgloss/multiscreen.html > I thought you were asking how to size things for a device that could have significantly different screen resolutions. If you want to determine the browser you can use the HTTP_USER_AGENT environment variable and select your response accordingly. Or as you showed above you can let the browser decide which type of device and restrict the HTML that is sent back that way. In CSS: @media print { .noprint { display: none; } } and then set the stuff you don't want printed with the class "noprint". -- Knute Johnson