<?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[border - 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>border - All your code are belong to us</title><link>https://allurcode.com/</link></image><generator>Ghost 4.48</generator><lastBuildDate>Thu, 09 Apr 2026 20:59:28 GMT</lastBuildDate><atom:link href="https://allurcode.com/tag/border/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><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></channel></rss>