<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[CSS - All your code are belong to us]]></title><description><![CDATA[Thoughts, stories and ideas on code and technology in general.<br>Blog title inspired by <a href="https://en.wikipedia.org/wiki/All_your_base_are_belong_to_us" target="_blank">this meme</a>]]></description><link>https://allurcode.com/</link><image><url>https://allurcode.com/favicon.png</url><title>CSS - All your code are belong to us</title><link>https://allurcode.com/</link></image><generator>Ghost 4.48</generator><lastBuildDate>Tue, 09 Jun 2026 12:18:40 GMT</lastBuildDate><atom:link href="https://allurcode.com/tag/css/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[CSS Triangle]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Really simple triangles working in all major browsers, including IE6+.</p>
<h3 id="html">HTML</h3>
<p>No surprises here. Our HTML is as simple as that.</p>
<pre><code class="language-html">&lt;div class=&quot;arrow_top&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;arrow_right&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;arrow_bottom&quot;</code></pre>]]></description><link>https://allurcode.com/css-triangle/</link><guid isPermaLink="false">5b7b0aa2b52b43084c9ea141</guid><category><![CDATA[CSS]]></category><category><![CDATA[HTML]]></category><category><![CDATA[triangle]]></category><dc:creator><![CDATA[Wojtek]]></dc:creator><pubDate>Mon, 31 Oct 2011 21:58:17 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Really simple triangles working in all major browsers, including IE6+.</p>
<h3 id="html">HTML</h3>
<p>No surprises here. Our HTML is as simple as that.</p>
<pre><code class="language-html">&lt;div class=&quot;arrow_top&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;arrow_right&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;arrow_bottom&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;arrow_right&quot;&gt;&lt;/div&gt;
</code></pre>
<h3 id="css">CSS</h3>
<p>The trick is to create an element with zero width and height. The actual size will be determined by the element&#x2019;s borders. For example, up arrow has top and bottom borders set as transparent and the left border with a solid colour. Imagine it as drawing an arrow where its pointing corner is our zero dimensions div element.</p>
<h2 id="examples">Examples</h2>
<style>
.arrow_top {
	width:0;
	height:0;
	border-left:30px solid transparent;
	border-right:30px solid transparent;
	border-bottom:30px solid #ff9600;
	margin-bottom:10px;
}
.arrow_right {
	width:0;
	height:0;
	border-top:30px solid transparent;
	border-bottom:30px solid transparent;
	border-left:30px solid #ff9600;
	margin-bottom:10px;
}
.arrow_bottom {
	width:0;
	height:0;
	border-left:30px solid transparent;
	border-right:30px solid transparent;
	border-top:30px solid #ff9600;
	margin-bottom:10px;
}
.arrow_left {
	width:0;
	height:0;
	border-top:30px solid transparent;
	border-bottom:30px solid transparent;
	border-right:30px solid #ff9600;
	margin-bottom:10px;
}
.arrow_top_filled {
	width:5px;
	height:5px;
	border-left:30px solid #222;
	border-right:30px solid #222;
	border-bottom:30px solid #ff9600;
	margin-bottom:10px;
}
.arrow_top_right {
	width:0;
	height:0;
	border-bottom:30px solid transparent;
	border-left:30px solid transparent;
	border-right:30px solid #ff9600;
	margin-bottom:10px;
}
</style>
<h3 id="arrowtop">Arrow top</h3>
<div class="arrow_top"></div>
<pre><code class="language-css">.arrow_top {
  width:0;
  height:0;
  border-top:30px solid transparent;
  border-bottom:30px solid transparent;
  border-left:30px solid #ff9600;
}
</code></pre>
<h3 id="arrowright">Arrow right</h3>
<div class="arrow_right"></div>
<pre><code class="language-css">.arrow_right {
  width:0;
  height:0;
  border-top:30px solid transparent;
  border-bottom:30px solid transparent;
  border-left:30px solid #ff9600;
  margin-bottom:10px;
}
</code></pre>
<h3 id="arrowbottom">Arrow bottom</h3>
<div class="arrow_bottom"></div>
<pre><code class="language-css">.arrow_bottom {
  width:0;
  height:0;
  border-left:30px solid transparent;
  border-right:30px solid transparent;
  border-top:30px solid #ff9600;
  margin-bottom:10px;
}
</code></pre>
<h3 id="arrowleft">Arrow left</h3>
<div class="arrow_left"></div>
<pre><code class="language-css">.arrow_left {
  width:0;
  height:0;
  border-top:30px solid transparent;
  border-bottom:30px solid transparent;
  border-right:30px solid #ff9600;
  margin-bottom:10px;
}
</code></pre>
<h3 id="arrowtopwithnontransparentbordersandpointingcornerisa5px5pxdiv">Arrow top with non transparent borders and pointing corner is a 5px / 5px div</h3>
<div class="arrow_top_filled"></div>
<pre><code class="language-css">.arrow_top_filled {
  width:5px;
  height:5px;
  border-left:30px solid #222;
  border-right:30px solid #222;
  border-bottom:30px solid #ff9600;
  margin-bottom:10px;
}
</code></pre>
<h3 id="arrowtopright">Arrow top right</h3>
<div class="arrow_top_right"></div>
<pre><code class="language-css">.arrow_top_right {
  width:0;
  height:0;
  border-bottom:30px solid transparent;
  border-left:30px solid transparent;
  border-right:30px solid #ff9600;
  margin-bottom:10px;
}
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Hot off the workshop vol. 2]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p><img src="https://allurcode.com/content/images/2011/03/tkmaxx_rebrand.jpg" alt="TK Maxx website rebranding" title="TK Maxx website rebranding" loading="lazy"></p>
<p>Website redesign for TK Maxx. Launched just yesterday.<br>
Venda coding all the way in the back end and HTML, JavaScript and CSS in the front end.<br>
<a href="https://www.tkmaxx.com/">Visit live site</a></p>
<h3 id="whativelearnt">What I&#x2019;ve learnt</h3>
<p>The biggest challenge was to make the site work in Internet Explorer 6 and 7. One</p>]]></description><link>https://allurcode.com/hot-off-the-workshop-vol-2/</link><guid isPermaLink="false">5b7b0aa2b52b43084c9ea138</guid><category><![CDATA[CSS]]></category><category><![CDATA[HTML]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[TK Maxx]]></category><category><![CDATA[Venda]]></category><dc:creator><![CDATA[Wojtek]]></dc:creator><pubDate>Tue, 22 Mar 2011 22:45:50 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p><img src="https://allurcode.com/content/images/2011/03/tkmaxx_rebrand.jpg" alt="TK Maxx website rebranding" title="TK Maxx website rebranding" loading="lazy"></p>
<p>Website redesign for TK Maxx. Launched just yesterday.<br>
Venda coding all the way in the back end and HTML, JavaScript and CSS in the front end.<br>
<a href="https://www.tkmaxx.com/">Visit live site</a></p>
<h3 id="whativelearnt">What I&#x2019;ve learnt</h3>
<p>The biggest challenge was to make the site work in Internet Explorer 6 and 7. One particularly annoying issue was to make the logo stay on top of the sliding main homepage image. All other browsers were fine, but in IE6 and 7 the logo was hidden behind the image.</p>
<div style="float:left; width:50%; text-align:center;">
    <img src="https://allurcode.com/content/images/2011/03/tkmaxx_rebrand_1.jpg" alt="Before" title="TK Maxx website rebranding, logo bug">
    <em>Logo behind the image</em>
</div>
<div style="float:left; width:50%; text-align:center;">
    <img src="https://allurcode.com/content/images/2011/03/tkmaxx_rebrand_2.jpg" alt="After" title="TK Maxx website rebranding, logo bug">
    <em>Logo on top of the image</em>
</div>
<p>The trick was simple yet not obvious. <code>&lt;div&gt;</code> containing the logo needs not only its z-index set to a higher value than sliding image, but also we have to make sure IE treats it seriously and make our CSS rule important.</p>
<pre><code class="language-css">#logo { z-index: 1000; }
</code></pre>
<p>Above will not work whereas below will work like a charm.</p>
<pre><code class="language-css">#logo { z-index: 1000 !important; }
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Hot off the workshop vol. 1]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Just launched. TK Maxx and Red Nose Day campaign applications.</p>
<h3 id="facebookquiz">Facebook quiz</h3>
<p><a href="https://apps.facebook.com/red_nose_tshirt/"><img src="https://allurcode.com/content/images/2011/02/portfolio_1_1.jpg" alt loading="lazy"></a></p>
<p>Fun quiz to find out your perfect Red Nose Day t-shirt.<br>
<a href="https://apps.facebook.com/red_nose_tshirt/">View site</a></p>
<h3 id="websiteapplication">Website application</h3>
<p><a href="https://apps.facebook.com/red_nose_tshirt/"><img src="https://allurcode.com/content/images/2011/02/portfolio_1_2.jpg" alt loading="lazy"></a></p>
<p>Upload you photo with Flash uploader, resize it and pan it around with JavaScript then save your results with PHP.<br>
<a href="https://apps.facebook.com/red_nose_tshirt/">View site</a></p>
<!--kg-card-end: markdown-->]]></description><link>https://allurcode.com/hot-off-the-workshop-vol-1/</link><guid isPermaLink="false">5b7b0aa2b52b43084c9ea132</guid><category><![CDATA[CSS]]></category><category><![CDATA[Facebook]]></category><category><![CDATA[HTML]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[MySQL]]></category><category><![CDATA[PHP]]></category><dc:creator><![CDATA[Wojtek]]></dc:creator><pubDate>Wed, 23 Feb 2011 11:51:53 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Just launched. TK Maxx and Red Nose Day campaign applications.</p>
<h3 id="facebookquiz">Facebook quiz</h3>
<p><a href="https://apps.facebook.com/red_nose_tshirt/"><img src="https://allurcode.com/content/images/2011/02/portfolio_1_1.jpg" alt loading="lazy"></a></p>
<p>Fun quiz to find out your perfect Red Nose Day t-shirt.<br>
<a href="https://apps.facebook.com/red_nose_tshirt/">View site</a></p>
<h3 id="websiteapplication">Website application</h3>
<p><a href="https://apps.facebook.com/red_nose_tshirt/"><img src="https://allurcode.com/content/images/2011/02/portfolio_1_2.jpg" alt loading="lazy"></a></p>
<p>Upload you photo with Flash uploader, resize it and pan it around with JavaScript then save your results with PHP.<br>
<a href="https://apps.facebook.com/red_nose_tshirt/">View site</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Multiple borders with CSS2]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h3 id="howtomakeadivwithmultipleborders">How to make a div with multiple borders?</h3>
<p>Usual approach is to create a div with border then add another div inside that one with different border. We end up with lots of divs inside of other divs. If there only was an easier way to do it in CSS</p>]]></description><link>https://allurcode.com/multiple-borders-with-css2/</link><guid isPermaLink="false">5b7b0aa2b52b43084c9ea126</guid><category><![CDATA[border]]></category><category><![CDATA[CSS]]></category><category><![CDATA[multiple]]></category><dc:creator><![CDATA[Wojtek]]></dc:creator><pubDate>Tue, 06 Jul 2010 11:18:45 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h3 id="howtomakeadivwithmultipleborders">How to make a div with multiple borders?</h3>
<p>Usual approach is to create a div with border then add another div inside that one with different border. We end up with lots of divs inside of other divs. If there only was an easier way to do it in CSS without the need of more divs... <strong>There is!</strong></p>
<h3 id="beforeandafterpseudoclasses">:before and :after pseudo classes</h3>
<p>Internet Explorer 6 and 7 does not support :before and :after pseudo classes and to be honest I couldn&#x2019;t find a working fix for it. The good thing is that those dinosaurs are fading out from our lives.<br>
<code>:before</code> and <code>:after</code> pseudo classes allow placing text or an image before and after each HTML element using <code>content: &quot;&quot;;</code> attribute. In below example <code>content</code> is empty as all we need is just a border.</p>
<h4 id="css">CSS</h4>
<pre><code class="language-css">body {
  background: #fff;
}
#box {
  float: left;
  position: relative;
  width: 100px;
  height: 100px;
  margin: 20px;
  border: #f00 solid 5px;
}
#box:before {
  position: absolute;
  width: 90px;
  height: 90px;
  content: &apos;&apos;;
  border: #0f0 solid 5px;
}
#box:after {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 80px;
  height: 80px;
  content: &apos;&apos;;
  border: #00f solid 5px;
}
</code></pre>
<h4 id="html">HTML</h4>
<pre><code class="language-html">&lt;div id=&quot;box&quot;&gt;&lt;/div&gt;  
</code></pre>
<p>Above code should result in:<br>
<img src="https://allurcode.com/content/images/2010/07/multiple_borders.png" alt="Multiple borders with CSS" loading="lazy"></p>
<p>More information about <code>:before</code> and <code>:after</code> pseudo classes can be found <a href="http://www.w3.org/TR/CSS21/generate.html#before-after-content">here</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Gmail's recent email rendering change]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h3 id="problem">Problem</h3>
<p>Gmail recently made a few changes in their email rendering engine. Unfortunately for us our image based HTML newsletters that used to look fine in gmail are now broken. Each image seems to have a weird spacing after it.<br>
If you&#x2019;ve been sending HTML newsletters for your</p>]]></description><link>https://allurcode.com/gmails-recent-email-rendering-change/</link><guid isPermaLink="false">5b7b0aa2b52b43084c9ea122</guid><category><![CDATA[CSS]]></category><category><![CDATA[email]]></category><category><![CDATA[gmail]]></category><category><![CDATA[Google]]></category><category><![CDATA[HTML]]></category><category><![CDATA[image]]></category><category><![CDATA[spacing]]></category><dc:creator><![CDATA[Wojtek]]></dc:creator><pubDate>Tue, 01 Jun 2010 10:14:28 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h3 id="problem">Problem</h3>
<p>Gmail recently made a few changes in their email rendering engine. Unfortunately for us our image based HTML newsletters that used to look fine in gmail are now broken. Each image seems to have a weird spacing after it.<br>
If you&#x2019;ve been sending HTML newsletters for your clients for some time now, you probably have your own email templates that work well in all email clients. Well not anymore thanks to Google.</p>
<h3 id="solution">Solution</h3>
<p>To make things back to what they were just add <code>style=&quot;display:block;&quot;</code> to every img tag in your HTML email and we&#x2019;re back in business.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Google font api and font directory]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Google just made our life much easier by announcing <a href="http://code.google.com/apis/webfonts/">Google font api</a> and <a href="http://code.google.com/webfonts">Google font directory</a>.<br>
Using custom fonts on your website is as easy as adding two lines of code. Lets consider this simple example.</p>
<pre><code class="language-html">&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;title&gt;Custom</code></pre>]]></description><link>https://allurcode.com/google-font-api-and-font-directory/</link><guid isPermaLink="false">5b7b0aa2b52b43084c9ea120</guid><category><![CDATA[api]]></category><category><![CDATA[CSS]]></category><category><![CDATA[font]]></category><category><![CDATA[Google]]></category><category><![CDATA[HTML]]></category><category><![CDATA[Tangerine]]></category><dc:creator><![CDATA[Wojtek]]></dc:creator><pubDate>Sun, 23 May 2010 12:08:36 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Google just made our life much easier by announcing <a href="http://code.google.com/apis/webfonts/">Google font api</a> and <a href="http://code.google.com/webfonts">Google font directory</a>.<br>
Using custom fonts on your website is as easy as adding two lines of code. Lets consider this simple example.</p>
<pre><code class="language-html">&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;title&gt;Custom fonts&lt;/title&gt;
    &lt;meta charset=&quot;utf-8&quot; /&gt;
    &lt;style&gt;
      p {
        font-size: 48px;
      }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;header&gt;
        &lt;p&gt;Hello world!&lt;/p&gt;
    &lt;/header&gt;
&lt;/body&gt;
</code></pre>
<p>Nothing fancy here, result as expected:</p>
<p>Hello world!</p>
<p>Now lets add those two aforementioned lines. Line 6 and line 9 in below listing.</p>
<pre><code class="language-html">&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;title&gt;Custom fonts&lt;/title&gt;
    &lt;meta charset=&quot;utf-8&quot; /&gt;
    &lt;link href=&apos;http://fonts.googleapis.com/css?family=Tangerine&apos; rel=&apos;stylesheet&apos; type=&apos;text/css&apos;&gt;
    &lt;style&gt;
      p.tangerine {
        font-size: 48px;
        font-family: &apos;Tangerine&apos;, serif;
      }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;header&gt;
        &lt;p&gt;Hello world!&lt;/p&gt;
    &lt;/header&gt;
&lt;/body&gt;
</code></pre>
<p>and the effect:</p>
<link href="http://fonts.googleapis.com/css?family=Tangerine" rel="stylesheet" type="text/css">
<style>
  p.tangerine {
    font-size: 48px;
    font-family: 'Tangerine', serif;
  }
</style>
<p class="tangerine">Hello world!</p>
<p>The font directory is a bit limited at the moment but I think we can safely assume that Google will be adding more fonts over time.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>