From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: On markdown images Date: Mon, 3 May 2021 12:43:24 +0700 Message-ID: References: <874kfn292f.fsf@disroot.org> <87a6pfh1dj.fsf@zoho.eu> <875z03ffhm.fsf@zoho.eu> <87y2czc68z.fsf@zoho.eu> <87k0ohorvn.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22016"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 03 07:44:09 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldRNJ-0005dS-GV for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 03 May 2021 07:44:09 +0200 Original-Received: from localhost ([::1]:57938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldRNI-0000J5-FR for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 03 May 2021 01:44:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldRMq-0000Iw-Oy for help-gnu-emacs@gnu.org; Mon, 03 May 2021 01:43:41 -0400 Original-Received: from mail-vs1-xe29.google.com ([2607:f8b0:4864:20::e29]:40599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldRMn-0001DG-Sx for help-gnu-emacs@gnu.org; Mon, 03 May 2021 01:43:40 -0400 Original-Received: by mail-vs1-xe29.google.com with SMTP id o192so2356908vsd.7 for ; Sun, 02 May 2021 22:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=QrogUrEclOhya96sopglqD8dqEJPc9bFTN3z6z3/XPc=; b=gKFxydZE/plpym1d/DIbG5AnCRAQvFYeiqsRPUTMcLOSDdPlkmdoWdzcqS/+C+EEW0 CnC60YW5VhdwxPEaBTh3klycnPYhiq5FSBTdG6GQqtI3ts4TTd16tXIc+tR2K/txWb8R xekCdY6RrSFHxnclKfkP0Lin2Mxkl0z26HvjkmKA14UR81s/1Z3//SaDIhWbvzYlDHt3 VIzAtntVvrdQjPV+89fAwkssxDTP4mGcbhSrIHy/FvjScOzrW0OiMRiDos20LVHD9OMC +AZR29ZB4UaRdICG0hzSU5ZZH7DA/+nwVymyIbIvOYOagxMip5cVxisNwuPWvAf8YNkg cP1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=QrogUrEclOhya96sopglqD8dqEJPc9bFTN3z6z3/XPc=; b=f76iv+dGIdNEFb4QIC1fC1QUG+EiSpzZ26PfandrnkrQUij/3SxNxavbrnDM44rJnJ ltTgxb9WGjOzDdY4i12zLTbeMB+FhFnlXeNvSV7fxrWxCaaPR0HfGJ5Ik1qcnKxxZmK+ /uAbQ6SqWAYgufyPKDFFBaYFIXV6vy59kZNDm/Ilmzx+Pam6WYY6F/Gi5d51vWCL/KX2 tWuonCLpXok8D7vrDNv3LujM4McEBmwFgoqTelbLKNWCxEm0sJI8z9wBvq6HklaRA2hO 5fn6oXtgrdJjGHgIjOat9z4e1cUcmsKjIEXvNz6iw5FbILwt3hfnu418xl/lc22h/Vd9 cglw== X-Gm-Message-State: AOAM530u8/gAVI1o2ObwWvk37PUMHRErAvXhqrNuUP0Wau3mxtB1ivAa pquyOTDWxyJmatIYsNofOcbYSuO0XatzgWX3EjM= X-Google-Smtp-Source: ABdhPJxVQYRs+xWUAjhuKXicK8DFaiSXtH0ePKk1IrwxVoiruzhVAxUu3oHRaoc9NHjcoZu63LWAMlr1rEwnmAe1A+c= X-Received: by 2002:a05:6102:3588:: with SMTP id h8mr14499501vsu.31.1620020616225; Sun, 02 May 2021 22:43:36 -0700 (PDT) In-Reply-To: <87k0ohorvn.fsf@zoho.eu> Received-SPF: pass client-ip=2607:f8b0:4864:20::e29; envelope-from=yurivkhan@gmail.com; helo=mail-vs1-xe29.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_05=-0.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:129365 Archived-At: On Mon, 3 May 2021 at 02:31, Emanuel Berg via Users list for the GNU Emacs text editor wrote: > I have the width here: > > .images_right { > float: right; > padding-top: 6px; > width: 206px; > } # [1] > > But the height vary from image to image, should I put it > "explicitly" as attributes in the HTML [2] then? I wouldn=E2=80=99t. Having width in CSS and height in HTML feels wrong. > OTOH to have one CSS class for every image feels ... lame. > And a lot of typing. True. I feel there are multiple distinct use cases for images, and they warrant different approaches: * Icons. You typically know the size beforehand and use the same size for all icons. So .icon { width: 24px; height: 24px; } * Large photos. You prepare them in as high resolution as possible and let the browser scale them down to fit the window: .photo { display: block; max-width: 100%; } You let the browser calculate the height on its own, accepting the layout delay. Fortunately, the visual effect of re-layout is not as annoying for block images as it would be for inline images. * Screenshots, pixel art, and line art. In contrast with photos, you typically do not want to allow arbitrary scaling for these. So you either specify the exact dimensions in HTML to help the browser lay them out, or in CSS (but this leads to one class for every image), or you let the browser sort it out on its own. (NB: The latter is bad for HiDPI screenshots, as they will be displayed at twice their natural size. Also, if displaying normal DPI pixel images at their natural size, instruct browsers on HiDPI displays to use crisp image scaling algorithm: .pixelart { image-rendering: -moz-crisp-edges; image-rendering: -webkit-optimize-contrast; } otherwise it will come out all blurry.)