Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are four ways to do it. <a href="http://jsfiddle.net/YyQk9/" rel="nofollow">I demonstrate four ways in this JSFiddle</a>, and here are some explanations.</p> <p>If you're not sure, just use Method B.</p> <h1>Method A</h1> <p>Method A has the advantage that it's the most compatible but the disadvantage that it requires extra HTML. Basically, you're giving an outer div the blue border and an inner div the white border. Your HTML will look something like this:</p> <pre><code>&lt;div class="methodA"&gt; &lt;div class="container"&gt; Method A &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Your CSS will look like this:</p> <pre><code>.methodA { border-left: 10px solid blue; } .methodA .container { height: 100%; border-left: 10px solid white; } </code></pre> <h1>Method B</h1> <p>Method B has the advantage that there's no extra HTML, but the disadvantage is that <a href="http://caniuse.com/#feat=css-boxshadow" rel="nofollow">it won't work in IE before version 9</a>.</p> <pre><code>.methodB { border-left: 10px solid blue; -webkit-box-shadow: inset 10px 0 white; -moz-box-shadow: inset 10px 0 white; box-shadow: inset 10px 0 white; } </code></pre> <p>You can mitigate IE's compatibility issues using <a href="http://css3pie.com/documentation/getting-started/" rel="nofollow">CSS3 PIE</a>, which makes box shadows behave in Internet Explorer (along with other CSS3 features).</p> <h1>Methods C and D</h1> <p><a href="http://jsfiddle.net/YyQk9/" rel="nofollow">This JSFiddle</a> shows two other methods, which I won't describe in as much detail, but...</p> <ul> <li>Method C makes the blue border a shadow. As a result, it can "cover" other elements and it also changes the size of the element. I don't love this solution, but it might work for you. It also suffers the compatibility issues of Method B.</li> <li>Method D puts two divs inside of the element: one for the blue border and one for the right border.</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload