Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS sliding border
    text
    copied!<p>Thanks to codeSpy, I have this: <a href="http://jsfiddle.net/p9tBR/" rel="nofollow noreferrer">http://jsfiddle.net/p9tBR/</a></p> <p>What I can't figure out is how to change the blue line as I change pages. For example, if I'm on page 2, I want the blue line to be under the 2 instead of the 1. When I'm on page 2-4, the line goes back to the 1. Sorry I'm awful at explaining this so here's a picture.</p> <p><img src="https://i.imgur.com/d5tQqKj.png" alt="1"></p> <p>HTML:</p> <pre><code>&lt;header&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="1.html" id="current"&gt;1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="2.html"&gt;2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="3.html"&gt;3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="4.html"&gt;4&lt;/a&gt;&lt;/li&gt; &lt;span&gt;&lt;/span&gt; &lt;/ul&gt; &lt;/header&gt; </code></pre> <p>CSS:</p> <pre><code>body { font-family: sans-serif; } ul { padding: 0; position: absolute; left: 50%; width: 500px; margin: 0 0 0 -250px; list-style-type: none; } ul:hover &gt; span { background: #d0332b; } ul { margin-top: 50px;} ul li { font-weight: bold; width: 25%; float: left; padding: 7px 0; text-align: center; cursor: pointer; } ul li:hover { color: #d0332b; } ul li:nth-child(2):hover ~ span { left: 25%; } ul li:nth-child(3):hover ~ span { left: 50%; } ul li:nth-child(4):hover ~ span { left: 75%; } span { position: absolute; bottom: -42px; display: block; width: 25%; height: 7px; background: #00b6ff; } ul li, span { -webkit-transition: all 0.2s ease; -moz-transition: all 0.2s ease; -o-transition: all 0.2s ease; transition: all 0.2s ease; position: relative; } a { text-decoration: none; color: #232323; } a:hover { display: block; color: #d0332b; } </code></pre>
 

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