<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Posts tagged html  - Entropy and Ecstasy</title><link>http://aaron.maenpaa.ca/blog/tags/html/</link><description>The most recent ranting and ravings of a madman.</description><lastBuildDate>Sun, 22 May 2016 05:32:35 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>How to center text vertically beside a logo?</title><link>http://aaron.maenpaa.ca/blog/entries/2015/04/24/how_to_center_text_beside_a_logo/</link><description>&lt;p&gt;You've got a sweet logo, but you want a tagline centered vertically beside it.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nt"&gt;&amp;lt;header&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;logo-container&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;logo&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;http://placehold.it/200x200&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;tagline&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Clever Tagline&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Chirs Coyier has a wonderful &lt;a class="reference external" href="https://css-tricks.com/centering-css-complete-guide/"&gt;guide to centering things&lt;/a&gt; and using the &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;translateY(-50%)&lt;/span&gt;&lt;/tt&gt; technique is appropriate here... but that puts the tagline on top of the logo rather than beside it. Moving the tagline over with the &lt;tt class="docutils literal"&gt;left&lt;/tt&gt; property puts the tagline exactly where we want it. Final CSS below (&lt;a class="reference external" href="https://jsfiddle.net/s7j136em/1/"&gt;jsfiddle&lt;/a&gt;):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nc"&gt;.logo-container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;position&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="k"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.tagline&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;position&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="k"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;top&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;transform&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-50%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c"&gt;/* move the tagline beside the logo */&lt;/span&gt;
  &lt;span class="k"&gt;left&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;200px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c"&gt;/* no margin/padding for better centering */&lt;/span&gt;
  &lt;span class="k"&gt;margin&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;padding&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
</description><guid isPermaLink="true">http://aaron.maenpaa.ca/blog/entries/2015/04/24/how_to_center_text_beside_a_logo/</guid><pubDate>Fri, 24 Apr 2015 10:47:38 GMT</pubDate></item><item><title>Don't Try to Reminplement HTML in your Rectangle of Joy (redux)</title><link>http://aaron.maenpaa.ca/blog/entries/2010/12/28/don_t_try_to_reminplement_html_in_your_rectangle_of_joy_redux/</link><description>&lt;p&gt;As a brief addendum to my previous &lt;a class="reference external" href="http://aaron.maenpaa.ca/blog/entries/2010/12/15/don_t_try_to_reminplement_html_in_your_rectangle_of_joy/"&gt;post about HTML&lt;/a&gt;, I just thought I'd point out that &lt;a class="reference external" href="https://www.google.com/webmasters/tools"&gt;Google's Webmaster Tools&lt;/a&gt; work on my phone while Bing's do not.&lt;/p&gt;
&lt;p&gt;Obviously, checking on your website from your phone may not be a core use case (after all, the only reason I know it works on my phone is that I've been travelling and just happened to try it out while away from my &amp;quot;real&amp;quot; computer) but phones and other mobile devices are an increasingly important way people use web applications. Consequently, if your web app lives inside a Flash or Silverlight rectangle you're cutting off an entire class of uses.&lt;/p&gt;
</description><guid isPermaLink="true">http://aaron.maenpaa.ca/blog/entries/2010/12/28/don_t_try_to_reminplement_html_in_your_rectangle_of_joy_redux/</guid><pubDate>Tue, 28 Dec 2010 13:21:11 GMT</pubDate></item><item><title>Don't Try to Reminplement HTML in your Rectangle of Joy</title><link>http://aaron.maenpaa.ca/blog/entries/2010/12/15/don_t_try_to_reminplement_html_in_your_rectangle_of_joy/</link><description>&lt;p&gt;I recently signed up for the &lt;a class="reference external" href="http://www.bing.com/toolbox/webmasters/"&gt;Bing Webmaster Tools&lt;/a&gt; and it prompted me to install Silverlight. I thought: &amp;quot;That's kind of weird... I'm pretty sure I've got Silverlight... I mean Netflix...&amp;quot; but I installed it, restarted my browser and... it prompted me to install Silverlight again. Okay, Silverlight doesn't work with the Firefox 4 beta, duely noted. It not working with a Firefox beta is legitimate legitimate. Even if someone in the depths of the bat-cave in Redmond has Silverlight binaries that work against the current Firefox betas, I can see not releasing them until it RC's. I get it, but it's still a lame user-experiance.&lt;/p&gt;
&lt;p&gt;I switched to Chrome, and then the real page actually rendered. Good. I started pokeing around and land on a page with a scroll bar so I tried to scroll down... and nothing happened. I tried again, nothing. I looked closer. The scroll bars are wrong, text selection doesn't work, neither does Ctrl+Click, and the text is just wrong. It's kind of &lt;em&gt;noisy&lt;/em&gt;. At this point that I realize that the whole page is Silverlight rather than just the graphs and fancy bits.&lt;/p&gt;
&lt;div class="section" id="the-take-home-lesson"&gt;
&lt;h3&gt;The Take Home Lesson&lt;/h3&gt;
&lt;blockquote&gt;
Don't try to make you're alien rectangle of joy do what HTML does.&lt;/blockquote&gt;
&lt;p&gt;The second you notice that you're headed down the road of implementing browser features in JavaScript, Flash, Silverlight or whatever, stop, turn around and start heading back, because &lt;strong&gt;here be dragons&lt;/strong&gt;. Don't try to make this work. You're not going to get it right. Microsoft didn't get it right, and they have &lt;strong&gt;way&lt;/strong&gt; more dudes than you. I'll grant you that HTML+CSS+JS might not be the most powerful client-app toolset ever imagined, I mean even getting certain things to even just line up can be a pain, and the siren song of a single place for documentation/tools must be alluring, but you're not going to get it right. Browsers do so much. They are huge pieces of software that that do all kinds of stuff and you're not going to be able to copy the behaviour people care about in any meaningful way (especially since there are ways that the browsers legitimately differ when it comes to things like &amp;quot;What happens when I right-click on a link?&amp;quot;).&lt;/p&gt;
&lt;p&gt;Play to the browsers' strengths. Laying out text? Linking pages togther? Use HTML. Save shelling out to your magical rectangle for things that browser's don't already do well (like rendering interactive 3-D environments :-). Even shelling out to Silverlight to draw graphs is kind of boarderline at this point because &lt;a class="reference external" href="http://code.google.com/p/flot/"&gt;there are&lt;/a&gt; &lt;a class="reference external" href="http://solutoire.com/flotr/"&gt;lots of&lt;/a&gt; &lt;a class="reference external" href="http://www.highcharts.com/"&gt;tools&lt;/a&gt; for drawing charts with JavaScript+HTML at this point and they will almost certainly give you a better result.&lt;/p&gt;
&lt;p&gt;Embrace your platform. Don't try to build around it, lest you end up &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Greenspun's_Tenth_Rule"&gt;re-implementing it poorly&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
</description><guid isPermaLink="true">http://aaron.maenpaa.ca/blog/entries/2010/12/15/don_t_try_to_reminplement_html_in_your_rectangle_of_joy/</guid><pubDate>Wed, 15 Dec 2010 21:22:03 GMT</pubDate></item></channel></rss>