<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
      <title>css on Roy Tang</title>
      <link>https://mirror.roytang.net/tags/css/</link>
      <description>Recent content in css on Roy Tang</description>
      <generator>Hugo -- gohugo.io</generator>
      <language>en-us</language>
      <managingEditor>hello@roytang.net (Roy Tang)</managingEditor>
      <webMaster>hello@roytang.net (Roy Tang)</webMaster>
      <lastBuildDate>Wed, 01 Jul 2020 00:00:00 +0000</lastBuildDate>
      
          <atom:link href="https://mirror.roytang.net/tags/css/index.xml" rel="self" type="application/rss+xml" />
      
          
      
        <item>
            <title>Image Lightboxes using HTML/CSS
</title>
            <link>https://mirror.roytang.net/2020/07/image-lightboxes-using-html/css/</link>
            <pubDate>Wed, 01 Jul 2020 00:00:00 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2020/07/image-lightboxes-using-html/css/</guid>
            <description>
            
            &lt;p&gt;In several places on this site (like if you click &lt;a href=&#34;https://mirror.roytang.net/photos/&#34;&gt;Photos&lt;/a&gt; in the menu up top), I have a grid-like view of a list of photos/images:&lt;/p&gt;











&lt;a href=&#34;#faccc892f8e2cf4a4264858849ce5ae2-lightbox&#34;&gt;
    &lt;figure&gt;
      &lt;img src=&#34;https://mirror.roytang.net/2020/07/image-lightboxes-using-html/css/photos_hua697e57b9c5f61f8be116df80d63f53b_922940_300x0_resize_box_2.png&#34; alt=&#34;&#34; title=&#34;&#34; class=&#34;tn&#34; /&gt;
      &lt;figcaption&gt; (Click to view full-size)&lt;/figcaption&gt;
    &lt;/figure&gt;
&lt;/a&gt;
&lt;div class=&#34;lightbox&#34; id=&#34;faccc892f8e2cf4a4264858849ce5ae2-lightbox&#34; style=&#34;display: none;&#34;&gt;
  &lt;a href=&#34;#_&#34;&gt;
    &lt;img src=&#34;https://mirror.roytang.net/2020/07/image-lightboxes-using-html/css/photos.png&#34; /&gt;
  &lt;/a&gt;
  &lt;div class=&#34;lightbox_overlay&#34;&gt;
    &lt;p&gt;&lt;/p&gt;
    &lt;time class=&#34;dt-published&#34; datetime=&#34;1 Jul 2020 12:00am&#34;&gt;1 Jul 2020 12:00am&lt;/time&gt;&lt;a href=&#34;#_&#34;&gt;Close&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;I used to just have each thumbnail open the post permalink on click, with the anchor set to the image itself. The image would be shown in full size inline of the post. This was a bit clunky and not so modern, so I decided to implement it so that the image lists instead will show a &lt;a href=&#34;https://en.wikipedia.org/wiki/Lightbox_%28JavaScript%29&#34;&gt;Lightbox&lt;/a&gt;-style overlay with the full image and some details and an option to click through to the post. That looks a little something like this:&lt;/p&gt;











&lt;a href=&#34;#69db43a1058dcdddf90179b43e7ecf6d-lightbox&#34;&gt;
    &lt;figure&gt;
      &lt;img src=&#34;https://mirror.roytang.net/2020/07/image-lightboxes-using-html/css/lightbox_hu396d03ff45b11c54616c22d72e1875ca_532641_300x0_resize_box_2.png&#34; alt=&#34;&#34; title=&#34;&#34; class=&#34;tn&#34; /&gt;
      &lt;figcaption&gt; (Click to view full-size)&lt;/figcaption&gt;
    &lt;/figure&gt;
&lt;/a&gt;
&lt;div class=&#34;lightbox&#34; id=&#34;69db43a1058dcdddf90179b43e7ecf6d-lightbox&#34; style=&#34;display: none;&#34;&gt;
  &lt;a href=&#34;#_&#34;&gt;
    &lt;img src=&#34;https://mirror.roytang.net/2020/07/image-lightboxes-using-html/css/lightbox.png&#34; /&gt;
  &lt;/a&gt;
  &lt;div class=&#34;lightbox_overlay&#34;&gt;
    &lt;p&gt;&lt;/p&gt;
    &lt;time class=&#34;dt-published&#34; datetime=&#34;1 Jul 2020 12:00am&#34;&gt;1 Jul 2020 12:00am&lt;/time&gt;&lt;a href=&#34;#_&#34;&gt;Close&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Now, in the olden days doing this sort of thing required JavaScript (as described in the wikipedia link above to Lightbox). But for the modern web, this can be achieved using HTML and CSS only. The method is described in &lt;a href=&#34;https://jlelse.blog/dev/css-lightbox-hugo/&#34;&gt;this blog post by jlelse&lt;/a&gt;, specifically for use in Hugo themes. The CSS technique is relatively straightforward: you generate two images, a thumbnail, and a hidden full-size one in an overlay. The thumbnail is wrapped in an anchor pointing to the id of the hidden overlay, and the overlay gets displayed via the &lt;code&gt;:target&lt;/code&gt; CSS pseudo-selector.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s how that looks in this site&amp;rsquo;s current Hugo templates:&lt;/p&gt;
&lt;p&gt;( &lt;code&gt;.context&lt;/code&gt; is the original image resource, and &lt;code&gt;$thumb&lt;/code&gt; is the generated thumbnail)&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-go-html-template&#34; data-lang=&#34;go-html-template&#34;&gt;&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;href&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;#&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;{{&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;.context.RelPermalink&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;md5&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;}}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;-lightbox&amp;#34;&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;figure&lt;/span&gt;&amp;gt;
      &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;img&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;src&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;{{&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;$thumb&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;.RelPermalink&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;}}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;alt&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;{{&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;$figcaption&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;}}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; 
        &lt;span style=&#34;color:#a6e22e&#34;&gt;title&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;{{&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;$figcaption&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;}}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;tn&amp;#34;&lt;/span&gt; /&amp;gt;
    &amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;figure&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;div&lt;/span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;lightbox&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;{{&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;.context.RelPermalink&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;md5&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;}}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;-lightbox&amp;#34;&lt;/span&gt;&amp;gt;
  &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;href&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;#_&amp;#34;&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;img&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;src&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;{{&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;.context.RelPermalink&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;safeURL&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;}}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; /&amp;gt;
  &amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt;&amp;gt;
  &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;div&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;lightbox_overlay&amp;#34;&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;p&lt;/span&gt;&amp;gt;&lt;span style=&#34;color:#75715e&#34;&gt;{{&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;$figcaption&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;}}&lt;/span&gt;&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;p&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;time&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;dt-published&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;datetime&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;{{&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;.postDate&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;}}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&amp;gt;&lt;span style=&#34;color:#75715e&#34;&gt;{{&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;.postDate&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;}}&lt;/span&gt;&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;time&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;href&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;{{&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;.mainPermalink&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;}}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&amp;gt;View post&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;href&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;#_&amp;#34;&lt;/span&gt;&amp;gt;Close&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt;&amp;gt;
  &amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;div&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;div&lt;/span&gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And the relevant CSS (I don&amp;rsquo;t use SASS):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-css&#34; data-lang=&#34;css&#34;&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;lightbox&lt;/span&gt; {
	&lt;span style=&#34;color:#66d9ef&#34;&gt;display&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;none&lt;/span&gt;;
	&lt;span style=&#34;color:#66d9ef&#34;&gt;position&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;fixed&lt;/span&gt;;
	&lt;span style=&#34;color:#66d9ef&#34;&gt;top&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;;
	&lt;span style=&#34;color:#66d9ef&#34;&gt;left&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;;
	&lt;span style=&#34;color:#66d9ef&#34;&gt;right&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;;
	&lt;span style=&#34;color:#66d9ef&#34;&gt;bottom&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;;
	&lt;span style=&#34;color:#66d9ef&#34;&gt;z-index&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;999&lt;/span&gt;;
	&lt;span style=&#34;color:#66d9ef&#34;&gt;width&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;vw&lt;/span&gt;;
	&lt;span style=&#34;color:#66d9ef&#34;&gt;height&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;vh&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;background&lt;/span&gt;: rgba(&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;,&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;,&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;,&lt;span style=&#34;color:#ae81ff&#34;&gt;0.8&lt;/span&gt;);
}
.&lt;span style=&#34;color:#a6e22e&#34;&gt;lightbox_overlay&lt;/span&gt; {
    &lt;span style=&#34;color:#66d9ef&#34;&gt;position&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;fixed&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;z-index&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;1000&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;bottom&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;width&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;%&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;background&lt;/span&gt;: rgba(&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;,&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;,&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;,&lt;span style=&#34;color:#ae81ff&#34;&gt;0.6&lt;/span&gt;);
    &lt;span style=&#34;color:#66d9ef&#34;&gt;padding-bottom&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;rem&lt;/span&gt;;
}
.&lt;span style=&#34;color:#a6e22e&#34;&gt;lightbox_overlay&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; {
    &lt;span style=&#34;color:#66d9ef&#34;&gt;padding&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;rem&lt;/span&gt;;
}
.&lt;span style=&#34;color:#a6e22e&#34;&gt;lightbox&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;img&lt;/span&gt; {
    &lt;span style=&#34;color:#66d9ef&#34;&gt;position&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;absolute&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;top&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;left&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;right&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;bottom&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;margin&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;auto&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;max-width&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;%&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;max-height&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;%&lt;/span&gt;;
}
.&lt;span style=&#34;color:#a6e22e&#34;&gt;lightbox&lt;/span&gt;:&lt;span style=&#34;color:#a6e22e&#34;&gt;target&lt;/span&gt; {
    &lt;span style=&#34;color:#66d9ef&#34;&gt;outline&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;none&lt;/span&gt;;
    &lt;span style=&#34;color:#66d9ef&#34;&gt;display&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;block&lt;/span&gt;;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;My only changes on top of the jlelse&amp;rsquo;s blog post linked above was to add a second overlay for a caption and date to be shown, and a link to the original post, and a close button. Clicking the post itself also dismisses the overlay (by replacing the URL fragment), but I thought it was more usable to also add an obvious Close button. I also initially wanted to put &amp;ldquo;Previous&amp;rdquo; and &amp;ldquo;Next&amp;rdquo; buttons so that you can easily cycle through the images in a post, but this was a bit more effort. I didn&amp;rsquo;t have a way to &amp;ldquo;look ahead&amp;rdquo; in the loop to get the &amp;ldquo;next&amp;rdquo; image, if any, so I think I would have needed to loop through the images twice? And since I use this image list in a number of places on the site, that was a bit troublesome, so maybe it&amp;rsquo;s something I&amp;rsquo;ll attempt later on?&lt;/p&gt;
&lt;p&gt;In any case, I think the new lightboxes are neat!&lt;/p&gt;



&lt;img src=&#34;https://mirror.roytang.net/2020/07/image-lightboxes-using-html/css/lightbox_hu396d03ff45b11c54616c22d72e1875ca_532641_300x0_resize_box_2.png&#34; /&gt;



&lt;img src=&#34;https://mirror.roytang.net/2020/07/image-lightboxes-using-html/css/photos_hua697e57b9c5f61f8be116df80d63f53b_922940_300x0_resize_box_2.png&#34; /&gt;



            </description>
        </item>
    
        <item>
            <title>Pure CSS Spoilers
</title>
            <link>https://mirror.roytang.net/2020/03/pure-css-spoilers/</link>
            <pubDate>Thu, 05 Mar 2020 00:00:00 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2020/03/pure-css-spoilers/</guid>
            <description>
            
            &lt;p&gt;Edit 2020/04/17: A month and a half later, I found &lt;a href=&#34;https://mirror.roytang.net/2020/04/pure-html-toggles/&#34;&gt;a better way to do this&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;I previously had some post that had some &lt;a href=&#34;https://mirror.roytang.net/2018/10/october-2018-watching-lately&#34;&gt;content hidden via spoiler tags&lt;/a&gt;, using a custom Hugo shortcode. Since I&amp;rsquo;m an &lt;a href=&#34;https://mirror.roytang.net/2020/02/old-web/&#34;&gt;old-school developer&lt;/a&gt; I was previously doing this using some Javascript run on load:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;elements&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; document.&lt;span style=&#34;color:#a6e22e&#34;&gt;querySelectorAll&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;.spoiler_header&amp;#34;&lt;/span&gt;);
    Array.&lt;span style=&#34;color:#a6e22e&#34;&gt;prototype&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;forEach&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;call&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;elements&lt;/span&gt;, &lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;el&lt;/span&gt;, &lt;span style=&#34;color:#a6e22e&#34;&gt;i&lt;/span&gt;) {
        &lt;span style=&#34;color:#a6e22e&#34;&gt;el&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;addEventListener&lt;/span&gt;( &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;click&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#66d9ef&#34;&gt;function&lt;/span&gt;( &lt;span style=&#34;color:#a6e22e&#34;&gt;event&lt;/span&gt; ) {
            &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;nextEl&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;el&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;nextElementSibling&lt;/span&gt;;
            &lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;display&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;getComputedStyle&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;nextEl&lt;/span&gt;)[&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;display&amp;#39;&lt;/span&gt;];
            &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; (&lt;span style=&#34;color:#a6e22e&#34;&gt;display&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;none&amp;#39;&lt;/span&gt;) {
                &lt;span style=&#34;color:#a6e22e&#34;&gt;nextEl&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;style&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;display&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;block&amp;#39;&lt;/span&gt;;
            } &lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt; {
                &lt;span style=&#34;color:#a6e22e&#34;&gt;nextEl&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;style&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;display&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;none&amp;#39;&lt;/span&gt;;
            }
        }, &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;);        
    });
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is the modern age however. We should really be trying to minimize our Javascript on the non-app public web as much as possible, so I decided to change it to a Pure CSS solution. Here&amp;rsquo;s a quick demo:&lt;/p&gt;
&lt;details class=&#34;spoiler&#34;&gt;
    &lt;summary&gt;(Spoilers)&lt;/summary&gt;
    This is hidden text!
&lt;/details&gt;
&lt;p /&gt;
&lt;p&gt;The Pure CSS solution uses the following HTML (including Hugo shortcode macros, should be easy to understand; .Inner is the actual spoiler content.):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;div&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;spoiler_container&amp;#34;&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;spoiler_link&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;href&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;#spoiler-{{ $id }}&amp;#34;&lt;/span&gt;&amp;gt;(Spoilers)&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt;&amp;gt; 
    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;spoiler_target&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;id&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;spoiler-{{ $id }}&amp;#34;&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;div&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;spoiler&amp;#34;&lt;/span&gt;&amp;gt;{{ .Inner }} &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;href&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;#&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;hide_spoiler&amp;#34;&lt;/span&gt;&amp;gt;Hide Spoilers&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;a&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;div&lt;/span&gt;&amp;gt;    
&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;div&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;p&lt;/span&gt; /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The CSS for this toggle is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-css&#34; data-lang=&#34;css&#34;&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;spoiler&lt;/span&gt; {
    &lt;span style=&#34;color:#66d9ef&#34;&gt;display&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;none&lt;/span&gt;;
}
.&lt;span style=&#34;color:#a6e22e&#34;&gt;spoiler_target&lt;/span&gt;:&lt;span style=&#34;color:#a6e22e&#34;&gt;target&lt;/span&gt; {
    &lt;span style=&#34;color:#66d9ef&#34;&gt;position&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;fixed&lt;/span&gt;;
}
.&lt;span style=&#34;color:#a6e22e&#34;&gt;spoiler_target&lt;/span&gt;:&lt;span style=&#34;color:#a6e22e&#34;&gt;target&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; .&lt;span style=&#34;color:#a6e22e&#34;&gt;spoiler&lt;/span&gt; {
    &lt;span style=&#34;color:#66d9ef&#34;&gt;display&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;inline&lt;/span&gt;;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Basically, this takes advantage of the &lt;code&gt;:target&lt;/code&gt; CSS pseudo-selector. The &amp;ldquo;(Spoiler)&amp;rdquo; anchor changes the URL hash to point to the id of the &lt;code&gt;spoiler_target&lt;/code&gt; element, and we use the CSS &lt;code&gt;+&lt;/code&gt; operator to display the actual spoiler content when the &lt;code&gt;:target&lt;/code&gt; pseudo-selector is activated. I originally tried it with the id being assigned directly to the spoiler content, but this had the problem of &amp;ldquo;jumping around&amp;rdquo;, i.e. clicking the &amp;ldquo;(Spoiler)&amp;rdquo; link would scroll the page to the anchor location. The workaround for this was separating the target anchor from the spoiler content, making the anchor hidden (no text) and adding &lt;code&gt;position:fixed&lt;/code&gt; (to prevent the scrolling). The &amp;ldquo;Hide&amp;rdquo; link simply sets the URL hash location back to &amp;ldquo;#&amp;rdquo;.&lt;/p&gt;



            </description>
        </item>
    
        <item>
            <title>New note
</title>
            <link>https://mirror.roytang.net/2017/07/45113755/</link>
            <pubDate>Sat, 15 Jul 2017 02:04:29 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2017/07/45113755/</guid>
            <description>
            

            &lt;p&gt;I&amp;rsquo;m trying out jsplumb. I have a copy of this demo: &lt;a href=&#34;https://jsplumbtoolkit.com/community/demo/statemachine/index.html&#34;&gt;https://jsplumbtoolkit.com/community/demo/statemachine/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In this demo, when I drag one of the nodes outside of the canvas boundary, a scrollbar appears to indicate the canvas area has expanded. However, I still have to manually scroll the view to see the dragged node.&lt;/p&gt;
&lt;p&gt;I would like the view to automatically scroll when I drag a node beyond the edge. Same thing when dragging a new connector, I would like to automatically scroll the view - so I can choose to connect to a node currently outside the visible area. Any advice on how to do this?&lt;/p&gt;
&lt;p&gt;Secondary question: In the demo above the scrollbars appear as expected when I drag elements off the right or bottom of the canvas, but not when I drag them off the left edge or off the top edge. That is, if I drag a node upward off the canvas and drop it there, I no longer have any way of viewing that node or dragging it back down. Is there a way around this?&lt;/p&gt;



            </description>
        </item>
    
        <item>
            <title>New note
</title>
            <link>https://mirror.roytang.net/2011/10/7871245/</link>
            <pubDate>Mon, 24 Oct 2011 04:17:49 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2011/10/7871245/</guid>
            <description>
            

            &lt;p&gt;I&amp;rsquo;m trying to build a CSS-based menu. I want it to be able to adjust when the browser resizes so I&amp;rsquo;m using floats to wrap the menu items to the next line as needed. However, I want to have an extra buffer cell at the end to round out the menu appearance, see the sample image below (this an image the designer made from photoshop).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://i.stack.imgur.com/yWkZj.png&#34; alt=&#34;Example here&#34;&gt;&lt;/p&gt;
&lt;p&gt;I can set the background image of the containing div to fake it (using the clearing floats trick I found at &lt;a href=&#34;http://quirksmode.org/css/clearing.html),&#34;&gt;http://quirksmode.org/css/clearing.html),&lt;/a&gt; but then I have the additional problem of having extra space on the right side because I the cited trick says I should set the width to 100% on the container. (see image below)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://i.stack.imgur.com/1LKIQ.png&#34; alt=&#34;enter image description here&#34;&gt;&lt;/p&gt;
&lt;p&gt;I also don&amp;rsquo;t have any borders on that extra area after the last item. So, what&amp;rsquo;s the proper way to go about this? Can anyone suggest any good online implementations I can check?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;



            </description>
        </item>
    
        <item>
            <title>New note
</title>
            <link>https://mirror.roytang.net/2010/07/3308615/</link>
            <pubDate>Thu, 22 Jul 2010 12:06:37 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2010/07/3308615/</guid>
            <description>
            

            &lt;p&gt;Say I have the following HTML:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;head&amp;gt;
    &amp;lt;style&amp;gt;
        #container {
            border: 1px red solid;
        }
        .floaty {
            width: 200px;
            float: left;
            border: 1px green solid;
        }
    &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;div id=&#39;container&#39;&amp;gt;
    Text inside the container
    &amp;lt;div class=&#39;floaty&#39;&amp;gt;
    Floaty block 1&amp;lt;br/&amp;gt;
    Floaty block 1&amp;lt;br/&amp;gt;
    Floaty block 1&amp;lt;br/&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class=&#39;floaty&#39;&amp;gt;
    Floaty block 2&amp;lt;br/&amp;gt;
    Floaty block 2&amp;lt;br/&amp;gt;
    Floaty block 2&amp;lt;br/&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class=&#39;floaty&#39;&amp;gt;
    Floaty block 3&amp;lt;br/&amp;gt;
    Floaty block 3&amp;lt;br/&amp;gt;
    Floaty block 3&amp;lt;br/&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This renders as: &lt;img src=&#34;https://i.stack.imgur.com/Ci22u.png&#34; alt=&#34;floaty divs&#34;&gt;&lt;/p&gt;
&lt;p&gt;What&amp;rsquo;s the proper CSS way to have the container (red-bordered box) completely surround the floaty green-bordered boxes?&lt;/p&gt;



            </description>
        </item>
    
        <item>
            <title>Reply to &#39;position:fixed in IE&#39; on stackoverflow at https://stackoverflow.com/questions/2013072/positionfixed-in-ie:
</title>
            <link>https://mirror.roytang.net/2010/01/2013117/</link>
            <pubDate>Wed, 06 Jan 2010 13:17:25 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2010/01/2013117/</guid>
            <description>
            Reply to &amp;#39;position:fixed in IE&amp;#39; on stackoverflow at https://stackoverflow.com/questions/2013072/positionfixed-in-ie:

            &lt;p&gt;position: fixed is not supported by IE before version 7. There are workarounds, easily &lt;a href=&#34;http://www.google.com.ph/search?rlz=1C1CHMP_enPH291PH303&amp;amp;sourceid=chrome&amp;amp;ie=UTF-8&amp;amp;q=internet+explorer+position:+fixed+css&#34;&gt;googlable&lt;/a&gt;:&lt;/p&gt;



            </description>
        </item>
    
        <item>
            <title>New note
</title>
            <link>https://mirror.roytang.net/2009/12/1830908/</link>
            <pubDate>Wed, 02 Dec 2009 05:52:26 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2009/12/1830908/</guid>
            <description>
            

            &lt;p&gt;Let&amp;rsquo;s say I have a series of &lt;li&gt; elements designed to render via float:left inside a fixed-width container as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Item 1 | Item 2 | Item 3 | Item 4
| Item 5 | Item 6
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is fine, Item 5 and Item 6 are pushed to the second row because the container has a fixed width.&lt;/p&gt;
&lt;p&gt;Now, is it possible to have something similar to above, except that majority of the items will render in the second row? Something like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Item 1 | Item 2 
| Item 3 | Item 4| Item 5 | Item 6
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Basically, I want to render a list of items horizontally, wrapping to the second row as needed, but with majority of the items on the second row if it exists. The number of items to be generated may vary, but will not exceed 2 rows&amp;rsquo; worth of items.&lt;/p&gt;



            </description>
        </item>
    
        <item>
            <title>New note
</title>
            <link>https://mirror.roytang.net/2009/09/1491562/</link>
            <pubDate>Tue, 29 Sep 2009 09:43:10 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2009/09/1491562/</guid>
            <description>
            

            &lt;p&gt;HTML/Javascript - I want to load images dynamically, and the images I&amp;rsquo;m going to load can be of varying aspect ratios.&lt;/p&gt;
&lt;p&gt;I want the images to fit into a specific area of the containing div - an area 40% of the containing div&amp;rsquo;s width and 80% of its height. Since they have varying aspect ratios, of course they will not always use up this entire area, but I want to resize them such that they don&amp;rsquo;t exceed the bounds. But I don&amp;rsquo;t know ahead of time whether I should specify the width or the height (and the partner attribute to auto) since I don&amp;rsquo;t know what the aspect ratio of the images will be ahead of time.&lt;/p&gt;
&lt;p&gt;Is there a CSS way to do this? Or I need to compute the required widths using javascript?&lt;/p&gt;
&lt;p&gt;PS I only need to do this in Firefox 3.5!&lt;/p&gt;



            </description>
        </item>
    
        <item>
            <title>New note
</title>
            <link>https://mirror.roytang.net/2009/07/1123415/</link>
            <pubDate>Tue, 14 Jul 2009 04:23:32 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2009/07/1123415/</guid>
            <description>
            

            &lt;p&gt;Say I had the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;select disabled=&amp;quot;disabled&amp;quot; style=&amp;quot;border: 1px red solid; color: black;&amp;quot;&amp;gt;
&amp;lt;option&amp;gt;ABC&amp;lt;/option&amp;gt;
&amp;lt;/select&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Firefox renders the above with a red border and black text as I expect; but IE does not, it seems to be using native colors for the border and the disabled text. Is there any way for me to be able to style it?&lt;/p&gt;
&lt;p&gt;For edit boxes my workaround was to use readOnly instead of disabled so that I can style it, but it seems for combo boxes the readOnly attribute has no effect.&lt;/p&gt;
&lt;p&gt;Note: I only need this to work in IE (it&amp;rsquo;s for an intranet webapp where users must use IE), so IE-specific solutions are fine.&lt;/p&gt;



            </description>
        </item>
    
        <item>
            <title>New note
</title>
            <link>https://mirror.roytang.net/2009/06/1047137/</link>
            <pubDate>Fri, 26 Jun 2009 03:07:21 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2009/06/1047137/</guid>
            <description>
            

            &lt;p&gt;Specifically, say I have a string like ABC-123-NNN. I would like the paragraph to have line breaks, but &lt;b&gt;not&lt;/b&gt; to break at the dashes.&lt;/p&gt;
&lt;p&gt;i.e. if my text is &amp;ldquo;The serial number ABC-123-NNN is not valid&amp;rdquo;, I would like to keep together the entire serial number if it exceeds the container width.&lt;/p&gt;
&lt;p&gt;So the following is ok:&lt;/p&gt;
&lt;pre&gt;
  The serial number 
  ABC-123-NNN is not 
  valid
&lt;/pre&gt;
&lt;p&gt;But the following (which is the behavior of IE6) is not:&lt;/p&gt;
&lt;pre&gt;
  The serial number ABC-
  123-NNN is not valid
&lt;/pre&gt;
&lt;p&gt;Currently IE seems to break at dashes. Is there any applicable CSS or whatever I can apply to avoid it?&lt;/p&gt;



            </description>
        </item>
    
        <item>
            <title>New note
</title>
            <link>https://mirror.roytang.net/2008/12/376725/</link>
            <pubDate>Thu, 18 Dec 2008 02:28:56 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2008/12/376725/</guid>
            <description>
            

            &lt;p&gt;I&amp;rsquo;m not sure if this a settings problem or an HTML problem, but on a page layout I&amp;rsquo;m working on, Firefox does not render the stylesheet immediately. Meaning for maybe half a second I can see the unstyled page, then the stylesheet kicks in and it renders as I expect.&lt;/p&gt;
&lt;p&gt;All my stylesheets are in external css files loaded in the head tag. I&amp;rsquo;m not encountering this on Flock (which is a Firefox variant) nor on Google Chrome/IE.&lt;/p&gt;
&lt;p&gt;Any idea how to avoid it?&lt;/p&gt;



            </description>
        </item>
    
        <item>
            <title>Exceptional Performance - Yahoo Web Performance Team
</title>
            <link>https://mirror.roytang.net/2008/07/exceptional-performance-yahoo-web-performance-team/</link>
            <pubDate>Sun, 20 Jul 2008 12:53:43 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2008/07/exceptional-performance-yahoo-web-performance-team/</guid>
            <description>
            Shared via delicious:
    &lt;a href=&#34;http://developer.yahoo.com/performance/&#34;&gt;Exceptional Performance - Yahoo Web Performance Team&lt;/a&gt;

            


            </description>
        </item>
    
        <item>
            <title>blueprintcss - Google Code
</title>
            <link>https://mirror.roytang.net/2008/06/blueprintcss-google-code/</link>
            <pubDate>Sun, 01 Jun 2008 15:08:47 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2008/06/blueprintcss-google-code/</guid>
            <description>
            Shared via delicious:
    &lt;a href=&#34;http://code.google.com/p/blueprintcss/&#34;&gt;blueprintcss - Google Code&lt;/a&gt;

            


            </description>
        </item>
    
        <item>
            <title>Floatutorial: Step by step CSS float tutorial
</title>
            <link>https://mirror.roytang.net/2006/04/floatutorial-step-by-step-css-float-tutorial/</link>
            <pubDate>Wed, 19 Apr 2006 14:52:44 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2006/04/floatutorial-step-by-step-css-float-tutorial/</guid>
            <description>
            Shared via delicious:
    &lt;a href=&#34;http://css.maxdesign.com.au/floatutorial/index.htm&#34;&gt;Floatutorial: Step by step CSS float tutorial&lt;/a&gt;

            


            </description>
        </item>
    
        <item>
            <title>intensivstation :: CSS Templates :: Templates
</title>
            <link>https://mirror.roytang.net/2006/01/intensivstation-css-templates-templates/</link>
            <pubDate>Tue, 10 Jan 2006 12:42:06 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2006/01/intensivstation-css-templates-templates/</guid>
            <description>
            Shared via delicious:
    &lt;a href=&#34;http://www.intensivstation.ch/en/templates/&#34;&gt;intensivstation :: CSS Templates :: Templates&lt;/a&gt;

            


            </description>
        </item>
    
        <item>
            <title>CSS tips and tricks
</title>
            <link>https://mirror.roytang.net/2005/06/css-tips-and-tricks/</link>
            <pubDate>Fri, 10 Jun 2005 16:05:07 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2005/06/css-tips-and-tricks/</guid>
            <description>
            Shared via delicious:
    &lt;a href=&#34;http://www.456bereastreet.com/archive/200503/css_tips_and_tricks_part_1.html#3958&#34;&gt;CSS tips and tricks&lt;/a&gt;

            


            </description>
        </item>
    
        <item>
            <title>Test stuff
</title>
            <link>https://mirror.roytang.net/2005/05/test-stuff/</link>
            <pubDate>Wed, 11 May 2005 15:58:42 +0000</pubDate>
            <author>hello@roytang.net (Roy Tang)</author>
            <guid>https://mirror.roytang.net/2005/05/test-stuff/</guid>
            <description>
            Shared via delicious:
    &lt;a href=&#34;http://ktk.xs4all.nl/stuff/&#34;&gt;Test stuff&lt;/a&gt;

            &lt;p&gt;HTML, CSS, Javascript, etc.  tricks&lt;/p&gt;



            </description>
        </item>
    
    </channel>
  </rss>