<?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"><channel><title><![CDATA[CSS-Plus RSS Feed]]></title><description><![CDATA[Rooted in CSS, since branched out]]></description><link>https://css-plus.com</link><generator>GatsbyJS</generator><lastBuildDate>Mon, 21 Apr 2025 23:14:42 GMT</lastBuildDate><item><title><![CDATA[Understanding The UTF-8 Encoding Algorithm in Rust]]></title><description><![CDATA[Strings in Rust are UTF-8 encoded using the UTF-8 Encoding Algorithm, so
understanding that algorithm is key to understanding how  and 
work…]]></description><link>https://css-plus.com/2025/understanding-the-utf-8-encoding-algorithm-in-rust</link><guid isPermaLink="false">https://css-plus.com/2025/understanding-the-utf-8-encoding-algorithm-in-rust</guid><pubDate>Sat, 05 Apr 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;a href=&quot;https://doc.rust-lang.org/book/ch08-02-strings.html&quot;&gt;Strings in Rust&lt;/a&gt; are UTF-8 encoded using the UTF-8 Encoding Algorithm, so
understanding that algorithm is key to understanding how &lt;code class=&quot;language-text&quot;&gt;String&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;&amp;amp;str&lt;/code&gt;
work in Rust.&lt;/p&gt;
&lt;h2&gt;What is UTF-8?&lt;/h2&gt;
&lt;p&gt;UTF-8 is a character encoding (map of numbers to characters) created in 1993 to
support characters for all languages, not just the English language. Before
UTF-8, ASCII was used in English speaking countries. UTF-8 is backwards
compatible with ASCII.&lt;/p&gt;
&lt;p&gt;ASCII supports &lt;code class=&quot;language-text&quot;&gt;128&lt;/code&gt; characters (English alphabet, digits and other punctuation
characters), while UTF-8 supports &lt;code class=&quot;language-text&quot;&gt;1,112,064&lt;/code&gt; characters.&lt;/p&gt;
&lt;h3&gt;UTF-8 Encoding Algorithm&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://www.unicode.org/consortium/consort.html&quot;&gt;The Unicode Consortium&lt;/a&gt; understood the fact that a character spanning more than
1 byte of memory adds complexity and therefore created an algorithm for
programming languages to use to store characters as binary bytes in memory and
deal with this complexity.&lt;/p&gt;
&lt;p&gt;Keeping in mind that a Rust String is a &lt;code class=&quot;language-text&quot;&gt;Vec&amp;lt;u8&gt;&lt;/code&gt;, the UTF-8 byte sequence
should be clear when the sequence starts and should be self-aware of how many
bytes the sequence encompasses.&lt;/p&gt;
&lt;p&gt;In order to do this the UTF-8 Encoding Algorithm puts the information of how
many bytes the character encompasses in the first byte. If there are more bytes
each of those starts with a binary value indicating its a continuation of the
UTF-8 character.&lt;/p&gt;
&lt;p&gt;A binary value of a UTF-8 character can be a maximum of 21-bits.&lt;/p&gt;
&lt;p&gt;Let&apos;s have a look at what this looks like with 2 examples, a simple character
and a more complex character:&lt;/p&gt;
&lt;h4&gt;Simple Character&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Character: &lt;code class=&quot;language-text&quot;&gt;!&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Name: EXCLAMATION MARK&lt;/li&gt;
&lt;li&gt;hexadecimal: &lt;code class=&quot;language-text&quot;&gt;U+0021&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Binary: &lt;code class=&quot;language-text&quot;&gt;100001&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Rule: If a character contains a 7-bit, or less, binary value it should be
converted to a 7-bit binary and be prepended with &lt;code class=&quot;language-text&quot;&gt;0&lt;/code&gt;. This looks like
&lt;code class=&quot;language-text&quot;&gt;0xxxxxxx&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In this case &lt;code class=&quot;language-text&quot;&gt;100001&lt;/code&gt; would be converted to 7-bit binary &lt;code class=&quot;language-text&quot;&gt;0100001&lt;/code&gt; and prepended
with &lt;code class=&quot;language-text&quot;&gt;0&lt;/code&gt; to create the byte value: &lt;code class=&quot;language-text&quot;&gt;00100001&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The leading &lt;code class=&quot;language-text&quot;&gt;0&lt;/code&gt; indicates the UTF-8 character is only 1 byte long.&lt;/p&gt;
&lt;p&gt;Note: Since UTF-8 is byte-based and designed to be compatible with ASCII,
characters like &lt;code class=&quot;language-text&quot;&gt;a-zA-Z0-9&lt;/code&gt;, &apos;!&apos;, etc are encoded as single-byte values — making
UTF-8 very space-efficient for English text.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;rust&quot;&gt;&lt;pre class=&quot;language-rust&quot;&gt;&lt;code class=&quot;language-rust&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;fn&lt;/span&gt; &lt;span class=&quot;token function-definition function&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; binary&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;u8&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0b00100001&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; character &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;from_u32&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;binary &lt;span class=&quot;token keyword&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;u32&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;unwrap&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token macro property&quot;&gt;println!&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;{}&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; character&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// prints: !&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;Complex character&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Character: &lt;code class=&quot;language-text&quot;&gt;🙈&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Name: SEE-NO-EVIL MONKEY&lt;/li&gt;
&lt;li&gt;hexadecimal: &lt;code class=&quot;language-text&quot;&gt;U+1F648&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Binary: &lt;code class=&quot;language-text&quot;&gt;11111011001001000&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;21-bit binary: &lt;code class=&quot;language-text&quot;&gt;000011111011001001000&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Rules:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If the UTF-8 byte sequence contains a total of:
&lt;ul&gt;
&lt;li&gt;2 bytes the first byte starts with &lt;code class=&quot;language-text&quot;&gt;110&lt;/code&gt; (&lt;code class=&quot;language-text&quot;&gt;110xxxxx&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;3 bytes the first byte starts with &lt;code class=&quot;language-text&quot;&gt;1110&lt;/code&gt; (&lt;code class=&quot;language-text&quot;&gt;1110xxxx&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;4 bytes the first byte starts with &lt;code class=&quot;language-text&quot;&gt;11110&lt;/code&gt; (&lt;code class=&quot;language-text&quot;&gt;11110xxx&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Any following byte is prepended with &lt;code class=&quot;language-text&quot;&gt;10&lt;/code&gt; (&lt;code class=&quot;language-text&quot;&gt;10xxxxxx&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The example of the &quot;SEE-NO-EVIL MONKEY&quot; will take up 4 bytes once we run it
through the UTF-8 encoding algorithm.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Byte&lt;/th&gt;
&lt;th&gt;Bit Pattern&lt;/th&gt;
&lt;th&gt;Number of Data Bits&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1st byte&lt;/td&gt;
&lt;td&gt;11110xxx&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2nd byte&lt;/td&gt;
&lt;td&gt;10xxxxxx&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3rd byte&lt;/td&gt;
&lt;td&gt;10xxxxxx&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4th byte&lt;/td&gt;
&lt;td&gt;10xxxxxx&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;We split the 21-bit binary into chunks: 3 bits for the first byte, then 6 bits
each for the remaining three. After inserting those into the UTF-8 format with
the proper prefixes, we get:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Byte&lt;/th&gt;
&lt;th&gt;Bit Pattern&lt;/th&gt;
&lt;th&gt;Number of Data Bits&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1st byte&lt;/td&gt;
&lt;td&gt;11110000&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2nd byte&lt;/td&gt;
&lt;td&gt;10011111&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3rd byte&lt;/td&gt;
&lt;td&gt;10011001&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4th byte&lt;/td&gt;
&lt;td&gt;10001000&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;To convert the binary value of &quot;SEE-NO-EVIL MONKEY&quot; in Rust:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;rust&quot;&gt;&lt;pre class=&quot;language-rust&quot;&gt;&lt;code class=&quot;language-rust&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;fn&lt;/span&gt; &lt;span class=&quot;token function-definition function&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; binary&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;u32&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0b000011111011001001000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; character &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;from_u32&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;binary&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;unwrap&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token macro property&quot;&gt;println!&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;{}&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; character&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// prints: 🙈&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note: &lt;code class=&quot;language-text&quot;&gt;char::from_u32(...)&lt;/code&gt; converts a Unicode code point, not raw UTF-8 bytes.
The actual UTF-8 bytes are what you see when calling &lt;code class=&quot;language-text&quot;&gt;.as_bytes()&lt;/code&gt;. This is done
to help explain binary to UTF-8 characters.&lt;/p&gt;
&lt;p&gt;You may wonder why &lt;code class=&quot;language-text&quot;&gt;🙈&lt;/code&gt; requires 4 bytes and not 3. The answer lies in its code
point: &lt;code class=&quot;language-text&quot;&gt;U+1F648&lt;/code&gt; (which is &lt;code class=&quot;language-text&quot;&gt;128584&lt;/code&gt; in decimal). UTF-8 uses 3 bytes only for
values up to U+FFFF (&lt;code class=&quot;language-text&quot;&gt;65535&lt;/code&gt;). Since this character is above that range, it
falls into the 4-byte category, which is defined for any code point from
&lt;code class=&quot;language-text&quot;&gt;U+10000&lt;/code&gt; to &lt;code class=&quot;language-text&quot;&gt;U+10FFFF&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Bonus section&lt;/h2&gt;
&lt;h3&gt;More about bytes and chars&lt;/h3&gt;
&lt;p&gt;While a String in Rust is a UTF-8 encoded &lt;code class=&quot;language-text&quot;&gt;Vec&amp;lt;u8&gt;&lt;/code&gt;, Rust automatically prints
valid UTF-8. We can get hold of bytes or a characters by converting the strings
using the built-in methods &lt;code class=&quot;language-text&quot;&gt;.as_bytes()&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;.chars()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To print the byte values of the &quot;SEE-NO-EVIL Monkey&quot;, we can do the following:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;rust&quot;&gt;&lt;pre class=&quot;language-rust&quot;&gt;&lt;code class=&quot;language-rust&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;fn&lt;/span&gt; &lt;span class=&quot;token function-definition function&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; character &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;🙈&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; byte &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; character&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;as_bytes&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;iter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token closure-params&quot;&gt;&lt;span class=&quot;token closure-punctuation punctuation&quot;&gt;|&lt;/span&gt;b&lt;span class=&quot;token closure-punctuation punctuation&quot;&gt;|&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token macro property&quot;&gt;format!&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;{:0b}&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; b&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token macro property&quot;&gt;println!&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;{}&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; byte&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// Prints:&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;//&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// 11110000&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// 10011111&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// 10011001&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// 10001000&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And to print the UTF-8 characters of a string, we can do the following:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;rust&quot;&gt;&lt;pre class=&quot;language-rust&quot;&gt;&lt;code class=&quot;language-rust&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;fn&lt;/span&gt; &lt;span class=&quot;token function-definition function&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; value &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;🙈!&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; value&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;chars&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token macro property&quot;&gt;println!&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;{}&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// Prints:&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;//&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// 🙈&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// !&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;UTF-8 Encoding Ranges&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code Point Range&lt;/th&gt;
&lt;th&gt;Byte Length&lt;/th&gt;
&lt;th&gt;Encoding Format&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;U+0000 to U+007F&lt;/td&gt;
&lt;td&gt;1 byte&lt;/td&gt;
&lt;td&gt;0xxxxxxx&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;U+0080 to U+07FF&lt;/td&gt;
&lt;td&gt;2 bytes&lt;/td&gt;
&lt;td&gt;110xxxxx 10xxxxxx&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;U+0800 to U+FFFF&lt;/td&gt;
&lt;td&gt;3 bytes&lt;/td&gt;
&lt;td&gt;1110xxxx 10xxxxxx 10xxxxxx&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;U+10000 to U+10FFFF&lt;/td&gt;
&lt;td&gt;4 bytes&lt;/td&gt;
&lt;td&gt;11110xxx 10xxxxxx 10xxxxxx 10xxxxxx&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Have a look at &lt;a href=&quot;https://sonarsource.github.io/utf8-visualizer/&quot;&gt;UTF-8 Visualizer&lt;/a&gt; to get detailed byte and hexadecimal
information!&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;I hope this was helpful in understanding what is going on in the computers
memory when storing UTF-8 strings. The UTF-8 Encoding Algorithm is an elegant
solution to storing characters in a sequence of bytes, &lt;code class=&quot;language-text&quot;&gt;Vec&amp;lt;u8&gt;&lt;/code&gt; in the case of
Rust.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Using agenix on a non-NixOS Linux Home Manager Nix Flake]]></title><description><![CDATA[Adding encryption to your Nix flake is important. I used to use a
private Git repository to keep my secrets, but I was looking for
something…]]></description><link>https://css-plus.com/2024/using-agenix-on-a-non-nixos-linux-home-manager-nix-flake</link><guid isPermaLink="false">https://css-plus.com/2024/using-agenix-on-a-non-nixos-linux-home-manager-nix-flake</guid><pubDate>Mon, 30 Dec 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Adding encryption to your &lt;a href=&quot;https://nixos.org/&quot;&gt;Nix&lt;/a&gt; flake is important. I used to use a
private Git repository to keep my secrets, but I was looking for
something that integrated directly into Nix for reproducability.&lt;/p&gt;
&lt;p&gt;In my experience, Nix Darwin is typically more mature than Nix for
non-nix Linux distributions and therefore instructions are a bit more
lacking. I have recently been creating a Nix &lt;a href=&quot;https://github.com/nix-community/home-manager&quot;&gt;Home Manager&lt;/a&gt; flake to
manage my environment. I was having several issues getting &lt;a href=&quot;https://github.com/ryantm/agenix&quot;&gt;agenix&lt;/a&gt; to
work correctly and this article is both to help get agenix setup on a
non-NixOS Linux distribution (Ubuntu, Pop!_OS, Debian, etc) as
well as helping anyone who got stuck along the way like I did 😅&lt;/p&gt;
&lt;h2&gt;What is agenix?&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/ryantm/agenix&quot;&gt;agenix&lt;/a&gt; is a tool for managing encrypted secrets declaratively within
the Nix ecosystem, enabling secure, reproducible secret management.&lt;/p&gt;
&lt;p&gt;It is a CLI tool that is installed and configured upon installation.
After it has been installed, it is set to run through a &lt;code class=&quot;language-text&quot;&gt;systemctl&lt;/code&gt;
service.&lt;/p&gt;
&lt;h2&gt;Steps&lt;/h2&gt;
&lt;p&gt;The steps in this article assume:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Your Nix flake at &lt;code class=&quot;language-text&quot;&gt;/path/to/flake/flake.nix&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Secrets directory at &lt;code class=&quot;language-text&quot;&gt;/path/to/flake/secrets/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Home Manager &lt;code class=&quot;language-text&quot;&gt;.nix&lt;/code&gt; file at &lt;code class=&quot;language-text&quot;&gt;/path/to/flake/home-manager/home.nix&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Your username is &lt;code class=&quot;language-text&quot;&gt;username&lt;/code&gt;, change this to your username (&lt;code class=&quot;language-text&quot;&gt;echo
$USER&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Your public SSH key at &lt;code class=&quot;language-text&quot;&gt;~/.ssh/key.pub&lt;/code&gt; and private key at
&lt;code class=&quot;language-text&quot;&gt;~/.ssh/key&lt;/code&gt;. NOTE: Your key &lt;strong&gt;must not&lt;/strong&gt; contain a passphrase. &lt;a href=&quot;https://github.com/ryantm/agenix/issues/4&quot;&gt;agenix
does not deal well with keys behind a
passphrase&lt;/a&gt; and this is what
caused me to be stuck figuring this out for many hours&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add &lt;code class=&quot;language-text&quot;&gt;agenix&lt;/code&gt; flake to your flake:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;nix&quot;&gt;&lt;pre class=&quot;language-nix&quot;&gt;&lt;code class=&quot;language-nix&quot;&gt;  inputs &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    nixpkgs&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;url &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;github:nixos/nixpkgs/nixos-unstable&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    home&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;manager &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
      url &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;github:nix-community/home-manager&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
      inputs&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;nixpkgs&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;follows &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;nixpkgs&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    agenix &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
      url &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;github:ryantm/agenix&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
      inputs&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;nixpkgs&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;follows &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;nixpkgs&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Trigger a home-manager switch to install the &lt;code class=&quot;language-text&quot;&gt;agenix&lt;/code&gt; binary:
&lt;code class=&quot;language-text&quot;&gt;home-manager switch --flake /path/to/flake#username&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create &lt;code class=&quot;language-text&quot;&gt;/path/to/flake/secrets/secrets.nix&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;nix&quot;&gt;&lt;pre class=&quot;language-nix&quot;&gt;&lt;code class=&quot;language-nix&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt;
  pcName &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;ssh-ed25519 AAAAC3...&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  users &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; pcName &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token string&quot;&gt;&quot;secret1.age&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;publicKeys &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; users&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note: &lt;code class=&quot;language-text&quot;&gt;pcName&lt;/code&gt; value is your SSH public key &lt;code class=&quot;language-text&quot;&gt;~/.ssh/key.pub&lt;/code&gt;. Again,
make sure &lt;code class=&quot;language-text&quot;&gt;~/.ssh/key&lt;/code&gt; &lt;strong&gt;does not&lt;/strong&gt; require a passphrase. I would
suggest creating a new key for agenix specifically.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Change your current working directory to &lt;code class=&quot;language-text&quot;&gt;/path/to/flake/secrets&lt;/code&gt; and
create a &lt;code class=&quot;language-text&quot;&gt;secret1.age&lt;/code&gt; file with &lt;code class=&quot;language-text&quot;&gt;agenix&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;Run &lt;code class=&quot;language-text&quot;&gt;agenix -e secret1.age&lt;/code&gt;, this will cause an empty file to popup
using your &lt;code class=&quot;language-text&quot;&gt;$EDITOR&lt;/code&gt;, paste your secret in there and save and close
the file.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;sh&quot;&gt;&lt;pre class=&quot;language-sh&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;span class=&quot;token builtin class-name&quot;&gt;cd&lt;/span&gt; /path/to/flake/secrets
agenix &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; secret1.age&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You should now see an encrypted file at
&lt;code class=&quot;language-text&quot;&gt;/path/to/flake/secrets/secret1.age&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the following to your &lt;code class=&quot;language-text&quot;&gt;/path/to/flake/flake.nix&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;nix&quot;&gt;&lt;pre class=&quot;language-nix&quot;&gt;&lt;code class=&quot;language-nix&quot;&gt;homeConfigurations&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;username&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; home&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;manager&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;lib&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;homeManagerConfiguration &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;inherit&lt;/span&gt; pkgs&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

  modules &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;
    agenix&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;homeManagerModules&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;default

    &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
      age &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        secrets &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;token string&quot;&gt;&quot;secret1&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            file &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;./secrets/secret1.age&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
          &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        identityPaths &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/home/username/.ssh/key&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        secretsDir &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/home/username/.local/share/agenix/agenix&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        secretsMountPoint &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/home/username/.local/share/agenix/agenix.d&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

   &lt;span class=&quot;token url&quot;&gt;./home-manager/home.nix&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Have a look at the &lt;a href=&quot;https://github.com/ryantm/agenix&quot;&gt;agenix&lt;/a&gt; README.md for more information about the
agenix &lt;a href=&quot;https://github.com/ryantm/agenix?tab=readme-ov-file#agesecrets&quot;&gt;secrets&lt;/a&gt;, &lt;a href=&quot;https://github.com/ryantm/agenix?tab=readme-ov-file#ageidentitypaths&quot;&gt;identityPaths&lt;/a&gt;, &lt;a href=&quot;https://github.com/ryantm/agenix?tab=readme-ov-file#agesecretsdir&quot;&gt;secretsDir&lt;/a&gt; and
&lt;a href=&quot;https://github.com/ryantm/agenix?tab=readme-ov-file#agesecretsmountpoint&quot;&gt;secretsMountPoint&lt;/a&gt; properties above.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can now use the agenix secret keys in your
&lt;code class=&quot;language-text&quot;&gt;/path/to/flake/home-manager/home.nix&lt;/code&gt; file using
&lt;code class=&quot;language-text&quot;&gt;config.age.secrets.secret1.path&lt;/code&gt;, an example of using this value and
setting it to a session variable could look like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;nix&quot;&gt;&lt;pre class=&quot;language-nix&quot;&gt;&lt;code class=&quot;language-nix&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  config&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
  home&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;sessionVariables &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    SECRET1 &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;$(cat &lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token antiquotation important&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;config&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;age&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;secrets&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;workDirName&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;path&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;)&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Debugging&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Ensure all your paths are correct and don&apos;t contain typos.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ensure your &lt;code class=&quot;language-text&quot;&gt;~/.ssh/key&lt;/code&gt; is not protected by a passphrase.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If home-manager is building correctly but the secrets aren&apos;t being
decrypted as expected, make sure the &lt;code class=&quot;language-text&quot;&gt;agenix&lt;/code&gt; service is loaded
correctly: &lt;code class=&quot;language-text&quot;&gt;systemctl --user status agenix.service&lt;/code&gt;. You should see some
information about the service, if the service is missing then something
is wrong with the &lt;code class=&quot;language-text&quot;&gt;agenix&lt;/code&gt; installation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;journalctl --user -u agenix.service&lt;/code&gt; for more detailed agenix service
logs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the service is there, try restarting it and then proceeding to check
to see that the decrypted files are in the correct location
(&lt;code class=&quot;language-text&quot;&gt;~/.local/share/agenix/agenix/secret1&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Hopefully this helps someone. Good luck!&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Develop on a case sensitive file-system]]></title><description><![CDATA[Encountering case sensitivity issues, particularly in the context of
version control, might not be a daily occurrence for most developers…]]></description><link>https://css-plus.com/2023/develop-on-a-case-sensitive-file-system</link><guid isPermaLink="false">https://css-plus.com/2023/develop-on-a-case-sensitive-file-system</guid><pubDate>Fri, 22 Sep 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Encountering case sensitivity issues, particularly in the context of
version control, might not be a daily occurrence for most developers.
Yet, when these issues do arise, they can be perplexing and
time-consuming to resolve.&lt;/p&gt;
&lt;p&gt;In the digital world, where every character matters, the nuances of case
sensitivity can significantly impact your coding workflow. This short
article seeks to explore the world of case-sensitive file systems and
why they should be a deliberate choice, especially for your code
directory which contains your version controlled work.&lt;/p&gt;
&lt;p&gt;This guide is for people unfamiliar with case-sensitive file-systems and
also assumes unfamiliarity with drive partioning and formatting.&lt;/p&gt;
&lt;h2&gt;Symbolic link concept&lt;/h2&gt;
&lt;p&gt;Something to note before beginning is that you can create a &lt;a href=&quot;https://en.wikipedia.org/wiki/Symbolic_link&quot;&gt;symbolic
link&lt;/a&gt; pointing to a partition to anywhere in your drive. If you&apos;re
unfamiliar with this, imagine it as a sort of &quot;shortcut&quot; to a directory,
however you can use this shortcut as a legitimate path. So if you were
to have a partition called &quot;work&quot; located at &lt;code class=&quot;language-text&quot;&gt;/mnt/projects&lt;/code&gt;, you could
create a symbolic link pointing to it at &lt;code class=&quot;language-text&quot;&gt;~/projects&lt;/code&gt; and then simply
behave as if the partition is just a directory located at &lt;code class=&quot;language-text&quot;&gt;~/projects&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I bring up the concept of symbolic links because however you work now,
after creating a new partition you can simply copy across your work or
projects directory to the new partition and symlink it with the same
path as your old work or projects directory. After doing this,
everything should work exactly the same way as before, with the only
difference being that the &quot;directory&quot; (symbolic link to partition) is
case sensitive.&lt;/p&gt;
&lt;h2&gt;Understanding Case Sensitivity&lt;/h2&gt;
&lt;p&gt;Case sensitivity in file systems refers to how they handle the letter
case (uppercase and lowercase characters) in filenames and directory
names. It&apos;s essential for developers to grasp this concept because it
profoundly influences code consistency and functionality.&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;case-sensitive&lt;/strong&gt; file system treats filenames and directories as
distinct based on their exact letter case (e.g., &quot;file.txt&quot; and
&quot;File.txt&quot; are different).&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;case-Insensitive&lt;/strong&gt; file system ignores letter case, treating
&lt;code class=&quot;language-text&quot;&gt;file.txt&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;File.txt&lt;/code&gt; as the same.&lt;/p&gt;
&lt;p&gt;Understanding case sensitivity matters for developers because:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Version Control&lt;/strong&gt;: Accurate filename tracking in version control
systems like Git, Subversion and Mecurial rely on case sensitivity.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Consistency&lt;/strong&gt;: Case-sensitive systems maintain uniform naming
conventions across platforms, facilitating collaboration.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bug Prevention&lt;/strong&gt;: It minimizes subtle bugs caused by inconsistent
case usage, ensuring code reliability.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cross-Platform Development&lt;/strong&gt;: Crucial for developing software meant
to run on various operating systems, helping anticipate compatibility
issues.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Case-sensitivity is one of the fundamental things to understand about
how operating systems could be treating its file structure, and that
understanding is another step towards becoming adept at the nuances of
effective software development.&lt;/p&gt;
&lt;h2&gt;The Advantages of Case Sensitivity for Developers&lt;/h2&gt;
&lt;p&gt;In the realm of software development, choosing a case-sensitive file
system offers several significant advantages for developers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Consistency Across Platforms&lt;/strong&gt;: Case sensitivity ensures consistent naming
conventions across different operating systems, promoting collaboration.
Collaborative coding benefits from consistent naming conventions,
reducing confusion and errors among team members.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version Control Integrity&lt;/strong&gt;: Accurate filename tracking in version control
systems is vital for maintaining a reliable history of changes, and case
sensitivity plays a crucial role in this.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bug Prevention&lt;/strong&gt;: Case sensitivity reduces the chances of subtle,
hard-to-diagnose bugs caused by inconsistent case usage in filenames.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cross-Platform Development&lt;/strong&gt;: It facilitates the early detection and&lt;/li&gt;
&lt;/ul&gt;
resolution of compatibility issues when developing software for multiple
platforms.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Preserving File Distinction&lt;/strong&gt;: Case sensitivity distinguishes files and&lt;/li&gt;
&lt;/ul&gt;
directories with similar names but different letter case, preventing
ambiguity.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compatibility with Third-Party Tools&lt;/strong&gt;: Many development tools and
libraries assume case sensitivity, aligning your environment with
industry standards.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By embracing these advantages, developers can enhance code consistency,
version control reliability, and overall software quality.&lt;/p&gt;
&lt;h2&gt;Setting Up a Case-Sensitive File System and moving across your work&lt;/h2&gt;
&lt;p&gt;Now that we&apos;ve explored the advantages of case sensitivity for
developers, let&apos;s dive into the practical steps to set up a
case-sensitive file system. We&apos;ll provide instructions for both macOS
and Linux, ensuring that you can tailor your development environment to
meet your specific needs.&lt;/p&gt;
&lt;p&gt;The following setup guide is going to assume you only have 1 partition
and will help you shrink that large partition and create an aditional
partition.&lt;/p&gt;
&lt;p&gt;Before beginning, make sure you have enough free space on your drive for
the new partition and for leftover space on your primary partition. My
&quot;code&quot; partition is 50GB for reference. I would suggest having at least
20GB left on your primary parition after setting up the code partition.
So if you were to follow the numbers I personally use and the suggestion
I mentioned, you should have at least 70GB free before proceeding. I&apos;m
going to use the numbers I mentioned above in the following setup
instructions, but feel free to change the 50GB value.&lt;/p&gt;
&lt;h3&gt;Setting Up a Case-Sensitive File System on macOS&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Backup Your Data&lt;/strong&gt;: Begin by creating a complete backup of all your
data to an external drive or cloud storage. This is crucial to
prevent data loss during the partitioning process.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open Disk Utility&lt;/strong&gt;: Launch Disk Utility, which you can find in the
Utilities folder within the Applications folder.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Select Your Disk&lt;/strong&gt;: In Disk Utility, select the primary disk that
contains your macOS installation. Be cautious not to choose the wrong
disk.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shrink the Primary Partition&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Click the &quot;Partition&quot; button to access the partition layout.&lt;/li&gt;
&lt;li&gt;Select your primary partition (the one with macOS) and adjust its
size by clicking and dragging the partition divider.&lt;/li&gt;
&lt;li&gt;Create unallocated space by shrinking the primary partition. Be
sure to leave enough space for macOS to function correctly.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create a New Partition&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;With the unallocated space, click the &quot;+&quot; button under the
partition layout to create a new partition.&lt;/li&gt;
&lt;li&gt;Choose &quot;APFS (Case-sensitive, Journaled)&quot; as the format for the new
partition.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Apply Changes&lt;/strong&gt;: Click the &quot;Apply&quot; button to commit the changes.
Disk Utility will guide you through the process, and your new
case-sensitive APFS partition will be created.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format the New Partition&lt;/strong&gt;: After the new partition is created,
format it with a case-sensitive file system by selecting it and
clicking the &quot;Erase&quot; button. Choose &quot;APFS (Case-sensitive, Journaled)&quot;
as the format.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mount the New Partition&lt;/strong&gt;: Your new case-sensitive file system
partition is now ready for use. It will be mounted and available in
Finder.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Setting Up a Case-Sensitive File System on Linux&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Backup Data&lt;/strong&gt;: Before making any changes to the partition layout,
it&apos;s crucial to back up all your important data to an external
storage device or cloud storage.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create a Bootable USB&lt;/strong&gt;: Prepare a bootable USB drive with a live
Linux distribution or a partitioning tool that can be used to modify
the partitions. This includes most Linux bootable USB drives, such as
Ubuntu, Pop!OS, etc.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Boot from the USB&lt;/strong&gt;: Insert the bootable USB drive into your
computer and restart it. Boot from the USB drive to access the
partitioning tool. I suggest making sure GParted is installed, if
it&apos;s not, then install it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shrink the OS Partition&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Use GParted to shrink the existing OS partition. This process
involves reducing the size of the OS partition to create unallocated
space for the new partition.&lt;/li&gt;
&lt;li&gt;Be cautious when resizing the OS partition, as it can impact the
system&apos;s bootability. Ensure you have enough space left for the OS to
function correctly.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create a New Partition&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Once you&apos;ve created unallocated space, use the partitioning tool to
create a new partition within that space.&lt;/li&gt;
&lt;li&gt;Choose the file system format you want for the new partition (e.g.,
ext4 for a case-sensitive file system on Linux).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Format and Mount the New Partition&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Format the new partition with the desired file system format.&lt;/li&gt;
&lt;li&gt;Mount the new partition to a directory to start using it for your
development work.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Update Boot Configuration (if necessary)&lt;/strong&gt;: Depending on your
system, you may need to update the boot configuration to recognize
the changes in the partition layout.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Restore Data&lt;/strong&gt;: After creating the new partition, you can restore
your backed-up data to the appropriate locations.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Moving your work across to the partition&lt;/h3&gt;
&lt;p&gt;I will assume your new mounted partition is located at &lt;code class=&quot;language-text&quot;&gt;/mnt/projects&lt;/code&gt;
and your working code directory is located at &lt;code class=&quot;language-text&quot;&gt;~/projects&lt;/code&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Copy across all contents of &lt;code class=&quot;language-text&quot;&gt;~/projects&lt;/code&gt; to &lt;code class=&quot;language-text&quot;&gt;/mnt/projects&lt;/code&gt;. You can
do this any way you want, but here is a bash command:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token function&quot;&gt;cp&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-r&lt;/span&gt; ~/projects/* /mnt/projects&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rename &lt;code class=&quot;language-text&quot;&gt;~/projects&lt;/code&gt; to &lt;code class=&quot;language-text&quot;&gt;~/projects-old&lt;/code&gt;. I suggest a rename for
safety so you don&apos;t lose anything unintentionally.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create the symbolic link:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token function&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-s&lt;/span&gt; /mnt/projects ~/projects&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Ensure the symbolic link exists by running:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;   &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-L&lt;/span&gt; /path/to/directory &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;The directory is a symbolic link&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;The directory is not a symbolic link&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You should receive the output &quot;This directory is a symbolic link&quot;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Everything should work as it did before. You IDE or editors should
pick up where they left off.&lt;/li&gt;
&lt;li&gt;When you&apos;re happy with everything, you can delete your old direcotry
&lt;code class=&quot;language-text&quot;&gt;~/projects-old&lt;/code&gt;. It doesn&apos;t hurt just being there, so you could do
this step days or weeks after the previous step if that makes you feel
safter.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Popular version control systems like Git, Subversion and Mecurial are
case sensitive and when a case-sensitive issue silently arrise, it tends
to be very frustrating to deal with.&lt;/p&gt;
&lt;p&gt;By making sure your code is running on a case-sensitive file system, you
won&apos;t be subject to these problems and won&apos;t perpetutate them either.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[My Journey to the Perfect Text-Editor - Part 2]]></title><description><![CDATA[I wrote the article My Journey to the Perfect Text-Editor in 2012. I
want to talk about my progession in text-editors since then. This…]]></description><link>https://css-plus.com/2023/my-journey-to-the-perfect-text-editor-part-2</link><guid isPermaLink="false">https://css-plus.com/2023/my-journey-to-the-perfect-text-editor-part-2</guid><pubDate>Thu, 21 Sep 2023 00:00:00 GMT</pubDate><content:encoded>&lt;style type=&quot;text/css&quot;&gt;
.logo-list { display: flex; justify-content: left; }
.logo-list &gt; * { min-height: 40px; min-width: 40px; margin: 0 !important; }
.logo-list img[alt=&quot;GEdit logo&quot;] { min-width: 100px; }
.ArticleIcon { padding: 8px; width: 48px; }
.ArticleIcon--atom { background-color: #5FB67D; border-radius: 50%; } 
.ArticleIcon--vscode { background-color: #fff; border-radius: 8px; box-shadow: 2px 2px 5px #ccc; } 
.ArticleIcon--vim { background-color: #fff; border-radius: 8px; box-shadow: 2px 2px 5px #ccc; } 
.ArticleIcon--neovim { background-color: #fff; border-radius: 8px; box-shadow: 2px 2px 5px #ccc; } 
&lt;/style&gt;
&lt;p&gt;I wrote the article &lt;a href=&quot;/2012/02/my-journey-to-the-perfect-text-editor/&quot;&gt;My Journey to the Perfect Text-Editor&lt;/a&gt; in 2012. I
want to talk about my progession in text-editors since then.&lt;/p&gt;
&lt;p&gt;This article is targeted at anyone interested in expanding their
development environment or anyone interested in a relatively detailed
journey of someone moving from using &lt;a href=&quot;https://github.com/atom/atom&quot;&gt;Atom&lt;/a&gt; to &lt;a href=&quot;https://neovim.io/&quot;&gt;Neovim&lt;/a&gt; over a period of
almost 10 years.&lt;/p&gt;
&lt;p&gt;In this journey, you&apos;ll hear me mention CLI tools quite a bit later on.
CLI stands for Command Line Interface, a type of software interface
where users interact with programs by typing text-based commands. These
tools are essential for many developers, offering a fast and flexible
way to perform tasks that range from file manipulation to system
administration and beyond. They&apos;re particularly powerful when used in
conjunction with text editors like &lt;a href=&quot;https://en.wikipedia.org/wiki/Vim_(text_editor)&quot;&gt;Vim&lt;/a&gt;, as they help to automate tasks,
streamline workflows, and even extend the functionality of the editor
itself. So while the article is for anyone, it does have a focus on Unix
based operating systems (macOS, Linux, FreeBSD, etc).&lt;/p&gt;
&lt;p&gt;Before I get into any specific editor, I want to summarise my goals for
a text-editor in 2012, which is a point-summary of the previous article
since this story continues from there. In 2012 I was working on HTML,
CSS, JavaScript, PHP and some other scripting languages. I wanted the
editor to fulfill the following crieria:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cross-Platform OS compatibility: I worked on multiple operating systems.&lt;/li&gt;
&lt;li&gt;Built for many programming languages&lt;/li&gt;
&lt;li&gt;Aesthetically pleasing&lt;/li&gt;
&lt;li&gt;Support plugins or extentions of the editor&lt;/li&gt;
&lt;li&gt;Powerful tool with Plenty of options
&lt;ul&gt;
&lt;li&gt;Find/replace throughout open tabs (I was quite specific with this&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Fast: I didn&apos;t like waiting for anything or feeling a type of lag.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ultimately I landed on using SublimeText 2 since it satisfied the above
points.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;: When I talk about &quot;Pros&quot; and &quot;Cons&quot; or any opinions of
an editor, keep in mind this was how I felt when I used the editor many
years ago. So I probably have a completely different opinion of the
editor today.&lt;/p&gt;
&lt;h2&gt;Atom (2014 - 2015)&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;img src=&quot;/c0cdc6ca3461dbc69a24858d43b6d6cd/atom.svg&quot; class=&quot;ArticleIcon ArticleIcon--atom&quot; alt=&quot;Atom editor logo&quot;&gt;
&lt;/div&gt;
&lt;p&gt;I had gotten used to Sublime Text 2&apos;s multi-cursor tool and used it
heavily and Atom released with this functionality.&lt;/p&gt;
&lt;p&gt;Atom was developed by GitHub and its motto was &quot;A hackable text editor
for the 21st Century&quot;. Atom was built with &lt;a href=&quot;https://www.electronjs.org/&quot;&gt;Electron&lt;/a&gt;, a cross-platform
tool to create desktop applications using web technologies, and is the
reason Electron exists today. Atom supported extensive customisation
through packages (read &quot;plugins&quot;) built with JavaScript. At the time,
JavaScript was still finding its place as a &quot;real&quot; programming language
and Electron gave me hope and inspired me, as a JavaScript developer, to
not only build tools for the web, but also for the desktop.&lt;/p&gt;
&lt;h3&gt;Pros&lt;/h3&gt;
&lt;p&gt;Atom&apos;s focus on JavaScript, being a highly accessible language compared
to others, as well as it&apos;s open-source nature fostered a very active
community immediately, which meant the editor could be extended in any
way you could imagine.&lt;/p&gt;
&lt;p&gt;I worked with JavaScript daily. Knowing that I could easily create my
own package for the text editor was compelling for me, even though I
ultimately didn&apos;t create one for Atom haha, but I did play around with
it.&lt;/p&gt;
&lt;h3&gt;Cons&lt;/h3&gt;
&lt;p&gt;Atom was noticeably slower than SublimeText 2 for me. Load time of large
files and just general scrolling and switching files had a delay that
Sublime Text 2 didn&apos;t, but the things I valued about Atom outweighed the
con of the editor speed.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;ul class=&quot;contains-task-list&quot;&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; The ability to extensively customise the editor&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; The ability to create plugins myself&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Easy to switch between projects&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Open-source and active community&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; disabled&gt; Be very fast and look smooth&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;VSCode (2015 - 2021)&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;img src=&quot;/e60fcd0974402a2aaf59f3835776c5ea/vscode.svg&quot; class=&quot;ArticleIcon ArticleIcon--vscode&quot; alt=&quot;Visual Studio Code editor logo&quot;&gt;
&lt;/div&gt;
&lt;p&gt;Visual Studio Code (VSCode) was released in April 2015 by Microsoft. It
was (and still is) a free, open-source code editor that&apos;s both
lightweight and powerful. It focuses on modern web development and comes
with built-in Git support. Its extensibility through plugins, a
streamlined debugging experience, and its cross-platform nature, thanks
to being built on the Electron framework, quickly garnered attention in
the developer community.&lt;/p&gt;
&lt;p&gt;I, however, was very skeptical to VSCode upon release for various
reasons.&lt;/p&gt;
&lt;h3&gt;My issues with Microsoft at the time&lt;/h3&gt;
&lt;p&gt;By 2015 I had stopped using Windows entirely and solely worked on my
Macbook Pro with OS X, macOS before the name changed. I was happy to have
Windows out of my life and live in the Unix-based OS world. Developing
in Windows for non-Microsoft related tasks was very cumbersome. Windows
felt clunky and inefficient and I attributed these adjectives to
Microsoft itself.&lt;/p&gt;
&lt;p&gt;At the time, I was building websites which supported Internet Explorer 9
and 10 which were both far behind &quot;modern&quot; browsers like Firefox, Chrome
or Opera. Earlier on in my career, I did development for Internet
Explorer 6, 7 and 8. I was happy with the progress of IE9 over 8, but I
was very disappointed in what IE10 brought to the table, especially
after looking forward to its release day in October 2012 and with the
knowledge that the next browser release would be very far away. I wanted
IE to be better since a large portion of users were using IE as their
primary browser.&lt;/p&gt;
&lt;p&gt;With my deep-seated frustrations towards Microsoft—stemming from
Windows&apos; cumbersome nature for non-Microsoft tasks, the stagnation in
Internet Explorer&apos;s development compared to more modern browsers, and
the company&apos;s late entry into the open-source community—I was extremely
skeptical of VSCode when it first launched.&lt;/p&gt;
&lt;p&gt;With my frustration with Microsoft due to finding it cumbersome
for non-Microsoft tasks and associating its inefficiencies with
Microsoft as a whole as well as being letdown by IE and it&apos;s late entry
into the open-source community, I was &lt;strong&gt;very&lt;/strong&gt; skeptical of VSCode.&lt;/p&gt;
&lt;h3&gt;Initial thoughts after use&lt;/h3&gt;
&lt;p&gt;I didn&apos;t use VSCode for a few months since I was happy with Atom, but
many co-workers were using it and were happy so I decided to give it a
try. The transition from Atom to VSCode felt even smoother than
SublimeText 2 to Atom. It felt like it was the same editor, but slightly
better in almost every way; Almost like an Atom 2.0.&lt;/p&gt;
&lt;p&gt;Continuing to use it as my primary text-editor was a no-brainer, since
there wasn&apos;t a downside to it for my use-case, plus it felt a lot faster
than Atom, which was the one downside I had when moving from SublimeText
2 to Atom.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;ul class=&quot;contains-task-list&quot;&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; The ability to extensively customise the editor&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; The ability to create plugins myself&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Easy to switch between projects&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Open-source and active community&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Be very fast and look smooth&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Vim (2021 - 2022)&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;img src=&quot;/d09f882ba39d8d090ff88aa2bf0a9daf/vim.svg&quot; class=&quot;ArticleIcon ArticleIcon--vim&quot; alt=&quot;Vim editor logo&quot;&gt;
&lt;/div&gt;
&lt;p&gt;Vim is a robust text editor that operates within your terminal, known
for its high customizability through VimScript and its keyboard-centric
design. In 2016, a friend shared their experience with Vim, sparking my
curiosity. It was a while ago, so I can&apos;t remember the specifics, but
Vim&apos;s focus on minimalism, speed and efficiency certainly caught my
attention.&lt;/p&gt;
&lt;p&gt;When I first tried Vim, I found that it didn&apos;t match VSCode&apos;s efficiency
for my needs. Even after spending time setting it up, certain essential
features eluded me. This led to me frequently alternating between Vim
and VSCode. For smaller tasks or single file edits, I leaned towards
Vim, but for broader projects, VSCode was my go-to — akin to how one
might switch between a basic text editor and a full-fledged IDE based on
the task.&lt;/p&gt;
&lt;p&gt;I used Vim this way from 2016 - 2021, so I gained familiarity with it,
even though it wasn&apos;t my primary editor. Over this time, my proficiency
with Vim&apos;s unique keyboard commands grew, making my workflow as fast as
it was in VSCode, but freeing me from mouse dependency.&lt;/p&gt;
&lt;p&gt;For a deeper dive into Vim as of 2022, check out this video by ThePrimeagen:
&lt;a href=&quot;https://www.youtube.com/watch?v=D4YTJ2W5q4Y&quot;&gt;Why I use Vim in 2022&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Not a final conclusion, since I hadn&apos;t swapped to Vim&lt;/h3&gt;
&lt;ul class=&quot;contains-task-list&quot;&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; The ability to extensively customise the editor&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; The ability to create plugins myself&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Easy to switch between projects&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Open-source and active community&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Very fast&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Minimal&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Efficient&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; disabled&gt; Experienced enough to use the editor to fulfill my own needs&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;What was stopping me from switching to Vim as my primary editor&lt;/h3&gt;
&lt;p&gt;I didn&apos;t know this at the time, but I was thinking about Vim in the
wrong way. I was trying to replace VSCode, or any of the editors I had
previously used with Vim alone. Vim can be extended to do almost
anything, but it doesn&apos;t need to be extended, since we have other tools
for the job.&lt;/p&gt;
&lt;p&gt;I was struggling to switch between projects in Vim and I would have
different terminal tabs open, each with a different instance of a Vim
project. This wasn&apos;t working for me and I wanted something to switch
between projects within Vim. While there are plugins for this, I
struggled to get them to work and they tended to be a bit too
complicated for me to set up.&lt;/p&gt;
&lt;p&gt;Other big issues I faced included project-wide search/replace and open a
list of files containing a specific search term, and a good Git plugin.&lt;/p&gt;
&lt;p&gt;I don&apos;t know when the &quot;Aha&quot; moment was exactly, but I realised I didn&apos;t
need to recreate all the VSCode functionality in Vim because I could
just use existing CLI (Command Line Interface) tools for the job. I had
read people suggesting usage with Vim in this way on forums, but I just
wasn&apos;t in the place to understand it at the time.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;grep&lt;/code&gt; or &lt;code class=&quot;language-text&quot;&gt;git grep&lt;/code&gt; could be used to search through files for a specific
term with a string or even regex.&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;sed&lt;/code&gt; could be used to search for a string or regex pattern and
replace with something else.&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;git&lt;/code&gt; could just be used for my git needs.&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;tmux&lt;/code&gt; could be used to handle different sessions (read projects) and
windows within those sessions.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Instead of attempting to replicate the functionalities of VSCode within
Vim, I had an important realisation. Vim doesn&apos;t need to be an
all-encompassing tool; instead, I could leverage existing CLI tools to
complement its capabilities. Whether searching with &lt;code class=&quot;language-text&quot;&gt;grep&lt;/code&gt;, replacing text
with &lt;code class=&quot;language-text&quot;&gt;sed&lt;/code&gt;, handling Git operations directly, or managing sessions with
&lt;code class=&quot;language-text&quot;&gt;tmux&lt;/code&gt;, I discovered that a synergy between Vim and these command-line
utilities offered a powerful and efficient development environment.&lt;/p&gt;
&lt;h3&gt;Switching to Vim full-time&lt;/h3&gt;
&lt;p&gt;After the realisation about the synergy between Vim and other CLI tools
in 2021 I relentlessly consumed Vim related content and came across a
video of &lt;a href=&quot;https://www.youtube.com/watch?v=bdumjiHabhQ&quot;&gt;ThePrimeagen talking about
TMUX&lt;/a&gt; and saw how he was
able to quickly switch between sessions and I finally understood how I
could commit to vim full-time. Since that day, I haven&apos;t switched away
from Vim.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Vim not only fulfilled all my criteria for the perfect text editor but
also opened up a new realm of possibilities by deeply integrating with
CLI tools and the terminal environment. This shift away from GUI-based
editors felt like a natural progression in my journey, instilling a
sense of connection to the very roots of computing. It encouraged me to
explore powerful command-line utilities resulting in a workflow that&apos;s
both flexible and efficient. While VimScript could technically allow me
to create my own plugins, my aversion to learning it became an issue as
it prevented me from expanding on Vim myself without plugins. Overall,
Vim was not just an editor for me, but more of a highly personalized
development environment where I felt challenged, yet at home.&lt;/p&gt;
&lt;ul class=&quot;contains-task-list&quot;&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; The ability to extensively customise the editor&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; disabled&gt; The ability to create plugins myself (Note: While VimScript gives me the technical ability to create my own plugins, I&apos;ve always had an aversion to learning it. So, technically, I could create plugins, but I personally didn&apos;t take that step.)&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Easy to switch between projects&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Open-source and active community&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Very fast&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Minimal&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Efficient&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Experienced enough to use the editor to fulfill my own needs&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Neovim (2022 - Now)&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;img src=&quot;/0b63b07332126c2583b0c91d2058da82/neovim.svg&quot; class=&quot;ArticleIcon ArticleIcon--neovim&quot; alt=&quot;Neovim editor logo&quot;&gt;
&lt;/div&gt;
&lt;p&gt;I was aware of Neovim for a while by the time I was using Vim as my
primary editor, but I didn&apos;t find a need to use it since it didn&apos;t add
any features that would affect my workflow.&lt;/p&gt;
&lt;p&gt;That was until they released version Neovim &lt;code class=&quot;language-text&quot;&gt;0.5&lt;/code&gt; in July 2022, which
added support for Lua as a supported language for config and plugins,
while still maintaining support for VimScript.&lt;/p&gt;
&lt;p&gt;I didn&apos;t like VimScript, I found it cumbersome to use and I didn&apos;t feel
a particular need to learn it since it was only used for Vim. I had a
large custom VimScript config file, but it just did what it needed to do
and I wasn&apos;t interested in learning more than I needed to.&lt;/p&gt;
&lt;p&gt;When Neovim &lt;code class=&quot;language-text&quot;&gt;0.5&lt;/code&gt; was released, I kept a keen eye on how the community
was adopting it. By January 2022 I rewrote my entire config in Lua. I
found it very fun and rewarding. I found myself exploring the Vim API a
lot more through Lua than I ever did with VimScript. VimScript felt like
a means to an end, whereas Lua felt enjoyable and like I was growing.&lt;/p&gt;
&lt;p&gt;The Neovim community feels vibrant and exciting and I&apos;m really glad to
be part of it!&lt;/p&gt;
&lt;h3&gt;Vim9Script&lt;/h3&gt;
&lt;p&gt;As of July 2022, an update to Vim was released which allows users to
write their config and plugins in Vim9Script. This change has forced
Neovim to hard-fork off of the Vim repo, which is unfortunate.
Vim9Script looks &lt;strong&gt;a lot&lt;/strong&gt; better than VimScript, but I&apos;m happy with lua
and don&apos;t plan on switching back to Vim.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Switching to Neovim felt like I&apos;d found a piece of the puzzle I didn&apos;t
know was missing. Lua not only became a fun and enlightening way to
engage with my editor, but it also reignited my excitement for
customization and plugin development. Unlike VimScript, which always
felt like a necessary hurdle, Lua became a joyous part of the process.
Beyond that, the sense of community in Neovim is electrifying. It checks
all the boxes for me—from extensive customization and plugin support to
an active, open-source community and a sleek, efficient design. At this
point, Neovim isn&apos;t just a tool; it&apos;s a vibrant community and a constant
source of learning and growth in my coding journey.&lt;/p&gt;
&lt;ul class=&quot;contains-task-list&quot;&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; The ability to extensively customise the editor&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; The ability to create plugins myself&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Easy to switch between projects&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Open-source and active community&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Very fast&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Minimal&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Efficient&lt;/li&gt;
&lt;li class=&quot;task-list-item&quot;&gt;&lt;input type=&quot;checkbox&quot; checked disabled&gt; Experienced enough to use the editor to fulfill my own needs&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Honorable mentions&lt;/h2&gt;
&lt;h3&gt;Emacs&lt;/h3&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;img src=&quot;/60d1bd483f0014829fb527d5d30d0139/emacs.svg&quot; class=&quot;ArticleIcon ArticleIcon--emacs&quot; alt=&quot;Emacs editor logo&quot;&gt;
&lt;/div&gt;
&lt;p&gt;I haven&apos;t used &lt;a href=&quot;https://en.wikipedia.org/wiki/Emacs&quot;&gt;Emacs&lt;/a&gt; before but I know it&apos;s a very powerful tool that
isn&apos;t limited to a terminal emulator, like Vim and Neovim are. While I
haven&apos;t used it before, I know enough about it to know that it would
score full points on my checklist of requirements.&lt;/p&gt;
&lt;p&gt;I&apos;m already in the Neovim world and I&apos;m happy here; If for some reason
that were to change, Emacs would be at the top of the list of editors to
swap to.&lt;/p&gt;
&lt;h3&gt;IntelliJ IDEA&lt;/h3&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;img src=&quot;/2396978f263d61793abe9f23dc7593fe/intellij-idea.svg&quot; class=&quot;ArticleIcon ArticleIcon--intellij&quot; alt=&quot;Intellij IDEA editor logo&quot;&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;https://www.jetbrains.com/idea/&quot;&gt;Intellij IDEA&lt;/a&gt; offers a plugin named &lt;a href=&quot;https://www.jetbrains.com/help/idea/using-product-as-the-vim-editor.html&quot;&gt;IdeaVim&lt;/a&gt;, which admirably supports Vi
movements, basic VimScript configurations, and various &lt;a href=&quot;https://github.com/JetBrains/ideavim/wiki/IdeaVim-Plugins&quot;&gt;IdeaVim plugins&lt;/a&gt;
that emulate popular Vim plugins. IntelliJ is particularly proficient
for Java and Kotlin development. For more complex tasks, especially
within the JVM, I turn to IntelliJ with the Vi-Mode enabled.&lt;/p&gt;
&lt;h3&gt;Vi-Mode plugins in text-editors?&lt;/h3&gt;
&lt;p&gt;Vi-Mode is great and it&apos;s what I recommend to everyone since the Vi
movements are amazing when you get used to them and if you can do that
without leaving the comfort of your own editor, that&apos;s a plus. There are
Vi-Mode plugins for VSCode (&lt;a href=&quot;https://github.com/vscode-neovim/vscode-neovim&quot;&gt;vscode-neovim&lt;/a&gt;), SublimeText ([Vintage
mode]), IntelliJ (&lt;a href=&quot;https://www.jetbrains.com/help/idea/using-product-as-the-vim-editor.html&quot;&gt;IdeaVim&lt;/a&gt;) and almost any GUI editor.&lt;/p&gt;
&lt;p&gt;Applications are able to embed Neovim within them and VSCode has a
plugin called &lt;a href=&quot;https://github.com/vscode-neovim/vscode-neovim&quot;&gt;vscode-neovim&lt;/a&gt; which does exactly that. Since it is
literally running Neovim, not just a vi-mode emulator, you&apos;re even able
to use a custom Neovim Lua config.&lt;/p&gt;
&lt;h3&gt;Comments I had received on the original article&lt;/h3&gt;
&lt;p&gt;I used to have a post-comment feature on this blog. When I wrote the
&lt;a href=&quot;/2012/02/my-journey-to-the-perfect-text-editor/&quot;&gt;first article&lt;/a&gt; in 2012, I received these two comments&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I like using Vim on my Windows/Linux/Mac machines. It is
cross-platform and pretty
-- &lt;cite&gt;7hao&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Of course. Sublime Text is one of the most advanced editors today. I
myself prefer Emacs (IMHO you can&apos;t measure it with other editors),
but Sublime Text is very powerful also.
-- &lt;cite&gt;Marko&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;To both of those comments, I say &quot;Here here!&quot;. I completely agree with
those two comments, but didn&apos;t understand them at the time since I
didn&apos;t have a real understand on Vim or Emacs at the time.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Neovim has been a game-changer for me, not only meeting but exceeding
what I sought in a modern text-editor. The shift to Vim initially opened
my eyes to the power of keyboard navigation, improving both my speed and
ergonomics. This journey has not only honed my skills in shell scripting
and using command-line tools but has elevated my development process to
what feels like &quot;the speed of thought.&quot; It&apos;s as if tasks unfold
effortlessly before me, making me not just a better developer, but one
who feels in sync with my tools.&lt;/p&gt;
&lt;p&gt;Many years ago, a good friend and I spoke about building our own text
editor. We wanted to tweak and adjust every tiny bit to get it just
right. Who would have thought that legends like Vim and Emacs were
already out there, offering the very customization we dreamt of? Looking
back, each editor I dove into, from Sublime&apos;s slickness and innovation
to Neovim&apos;s extensibility and synergy with CLI tools, had its own charm
and taught me something new. Right now I love Neovim, but the world of
text editors and development environments is ever-evolving. While I have
pushed myself to learn Vi-keybindings and explore new ways of working
when I was already comfortable, I wouldn&apos;t suggest people make big
changes, but I would definitely encourage others to learn something new
about their development environment every week. No matter where I land
in future, this journey has taught me that the perfect editor isn&apos;t just
about features, it&apos;s about feeling right at home while also continuously
expanding my understanding of how I can work.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Permissions issue with Intellij-Idea on Linux]]></title><description><![CDATA[I didn't find anything mentioning this specific issue online so I
thought I'd make a short article to help anyone in the same position.
This…]]></description><link>https://css-plus.com/2022/permissions-issue-with-intellij-idea-on-linux</link><guid isPermaLink="false">https://css-plus.com/2022/permissions-issue-with-intellij-idea-on-linux</guid><pubDate>Tue, 16 Aug 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I didn&apos;t find anything mentioning this specific issue online so I
thought I&apos;d make a short article to help anyone in the same position.
This should be relevant to anyone who has installed Intellij-Idea (or
any other Jetbrains app) within a sandbox environment, such as
&lt;a href=&quot;https://flatpak.org/&quot;&gt;Flatpak&lt;/a&gt; or Ubuntu &lt;a href=&quot;https://snapcraft.io/&quot;&gt;Snap&lt;/a&gt; and is having problems
accessing files from their system through Intellij.&lt;/p&gt;
&lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;
&lt;h2&gt;Problem&lt;/h2&gt;
&lt;p&gt;I installed Intellij-Idea on my &lt;a href=&quot;https://pop.system76.com/&quot;&gt;Pop!_Os&lt;/a&gt; Linux (A fork of
Ubuntu) setup through the Pop!_Shop, which typically installs the apps
as a flatpak file. I was having strange issues where Intellij-Idea
wouldn&apos;t list all files under certain directories, such as &lt;code class=&quot;language-text&quot;&gt;/usr/bin&lt;/code&gt;.
In my case &lt;code class=&quot;language-text&quot;&gt;/usr/bin/bash&lt;/code&gt; was visible and selectable, but not
&lt;code class=&quot;language-text&quot;&gt;/usr/bin/zsh&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I tried various things to get this to work as well as searching for
anyone who had run into the same situation. I ended up setting up a
separate &lt;code class=&quot;language-text&quot;&gt;.bashrc&lt;/code&gt; mimicking most of my &lt;code class=&quot;language-text&quot;&gt;.zshrc&lt;/code&gt; for Intellij-Idea
itself.&lt;/p&gt;
&lt;p&gt;I was trying to find a quickfix instead of trying to figure out what was
going on. Today I wanted to get it to work since I wasn&apos;t able to export
my local DB through &lt;code class=&quot;language-text&quot;&gt;pg_dump&lt;/code&gt;, since &lt;code class=&quot;language-text&quot;&gt;/usr/bin/pg_dump&lt;/code&gt; was one of the
binaries not there.&lt;/p&gt;
&lt;p&gt;I realised that it was installed as Flatpak app, which runs in a sandbox
and must not have some or other permission. I tried installing Flatseal
to give the permissions. Unfortunately I wasn&apos;t able to give
Intellij-Idea the necessary permissions. I&apos;m really glad I came across
Flatseal though, it looks like a great tool.&lt;/p&gt;
&lt;h2&gt;Solution&lt;/h2&gt;
&lt;p&gt;To make sure there weren&apos;t sandbox permission issues, I installed the
&lt;a href=&quot;https://www.jetbrains.com/help/idea/installation-guide.html#toolbox&quot;&gt;Jetbrains toolbox app&lt;/a&gt; via the instructions
on the Jetbrains website. &lt;a href=&quot;https://www.jetbrains.com/help/idea/installation-guide.html#standalone&quot;&gt;The standalone install&lt;/a&gt; would work too.&lt;/p&gt;
&lt;p&gt;This solved all of the app permission issues I was having.&lt;/p&gt;
&lt;p&gt;While I had this issue with Flatpak, I suspect this would be an issue on
Ubuntu if installed as a Snap package.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to merge two MySQL WordPress databases]]></title><description><![CDATA[Recently I've had to do this and I was unable to find something that
could solve my problem online. I wanted to merge a WooCommerce…]]></description><link>https://css-plus.com/2015/03/how-to-merge-two-wordpress-databases-with-mysql</link><guid isPermaLink="false">https://css-plus.com/2015/03/how-to-merge-two-wordpress-databases-with-mysql</guid><pubDate>Mon, 30 Mar 2015 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Recently I&apos;ve had to do this and I was unable to find something that
could solve my problem online. I wanted to merge a &lt;a href=&quot;http://www.woothemes.com/woocommerce/&quot;&gt;WooCommerce
Wordpress&lt;/a&gt; site into a very large
&lt;a href=&quot;https://wordpress.org/&quot;&gt;Wordpress&lt;/a&gt; blog. It ended up being relatively
simple to do this, however I&apos;d just like to note that I&apos;m not a
&lt;a href=&quot;http://www.mysql.com/&quot;&gt;MySQL&lt;/a&gt; so there may be much more efficient ways
of doing this, however this was good enough for my needs. Make sure to
backup your Wordpress database before messing around with it.&lt;/p&gt;
&lt;h2&gt;Problems were faced&lt;/h2&gt;
&lt;p&gt;The problem when merging Wordpress databases is that you end up having
conflicts with the primary keys. Initially I thought this wasn&apos;t a
problem since I could just merge the one into the other without
specifying the primary key. Mysql would auto-increment this and all my
problems would have been solved. I tried this and quickly realised that
this would only work for me if I was merging a single table. By
auto-incrementing the primary keys in the various tables I was merging,
it broke the primary/foreign key relationship between them. What was the
solution? Simple, increment all primary and foreign keys in one of the
databases by X (read: insert number here). X can change depending on how
large your database is. I was working on a particularly large one and
did an increment of 10 000.&lt;/p&gt;
&lt;p&gt;You have db1 and db2. You want db1 to have the extra posts/content
types/categories/images included in db2. Do the primary/foreign key
increments on db2. Mysqldump the relevant tables from db2 with
--no-something-or-other flag and then import that script into db1.&lt;/p&gt;
&lt;h2&gt;Bash script&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Bash_%28Unix_shell%29&quot;&gt;bash&lt;/a&gt; script
below will export posts, pages, products, images, categories and tags
from db2 into db2.sql. Edit it to your needs. I&apos;ve left comments in the
bash script.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Wordpress export&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Assuming the db details are:&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# db_name = db2&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# db_user = root&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# db_pass = pass&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# =============================================================================&lt;/span&gt;

&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Change all IDs to avoid conflicts&quot;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;====================================================&quot;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# wp_posts&lt;/span&gt;
mysql &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;UPDATE wp_posts 
    SET id = REPLACE(
        id, 
        wp_posts.id, 
        wp_posts.id + 10000
    ) 
    WHERE id &amp;amp;gt; 0&quot;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# wp_postmeta&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Increment post_id &lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Increment meta_value fields for post thumbnails to retain reference&lt;/span&gt;
mysql &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;UPDATE wp_postmeta 
    SET post_id = REPLACE(
        post_id, wp_postmeta.post_id, 
        wp_postmeta.post_id + 10000
    ) 
    WHERE post_id &amp;amp;gt; 0&quot;&lt;/span&gt;
mysql &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;UPDATE wp_postmeta 
    SET meta_value = REPLACE(
        meta_value, 
        wp_postmeta.meta_value, 
        wp_postmeta.meta_value + 10000
    ) 
    WHERE meta_key = &apos;_thumbnail_id&apos;&quot;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# wp_terms&lt;/span&gt;
mysql &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;UPDATE wp_terms 
    SET term_id = REPLACE(
        term_id, wp_terms.term_id, 
        wp_terms.term_id + 10000
    ) 
    WHERE term_id &amp;amp;gt; 0&quot;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# wp_term_taxonomy&lt;/span&gt;
mysql &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;UPDATE wp_term_taxonomy 
    SET term_taxonomy_id = REPLACE(
        term_taxonomy_id, wp_term_taxonomy.term_taxonomy_id, 
        wp_term_taxonomy.term_taxonomy_id + 10000
    ) 
    WHERE term_taxonomy_id &amp;amp;gt; 0&quot;&lt;/span&gt;
mysql &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;UPDATE wp_term_taxonomy 
    SET term_id = REPLACE(
        term_id, 
        wp_term_taxonomy.term_id, 
        wp_term_taxonomy.term_id + 10000
    ) 
    WHERE term_id &amp;amp;gt; 0&quot;&lt;/span&gt;
mysql &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;UPDATE wp_term_taxonomy 
    SET parent = REPLACE(
        parent, 
        wp_term_taxonomy.parent, 
        wp_term_taxonomy.parent + 10000
    ) 
    WHERE parent &amp;amp;gt; 0&quot;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# wp_term_relationships&lt;/span&gt;
mysql &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;UPDATE wp_term_relationships 
    SET object_id = REPLACE(
        object_id, 
        wp_term_relationships.object_id, 
        wp_term_relationships.object_id + 10000
    ) 
    WHERE object_id &amp;amp;gt; 0&quot;&lt;/span&gt;
mysql &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 &lt;span class=&quot;token parameter variable&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;UPDATE wp_term_relationships 
    SET term_taxonomy_id = REPLACE(
        term_taxonomy_id, 
        wp_term_relationships.term_taxonomy_id, 
        wp_term_relationships.term_taxonomy_id + 10000
    ) 
    WHERE term_taxonomy_id &amp;amp;gt; 0&quot;&lt;/span&gt;

&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Now for the dumping&quot;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;====================================================&quot;&lt;/span&gt;

mysqldump --no-create-info &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 wp_posts &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&lt;/span&gt;gt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; wp_posts.sql
mysqldump --no-create-info &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 wp_postmeta &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&lt;/span&gt;gt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; wp_postmeta.sql
mysqldump --no-create-info &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 wp_terms &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&lt;/span&gt;gt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; wp_terms.sql
mysqldump --no-create-info &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 wp_term_taxonomy &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&lt;/span&gt;gt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; wp_term_taxonomy.sql
mysqldump --no-create-info &lt;span class=&quot;token parameter variable&quot;&gt;--user&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;root &lt;span class=&quot;token parameter variable&quot;&gt;--password&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; db2 wp_term_relationships &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&lt;/span&gt;gt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; wp_term_relationships.sql

&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Edit exported files to allow for seamless inserting&quot;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;====================================================&quot;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# wp_postmeta id&apos;s don&apos;t need to be force incremented. Remove all ID inserts&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-ir&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;s/[)],[(][0-9]*,/),(/g&quot;&lt;/span&gt; wp_postmeta.sql
&lt;span class=&quot;token function&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;s/INSERT INTO \&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;`&lt;/span&gt;wp_postmeta&lt;span class=&quot;token punctuation&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;`&lt;/span&gt;&lt;/span&gt; VALUES ([0-9]*,/INSERT INTO \&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;`&lt;/span&gt;wp_postmeta&lt;span class=&quot;token punctuation&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;`&lt;/span&gt;&lt;/span&gt; (\&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;`&lt;/span&gt;post_id&lt;span class=&quot;token punctuation&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;`&lt;/span&gt;&lt;/span&gt;, \&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;`&lt;/span&gt;meta_key&lt;span class=&quot;token punctuation&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;`&lt;/span&gt;&lt;/span&gt;, \&lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;`&lt;/span&gt;meta_value&lt;span class=&quot;token punctuation&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;`&lt;/span&gt;&lt;/span&gt;) VALUES (/g&quot;&lt;/span&gt; wp_postmeta.sql

&lt;span class=&quot;token comment&quot;&gt;# Prevents duplicates on wp_terms and wp_users script import&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;s/);/) ON DUPLICATE KEY UPDATE slug = slug;/g&quot;&lt;/span&gt; wp_terms.sql&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note: Users have been removed from the above export, therefore db1 users will be untouched.&lt;/p&gt;
&lt;p&gt;Once the script has done all of the hard work, it&apos;s time to import db2.sql into db1.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Import into dummy DB&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Import into dummy DB&quot;&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;====================================================&quot;&lt;/span&gt;
mysql &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt; root &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; db1 &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&lt;/span&gt;lt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; wp_posts.sql
mysql &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt; root &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; db1 &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&lt;/span&gt;lt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; wp_postmeta.sql
mysql &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt; root &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; db1 &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&lt;/span&gt;lt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; wp_terms.sql
mysql &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt; root &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; db1 &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&lt;/span&gt;lt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; wp_term_taxonomy.sql
mysql &lt;span class=&quot;token parameter variable&quot;&gt;-u&lt;/span&gt; root &lt;span class=&quot;token parameter variable&quot;&gt;-p&lt;/span&gt; db1 &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&lt;/span&gt;lt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; wp_term_relationships.sql&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That&apos;s it! Everything should have merged correctly.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to install Sass and Compass]]></title><description><![CDATA[This is a simple article that covers how to install Sass and Compass for terminal/command prompt usage, not how to use it. If you're looking…]]></description><link>https://css-plus.com/2014/05/install-sass-and-compass</link><guid isPermaLink="false">https://css-plus.com/2014/05/install-sass-and-compass</guid><pubDate>Mon, 26 May 2014 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;This is a simple article that covers how to &lt;strong&gt;install&lt;/strong&gt; &lt;a href=&quot;http://sass-lang.com/&quot;&gt;Sass&lt;/a&gt; and &lt;a href=&quot;http://compass-style.org/&quot;&gt;Compass&lt;/a&gt; for terminal/command prompt usage, not how to use it.&lt;/p&gt;
&lt;p&gt;If you&apos;re looking for the latter, check out this &lt;a href=&quot;http://css-tricks.com/video-screencasts/88-intro-to-compass-sass/&quot;&gt;css-tricks screencast&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Installing&lt;/h2&gt;
&lt;p&gt;When running Sass/Compass you&apos;ll only need Sass or Compass, but this article will instruct you to install both.&lt;/p&gt;
&lt;p&gt;Sass and Compass are Ruby applications, meaning you need to have Ruby installed. Ruby is a programming language.&lt;/p&gt;
&lt;h3&gt;Install on Windows&lt;/h3&gt;
&lt;p&gt;Make sure to read this whole section before installing.&lt;/p&gt;
&lt;p&gt;Firstly, you need to begin the &lt;a href=&quot;http://rubyinstaller.org/downloads/&quot;&gt;Ruby&lt;/a&gt; installation. It&apos;s probably best to pick the latest version. At the time of writing I would choose &lt;code class=&quot;language-text&quot;&gt;Ruby 2.0.0-p481 (x64)&lt;/code&gt; since that&apos;s the latest version and I&apos;m running a 64 bit OS.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Important note:&lt;/strong&gt; While running the installation, there is a checkbox option that is un-ticked by default: &lt;em&gt;Add Ruby executables to your PATH&lt;/em&gt;. Make sure that is ticked. This allows for the keyword &lt;code class=&quot;language-text&quot;&gt;ruby&lt;/code&gt; to be linked to the Ruby installation for your command prompt.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 513px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/1cc73506e7e2c59fb26ba435189596a4/3047a/ruby-install-windows.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 77.70270270270271%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAQABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAECBf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHs2CNE/8QAFxAAAwEAAAAAAAAAAAAAAAAAABARAf/aAAgBAQABBQJTCP8A/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAFhABAQEAAAAAAAAAAAAAAAAAMRAA/9oACAEBAAY/AjFZ/8QAGhAAAwEAAwAAAAAAAAAAAAAAAAERIUFxkf/aAAgBAQABPyHLh79nJFo6dMQbR//aAAwDAQACAAMAAAAQEz//xAAVEQEBAAAAAAAAAAAAAAAAAAAAEf/aAAgBAwEBPxBX/8QAFREBAQAAAAAAAAAAAAAAAAAAABH/2gAIAQIBAT8QR//EABwQAQEAAgIDAAAAAAAAAAAAAAERADEhUWHB8f/aAAgBAQABPxBKCM6cIHCefjKrVtofWGsNu6YKxXUcU8Nz/9k=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;&amp;quot;Ruby install windows&amp;quot;&quot;
        title=&quot;&quot;
        src=&quot;/static/1cc73506e7e2c59fb26ba435189596a4/3047a/ruby-install-windows.jpg&quot;
        srcset=&quot;/static/1cc73506e7e2c59fb26ba435189596a4/a80bd/ruby-install-windows.jpg 148w,
/static/1cc73506e7e2c59fb26ba435189596a4/1c91a/ruby-install-windows.jpg 295w,
/static/1cc73506e7e2c59fb26ba435189596a4/3047a/ruby-install-windows.jpg 513w&quot;
        sizes=&quot;(max-width: 513px) 100vw, 513px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Once this is done it&apos;s time to install Sass and Compass.&lt;/p&gt;
&lt;p&gt;Run the following commands:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;gem &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; sass compass&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The above will install both Sass and Compass. It may take a while so just give it time to do it&apos;s thing. Once it&apos;s done, you&apos;re done. Give yourself a high five.&lt;/p&gt;
&lt;h3&gt;Install on OS X/Linux&lt;/h3&gt;
&lt;p&gt;By default OS X and Linux have Ruby installed. So this should be very easy. Run the following command:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;shell&quot;&gt;&lt;pre class=&quot;language-shell&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;token function&quot;&gt;sudo&lt;/span&gt; gem &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; sass compass&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That&apos;s it. Yay for Unix based operating systems.&lt;/p&gt;
&lt;h2&gt;But... I don&apos;t like the terminal/command prompt&lt;/h2&gt;
&lt;p&gt;It&apos;s not as complicated as it seems. The feeling of being at home within the terminal is quite a liberating feeling and I suggest you learn it. There are a bunch of Sass/Compass GUIs out there and I&apos;ve tried 3 of them. The following work in Windows, OS X and Linux.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://compass.kkbox.com/&quot;&gt;Compass.app&lt;/a&gt; is my favourite because it runs in the background and there is minimal interface.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://alphapixels.com/prepros/&quot;&gt;Prepros App&lt;/a&gt; Is also pretty good. I&apos;ve found some irritating things about it with regards to very specific Compass customization but it&apos;s really easy to use.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://mhs.github.io/scout-app/&quot;&gt;Scout&lt;/a&gt; is pretty easy to use. I found it a bit slow and laggy.&lt;/li&gt;
&lt;/ul&gt;</content:encoded></item><item><title><![CDATA[Create your own jQuery Image Slider]]></title><description><![CDATA[I originally posted this article on 15 September 2010. This is an updated version. This tutorial is for beginners. The method for creating…]]></description><link>https://css-plus.com/2013/10/create-your-own-jquery-image-slider</link><guid isPermaLink="false">https://css-plus.com/2013/10/create-your-own-jquery-image-slider</guid><pubDate>Wed, 02 Oct 2013 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I originally posted this article on 15 September 2010. This is an updated version.&lt;/p&gt;
&lt;p&gt;This tutorial is for beginners. The method for creating the slider could be done differently, but I feel this way is more simple to understand.&lt;/p&gt;
&lt;p&gt;It is important to picture what the HTML and CSS should be doing in order to create the component before actually beginning with the javascript. This way you know exactly what you are working towards. Below is a gif explaining the concept of the slider in terms of HTML and CSS.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/90bf99f41078c9c5f5f5a488ca713ee0/slider-gif.gif&quot; alt=&quot;slider&quot;&gt;&lt;/p&gt;
&lt;p&gt;Common things that cross my mind before actually jumping into development are:&lt;/p&gt;
&lt;dl&gt;
    &lt;dt&gt;Where are the hidden elements situated?&lt;/dt&gt;
    &lt;dd&gt;Beneath, on top, next to or behind the visible element?&lt;/dd&gt;
    &lt;dt&gt;How are they hidden?&lt;/dt&gt;
    &lt;dd&gt;Is their display set to none?&lt;/dd&gt;
    &lt;dd&gt;Are they outside of the parent element which is set to overflow: hidden?&lt;/dd&gt;
    &lt;dd&gt;Are they hidden behind visible element via z-index?&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;All right, enough of that, let&apos;s get started.&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;p&gt;Before we create anything, we should try and get an idea of exactly what we are trying to achieve. I&apos;ve drawn up a quick &lt;a href=&quot;http://css-plus.com/wp-content/uploads/2010/09/gallery-wireframe.png&quot;&gt;image slider wireframe&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So let&apos;s turn that into &lt;abbr title=&quot;HyperText Markup Language&quot;&gt;HTML&lt;/abbr&gt;.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;div class=&quot;gallery-wrap&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
  &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;div class=&quot;gallery clearfix&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
    &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;div class=&quot;gallery__item&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
      &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;img src=&quot;images/image1.jpg&quot; class=&quot;gallery__img&quot; alt=&quot;&quot; /&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
    &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
     &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;div class=&quot;gallery__item&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
      &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;img src=&quot;images/image2.jpg&quot; class=&quot;gallery__img&quot; alt=&quot;&quot; /&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
    &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
  &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
  &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;div class=&quot;gallery__controls clearfix&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
    &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;div href=&quot;#&quot; class=&quot;gallery__controls-prev&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
      &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;img src=&quot;images/prev.png&quot; alt=&quot;&quot; /&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
    &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
    &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;div href=&quot;#&quot; class=&quot;gallery__controls-next&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
      &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;img src=&quot;images/next.png&quot; alt=&quot;&quot; /&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
    &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
  &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;.gallery-wrap&lt;/code&gt; will be the visible area.
&lt;code class=&quot;language-text&quot;&gt;.gallery&lt;/code&gt; is the element that contains the list of images.
&lt;code class=&quot;language-text&quot;&gt;.gallery__controls&lt;/code&gt; contains the next and previous controls.&lt;/p&gt;
&lt;p&gt;Generally an image slider would contain more than 2 images but I&apos;ve left out the exact HTML I used in the demo for readability.&lt;/p&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.gallery-wrap&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; hidden&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 732px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.gallery&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; relative&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.gallery__item&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;list-style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.gallery__img&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 4px solid #40331b&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 175px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 160px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token selector&quot;&gt;.gallery__controls&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.gallery__controls-prev&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; pointer&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.gallery__controls-next&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; pointer&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; right&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The most important thing here is to set &lt;code&gt;.gallery&lt;/code&gt; to &apos;&lt;code&gt;position: relative&lt;/code&gt;&apos; and to set &lt;code&gt;.gallery-wrap&lt;/code&gt; to &apos;&lt;code&gt;overflow: hidden&lt;/code&gt;&apos;. The CSS is quite straight forward.&lt;/p&gt;
&lt;h2&gt;The jQuery/Javascript&lt;/h2&gt;
&lt;p&gt;This is where all the fancy tricks take place.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Only run everything once the page has completely loaded&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// Fancybox specific&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.gallery__link&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fancybox&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token string-property property&quot;&gt;&apos;titleShow&apos;&lt;/span&gt;     &lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string-property property&quot;&gt;&apos;transitionIn&apos;&lt;/span&gt;  &lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&apos;elastic&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token string-property property&quot;&gt;&apos;transitionOut&apos;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&apos;elastic&apos;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// Set general variables&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// ====================================================================&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; totalWidth &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// Total width is calculated by looping through each gallery item and&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// adding up each width and storing that in `totalWidth`&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.gallery__item&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        totalWidth &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; totalWidth &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;outerWidth&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// The maxScrollPosition is the furthest point the items should&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// ever scroll to. We always want the viewport to be full of images.&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; maxScrollPosition &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; totalWidth &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.gallery-wrap&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;outerWidth&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// This is the core function that animates to the target item&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// ====================================================================&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;toGalleryItem&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;$targetItem&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// Make sure the target item exists, otherwise do nothing&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;$targetItem&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;length&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;

            &lt;span class=&quot;token comment&quot;&gt;// The new position is just to the left of the targetItem&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; newPosition &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; $targetItem&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;token comment&quot;&gt;// If the new position isn&apos;t greater than the maximum width&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;newPosition &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&lt;/span&gt;lt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; maxScrollPosition&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;

                &lt;span class=&quot;token comment&quot;&gt;// Add active class to the target item&lt;/span&gt;
                $targetItem&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;gallery__item--active&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

                &lt;span class=&quot;token comment&quot;&gt;// Remove the Active class from all other items&lt;/span&gt;
                $targetItem&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;siblings&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;removeClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;gallery__item--active&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

                &lt;span class=&quot;token comment&quot;&gt;// Animate .gallery element to the correct left position.&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.gallery&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;token literal-property property&quot;&gt;left&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt; newPosition
                &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// Animate .gallery element to the correct left position.&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.gallery&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;token literal-property property&quot;&gt;left&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt; maxScrollPosition
                &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// Basic HTML manipulation&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// ====================================================================&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// Set the gallery width to the totalWidth. This allows all items to&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// be on one line.&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.gallery&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;totalWidth&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// Add active class to the first gallery item&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.gallery__item:first&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;gallery__item--active&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// When the prev button is clicked&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// ====================================================================&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.gallery__controls-prev&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// Set target item to the item before the active item&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; $targetItem &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.gallery__item--active&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;prev&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;toGalleryItem&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;$targetItem&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// When the next button is clicked&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// ====================================================================&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.gallery__controls-next&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// Set target item to the item after the active item&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; $targetItem &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.gallery__item--active&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;toGalleryItem&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;$targetItem&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I have heavily commented the above code. All lines beginning with &lt;code&gt;//&lt;/code&gt; are comment lines.&lt;/p&gt;
&lt;p&gt;To recap, the following was done:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Only run everything once the window (page) loads.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Calculate the total width of all the images.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Calculate the maximum scroll position. This is the total images width subtract the viewport (&lt;code&gt;.gallery&lt;/code&gt;) width.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create the toGalleryItem function. This function will scroll to any item we desire.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If the target item exists, continue. Otherwise there is nothing left to run.&lt;/li&gt;
&lt;li&gt;The new position is the left position of the slide/image, relative to it&apos;s container &lt;code&gt;.gallery&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If the new position is less than or equal to the maximum scroll position, toggle active classes accordingly and animate to the new left position.&lt;/li&gt;
&lt;li&gt;Otherwise animate to the maximum scroll position.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set slide container (&lt;code class=&quot;language-text&quot;&gt;.gallery&lt;/code&gt;) width to the sum of all the images width.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the first image as active.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When the previous button is clicked, go to the previous slide/image.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When the next button is clicked, go to the next slide/image.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I will break down the javascript into 2 parts.
I&apos;m going to break the above up into 2 parts. Part explaining the variable declarations and part 2 explaining the rest of the jQuery/javascript.&lt;/p&gt;
&lt;h2&gt;Summary of javascript/jQuery methods used:&lt;/h2&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;$(&quot;.gallery__item&quot;).each()&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://api.jquery.com/each/&quot;&gt;jQuery.each documentation&lt;/a&gt;. Aslso, I&apos;ve written an article explaining the &lt;a href=&quot;http://css-plus.com/2011/09/master-the-jquery-for-each-loop/&quot;&gt;various jQuery each methods&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;totalWidth = totalWidth + $(this).outerWidth(true);&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://api.jquery.com/outerWidth/&quot;&gt;jQuery.outerWidth documentation&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;function toGalleryItem($targetItem) {&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function&quot;&gt;Javascript function
documentation&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A function is a bit of javascript that can be run just by calling the function name. Essentially it&apos;s a shortcut. Functions can be made dynamic by allowing the user to pass in variables or parameters such as &lt;code class=&quot;language-text&quot;&gt;$targetItem&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;if ($targetItem.length) {&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else&quot;&gt;JavaScript conditional statement
documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&apos;ve written an article about the &lt;a href=&quot;http://css-plus.com/2011/07/jquery-if-else-statements/&quot;&gt;if statement&lt;/a&gt; you may want to have a look at.&lt;/p&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;addClass&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;removeClass&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;jQuery &lt;a href=&quot;http://api.jquery.com/addClass/&quot;&gt;addClass&lt;/a&gt; and
&lt;a href=&quot;http://api.jquery.com/removeClass/&quot;&gt;removeClass&lt;/a&gt; documentation.&lt;/p&gt;
&lt;p&gt;These are self explanetory jQuery functions.&lt;/p&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;$(&quot;.gallery&quot;).animate()&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;jQuery &lt;a href=&quot;http://api.jquery.com/animate/&quot;&gt;.animate()&lt;/a&gt; documentation.
This is a magic jQuery function that allows you to animate a wide range of CSS properties.&lt;/p&gt;
&lt;p&gt;That&apos;s about it! I hope you&apos;ve found this tutorial useful.&lt;/p&gt;
&lt;p&gt;If you have any questions or comments, feel free to leave a comment below.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[inline-block: The complete story]]></title><description><![CDATA[inline-block is something I hadn't used until a couple of months ago. I was comfortable with block and inline elements so I didn't feel the…]]></description><link>https://css-plus.com/2013/01/inline-block-the-complete-story</link><guid isPermaLink="false">https://css-plus.com/2013/01/inline-block-the-complete-story</guid><pubDate>Mon, 07 Jan 2013 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;code&gt;inline-block&lt;/code&gt; is something I hadn&apos;t used until a couple of months ago. I was comfortable with block and inline elements so I didn&apos;t feel the need to learn anything more. I was also under the impression, as I&apos;m sure many developers are, that anything other than &lt;code&gt;display: block&lt;/code&gt; and &lt;code&gt;display: inline&lt;/code&gt; has cross-browser inconsistency problems and should be avoided.&lt;/p&gt;
&lt;p&gt;This article focuses on why you should start using &lt;code&gt;display: inline-block&lt;/code&gt;, understanding this value as well as how to make sure it is consistent across all modern browsers and IE7+.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; If you don&apos;t yet know the differences between inline and block level elements, check out what &lt;a href=&quot;http://www.css-101.org/block-level-elements/index.php&quot;&gt;css-101&lt;/a&gt; has to say about it.&lt;/p&gt;
&lt;h2&gt;inline-block is your missing friend&lt;/h2&gt;
&lt;code&gt;inline-block&lt;/code&gt; solves all sorts of problems web-devs run into on a daily basis. I&apos;m going to go through various common scenarios and cover how I would deal with them in a cross-browser fashion. You may notice some odd/hacky CSS included in the following examples - this will be covered in the Browser Compatibility section later in the article.
&lt;h2&gt;inline-block vertically center (IBVC) hack&lt;/h2&gt;
Chris Coyier talks about a &lt;a href=&quot;http://css-tricks.com/centering-in-the-unknown/&quot;&gt;&quot;Ghost&quot; IBVC method&lt;/a&gt; and he credits Michal Czernow for it&apos;s origin. Chris also mentions how it&apos;s equivalent to the &lt;code&gt;display: table/table-cell&lt;/code&gt; method since it also doesn&apos;t support IE7. I&apos;ve been playing around with &lt;code&gt;inline-block&lt;/code&gt; and tinkering with vertical centering and I&apos;ve come up with something that seems to be the &apos;Ghost&apos; method (I&apos;d discovered the &apos;Ghost&apos; method after stumbling upon this solution) with a few differences. The two differences being mine supports IE6+ (not that IE6 matters at all anymore, just an FYI) and it doesn&apos;t require pseudo elements to function.
&lt;p&gt;Being able to vertically center an element with a dynamic height is something that has plagued developers (or me at least) for a very long time and the cross-browser solution has been somewhat of a holy grail. I&apos;ve seen many different vertical centering methods, the most popular being the display: table used with display: table-cell. The problem with this is IE7 doesn&apos;t support either of those display values.&lt;/p&gt;
&lt;pre class=&quot;codepen&quot; data-height=&quot;550&quot; data-type=&quot;result&quot; data-href=&quot;e5868d4087fbd7d5fb9d18c4a2831b03&quot; data-user=&quot;JamyGolden&quot; data-safe=&quot;true&quot;&gt;&lt;/pre&gt;
&lt;p&gt;I feel this hack is a &lt;em&gt;more simple&lt;/em&gt; and &lt;em&gt;easily understandable&lt;/em&gt; way of vertically/horizontally centering an element than the previously mentioned table/table-cell/IE7-bug-hack method. I also feel it&apos;s much easier to understand and work with than the &lt;a href=&quot;http://gtwebdev.com/workshop/vcenter/vcenter-inline-css.php&quot;&gt;Gary Turner method&lt;/a&gt; too, but well done to him for coming up with that over &lt;strong&gt;7 years ago&lt;/strong&gt;. I&apos;m sure other people will feel differently about this being the &quot;best&quot; way, however this is what I prefer..&lt;/p&gt;
&lt;h3&gt;Problems&lt;/h3&gt;
&amp;nbsp;
&lt;h4&gt;vertical-align property&lt;/h4&gt;
One slight downside to this I&apos;ve noticed is &lt;code&gt;vertical-align: middle&lt;/code&gt; vertically aligns the capital letters, so lower case letters or &lt;code&gt;inline-block&lt;/code&gt; elements are very slightly &lt;em&gt;off center&lt;/em&gt;. I&apos;ve noticed elements being off by about 2px to 4px depending on what size the items are. Although this occurs it&apos;s pretty much negligible for me - especially since I can&apos;t actually notice this unless I actually count pixels.
&lt;h5&gt;Space characters&lt;/h5&gt;
Space characters are handled like a space would be handled within inline-elements. This means that spaces and or tabs will be displayed as a space once the page has rendered. There are a &lt;a href=&quot;http://css-tricks.com/fighting-the-space-between-inline-block-elements/&quot;&gt;couple of ways to work around this problem&lt;/a&gt; but it can be annoying nonetheless.
&lt;h4&gt;IE7 hand-holding&lt;/h4&gt;
The above mentioned ‘space characters&apos; problem doesn&apos;t take affect in IE7. The problem IE7 does come with is that it requires at least 1 other &lt;code&gt;inline-block&lt;/code&gt; element to be present to allow the &lt;code&gt;inline-block&lt;/code&gt; to vertically center. To get around this, I&apos;ve added an &quot;invisible&quot; element after the item I&apos;m centering - I&apos;ve added it afterwards incase &lt;code&gt;:first-child&lt;/code&gt; is used. This was included in the Ghost method through pseudo elements. Even though I&apos;ve managed to remove pseudo elements, I&apos;ve had to add an equivalent (or worse since it&apos;s actual markup) for IE7. Boo.
&lt;h4&gt;Alternative methods&lt;/h4&gt;
There is an IE7 CSS bug in which you can center an element vertically, and if used along side the table/table-cell method, it can work nicely (However I haven&apos;t used it in practice). This &lt;a href=&quot;http://dabblet.com/gist/2403795&quot;&gt;can also be done&lt;/a&gt; using the &lt;a href=&quot;http://html5please.com/#flexbox&quot;&gt;Flexbox&lt;/a&gt; layout module - &lt;a href=&quot;http://weblog.bocoup.com/dive-into-flexbox/&quot;&gt;Flexbox&lt;/a&gt; is definitely something that will be used much more in future, however as &lt;a href=&quot;https://twitter.com/__leroux&quot;&gt;Le Roux&lt;/a&gt; pointed out to me, the current Flexbox support right now is a bit flakey - So it may be another 1 or 2 years before we can start using it with absolute confidence.
&lt;h2&gt;Centering navigation items&lt;/h2&gt;
I often come across a navigation design where the amount of items in the navigation should be dynamic, however the navigation itself should remain centered regardless of how many or how wide the items are. &lt;a href=&quot;http://css-plus.com/2010/11/how-to-horizontally-centre-anything-with-css/&quot;&gt;Previously&lt;/a&gt; I would have centered this with &lt;code&gt;display: table&lt;/code&gt;, however, since display: table doesn&apos;t have any IE7 support, I would have probably also used an IE7 javascript fallback (Or just let the navigation appear left aligned in IE7). With &lt;code&gt;display: inline-block&lt;/code&gt;, this same result can be achieved with 2 (or 4 including IE7 support) css properties and values.
&lt;pre class=&quot;codepen&quot; data-height=&quot;200&quot; data-type=&quot;result&quot; data-href=&quot;HEztc&quot; data-user=&quot;JamyGolden&quot; data-safe=&quot;true&quot;&gt;&lt;/pre&gt;
How simple was that? Seriously?
&lt;h2&gt;Article block listings&lt;/h2&gt;
Generally I solve the following kind of problem differently depending on the exact design and how I feel at the time.
&lt;img class=&quot;aligncenter size-full wp-image-1623&quot; src=&quot;http://css-plus.com/wp-content/uploads/2013/01/article-listing.jpg&quot; alt=&quot;article listing example&quot; width=&quot;437&quot; height=&quot;328&quot;&gt;
&lt;p&gt;An easy &lt;code&gt;inline-block&lt;/code&gt; solution would be:&lt;/p&gt;
&lt;pre class=&quot;codepen&quot; data-height=&quot;500&quot; data-type=&quot;result&quot; data-href=&quot;cpzaI&quot; data-user=&quot;JamyGolden&quot; data-safe=&quot;true&quot;&gt;&lt;/pre&gt;
&lt;p&gt;The design could have been more tricky, though. Typically the height would be dynamic, or possibly both the height and width. As you can see this isn&apos;t exactly a &lt;a href=&quot;http://masonry.desandro.com/&quot;&gt;masonry&lt;/a&gt; layout since each row starts and ends at the same top-offset. It is still not possible to solve a masonry design in LTE IE9 &lt;a href=&quot;http://sickdesigner.com/masonry-css-getting-awesome-with-css3/&quot;&gt;without javascript&lt;/a&gt;. The height of these items are dynamic though, mere floats wouldn&apos;t work correctly. If we used floats would end up with something like this:&lt;/p&gt;
&lt;pre class=&quot;codepen&quot; data-height=&quot;500&quot; data-type=&quot;result&quot; data-href=&quot;ajGzI&quot; data-user=&quot;JamyGolden&quot; data-safe=&quot;true&quot;&gt;&lt;/pre&gt;
&lt;p&gt;To avoid that we could use &lt;a href=&quot;http://css-tricks.com/how-nth-child-works/&quot;&gt;:nth-child&lt;/a&gt; and detect the first item in each row and then clear: left, but that would pose some cross-browser problems itself since &lt;a href=&quot;http://caniuse.com/#feat=css-sel3&quot;&gt;:nth-child is only supported by modern browsers&lt;/a&gt;. We could add classes to these items via the CMS/backend language, but it would be easier if we could just get this working with CSS alone and without any problems! :(
Yay, &lt;code&gt;inline-block&lt;/code&gt; the the rescue again! :D You didn&apos;t expect that did you?!&lt;/p&gt;
&lt;pre class=&quot;codepen&quot; data-height=&quot;500&quot; data-type=&quot;result&quot; data-href=&quot;KvBGC&quot; data-user=&quot;JamyGolden&quot; data-safe=&quot;true&quot;&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h2&gt;More navigation&lt;/h2&gt;
Surely there is some limit to the IE7 support? What about an &lt;code&gt;inline-block&lt;/code&gt; within an &lt;code&gt;inline-block&lt;/code&gt;?!
&lt;pre class=&quot;codepen&quot; data-height=&quot;200&quot; data-type=&quot;result&quot; data-href=&quot;dEtzx&quot; data-user=&quot;JamyGolden&quot; data-safe=&quot;true&quot;&gt;&lt;/pre&gt;
In the above example I have &lt;strong&gt;3 levels of nested &lt;code&gt;inline-block&lt;/code&gt; items&lt;/strong&gt; and it works perfectly in IE7+.
&lt;h2&gt;Browser compatibility&lt;/h2&gt;
If you&apos;ve read up until this point, you are well aware that an &lt;strong&gt;IE7 hack should be used to &quot;enable&quot; the &lt;code&gt;inline-block&lt;/code&gt; functionality&lt;/strong&gt;.
&lt;h3&gt;The IE7 hack&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;.item { display: block; *display: inline; zoom: 1; }&lt;/code&gt;&lt;/pre&gt;
This could be turned into valid CSS if you are using the &lt;a href=&quot;http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/&quot;&gt;&amp;lt;html&amp;gt; conditional classes&lt;/a&gt; (included in &lt;a href=&quot;https://github.com/h5bp/html5-boilerplate&quot;&gt;h5bp&lt;/a&gt;):
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;.item { display: inline-block; }
.lt-ie8 .item { display: inline; zoom: 1; }&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Why does that work?&lt;/h4&gt;
IE7 doesn&apos;t support &lt;code&gt;inline-block&lt;/code&gt; per se, however you can mimic the functionality by making it be an inline element and triggering &lt;a href=&quot;http://www.satzansatz.de/cssd/onhavinglayout.html&quot;&gt;hasLayout &lt;/a&gt;on the element. The &lt;code&gt;zoom: 1&lt;/code&gt; visually doesn&apos;t change anything. It is applied this way because it is one of the properties that triggers hasLayout.
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;code&gt;inline-block&lt;/code&gt; is an amazing and underrated and underused property, in my opinion. &lt;code&gt;inline-block&lt;/code&gt; is something that can and should be used today with confidence. We fear that which we do not understand - hopefully &lt;code&gt;inline-block&lt;/code&gt; is now added to your CSS toolbox.</content:encoded></item><item><title><![CDATA[CSS Animation: How it works from transitions to animations]]></title><description><![CDATA[CSS animation is definitely the next big step in CSS. Absolutely amazing things can be done with this. It is literally up to your…]]></description><link>https://css-plus.com/2012/07/css-animation-how-it-works-from-transitions-to-animations</link><guid isPermaLink="false">https://css-plus.com/2012/07/css-animation-how-it-works-from-transitions-to-animations</guid><pubDate>Mon, 23 Jul 2012 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;CSS animation is definitely the next big step in CSS. Absolutely amazing things can be done with this. It is literally up to your imagination, as you’ll come to realize if you don’t already understand how CSS animations work. HTML5 and javascript continues to replacing what Flash was previously used for, and similarly CSS continues to replace functionality javascript was used to provide. In this article we’re going to cover the CSS animation basics and make sure we’ve learnt it well enough to add it to our development-toolbox.&lt;/p&gt;
&lt;h2&gt;So, what’s the difference between the Transition property and the Animation property?&lt;/h2&gt;
&lt;p&gt;There are two basic differences:&lt;/p&gt;
&lt;p&gt;The first major difference is that transitions only have a &lt;code class=&quot;language-text&quot;&gt;to&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;from&lt;/code&gt; state. Transitions also only effect once a pseudo class (such as &lt;code class=&quot;language-text&quot;&gt;:hover&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;:focus&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;:checked&lt;/code&gt;, etc) is triggered or removed.
The second notable difference between animations and transitions are &lt;code class=&quot;language-text&quot;&gt;@keyframes&lt;/code&gt;. Transitions only have two @keyframes (the &lt;code class=&quot;language-text&quot;&gt;to&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;from&lt;/code&gt; states), but animations can have an endless number of &lt;code class=&quot;language-text&quot;&gt;@keyframes&lt;/code&gt;. The keyframe positions are set with percentage values. You could make a ball spin and bounce up and down with only few lines of CSS (Sort of. Since you’ll have to do everything multiple times with vendor prefixes, the CSS gets quite a bit longer).&lt;/p&gt;
&lt;h2&gt;Animation syntax&lt;/h2&gt;
&lt;p&gt;The animation property and keyframes go hand in hand. The animation property’s ‘values’ are the element-to-be-animated’s options and the keyframes are the actions it should follow.&lt;/p&gt;
&lt;p&gt;A simpler way to put it is:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Animation&lt;/strong&gt;: How to animate – duration, speed, etc.
&lt;strong&gt;Keyframes&lt;/strong&gt;: The properties to animate – &lt;code class=&quot;language-text&quot;&gt;from&lt;/code&gt;/&lt;code class=&quot;language-text&quot;&gt;to&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The following &lt;code class=&quot;language-text&quot;&gt;animation&lt;/code&gt; property is shorthand for the various CSS properties which will be covered later in this section.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#element&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; name duration timing-function delay iteration-count direction&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
 
&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@keyframes&lt;/span&gt; name&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;0%&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; value1&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;    &lt;span class=&quot;token comment&quot;&gt;/* Start of animation duration */&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;35%&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; value2&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;   &lt;span class=&quot;token comment&quot;&gt;/* 35% through the animation duration*/&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;100%&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; value3&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;  &lt;span class=&quot;token comment&quot;&gt;/* End of animation duration */&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;animation-name&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The name of the animation. This value links the animation properties to the keyframes. This value is required, without this the keyframes can’t be referenced.&lt;/p&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;animation-duration&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The time it takes for the animation to complete in seconds.&lt;/p&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;animation-timing-function&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Supported timing-function keywords are: linear, ease, ease-in, ease-in-out, ease-out, step-start, step-end. The cubic-bezier() CSS function is supported by animation-timing-function and can be used to create custom timing-functions.&lt;/p&gt;
&lt;p&gt;If left out, this property defaults to ease.&lt;/p&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;animation-delay&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The amount of time, in seconds, waited before the animation begins after the animation has been applied to the element.&lt;/p&gt;
&lt;p&gt;If left out, this property defaults to 0s.&lt;/p&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;animation-iteration-count&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The amount of times the animation should run. Negative values are treated as 1 and fraction values play that fraction of that animation. For example 1.5 will play through the animation 1 time and stop halfway through the second iteration. &lt;code class=&quot;language-text&quot;&gt;infinite&lt;/code&gt; does what you’d imagine, it doesn’t stop the animation.&lt;/p&gt;
&lt;p&gt;If left out, this property defaults to 1.&lt;/p&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;animation-direction&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The direction of the animation. This property has 4 values: normal, alternate, reverse, alternate-reverse.&lt;/p&gt;
&lt;p&gt;The “normal” state would play through the keyframes from the lowest percentage to the highest. This property can be set to &lt;code class=&quot;language-text&quot;&gt;reverse&lt;/code&gt; where it will play from 100% down to 0%.&lt;/p&gt;
&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;alternate&lt;/code&gt; runs the animation in reverse every second iteration, so the animation goes from 0% to 100% the first time and then from 100% to 0% the second time and repeats that pattern. This is property gives the effect that the animation doesn’t restart.&lt;/p&gt;
&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;reverse&lt;/code&gt; runs the keyframes in reverse, for example it begins at 100% and ends at 0%.&lt;/p&gt;
&lt;p&gt;Lastly, &lt;code class=&quot;language-text&quot;&gt;alternate-reverse&lt;/code&gt; begins at 100% and reverses every second iteration.&lt;/p&gt;
&lt;p&gt;If left out, this property defaults to ‘normal’.&lt;/p&gt;
&lt;h2&gt;CSS Keyframes&lt;/h2&gt;
&lt;p&gt;Along with the animation-name, keyframes are the most important aspects of CSS animations. Keyframes are the animation instructions.&lt;/p&gt;
&lt;p&gt;Percentage values are used to indicate the point at which the values of a keyframe should be achieved. The &lt;code class=&quot;language-text&quot;&gt;from&lt;/code&gt; keyword references 0% and the &lt;code class=&quot;language-text&quot;&gt;to&lt;/code&gt; keyword references 100%. Functionally the following is identical:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@keyframes&lt;/span&gt; example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;0%&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;100%&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;/* And */&lt;/span&gt;
&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@keyframes&lt;/span&gt; example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Quick demonstration based on the previously covered properties&lt;/p&gt;
&lt;iframe height=&quot;300&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;CSS Animation - Moving a ball around&quot; src=&quot;https://codepen.io/jamygolden/embed/GRQPJJd/34e2449b8b941b178174e275908fefb1?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/GRQPJJd/34e2449b8b941b178174e275908fefb1&quot;&gt;
  CSS Animation - Moving a ball around&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;p&gt;In the above example I’ve made use of:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;animation-name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;animation-duration&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;animation-timing-function&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;animation-iteration-count&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The 4 &lt;code class=&quot;language-text&quot;&gt;ball&lt;/code&gt; keyframes are telling the element to animate through each of the 4 keyframes within 6 seconds, while making use of a the boring ‘ol linear &lt;code class=&quot;language-text&quot;&gt;timing-function&lt;/code&gt; and to do this indefinitely.&lt;/p&gt;
&lt;p&gt;As you can see, the keyframes syntax is similar to the media query syntax (And SCSS!) – which most people have been exposed to. Hopefully that makes you feel more at home!&lt;/p&gt;
&lt;p&gt;That’s really all there is to it. Let’s go over a more detailed tutorial to make this even more digestible.&lt;/p&gt;
&lt;h3&gt;Simple tutorial&lt;/h3&gt;
&lt;p&gt;First we have to come up with a cool animation idea. I’m a big fan of Paul Irish (and you should be too) so I’m going to do some sort of animation involving him.&lt;/p&gt;
&lt;p&gt;I’ve taken this image and cut out the arm quite badly, so I have two images. The plan is to layer the arm on top of the larger image and animate it.
First we need to define the html&lt;/p&gt;
&lt;h3&gt;HTML&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;paul&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;arm&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;img/paul-arm.png&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;CSS&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#paul&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../img/paul-bg.jpg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; no-repeat left top&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 450px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;token property&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; hidden&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 600px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; relative&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#paul .arm&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;token property&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; pumping-iron 2s ease-out alternate infinite&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@keyframes&lt;/span&gt; pumpingIron&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;0%&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;20deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;100%&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 70px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;-20deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4&gt;So a recap of the above CSS&lt;/h4&gt;
&lt;p&gt;Set the basic properties to #paul
Absolutely position &lt;code class=&quot;language-text&quot;&gt;.arm&lt;/code&gt; and set the animation property with the relevant values. I’ve named the keyframe animation &lt;code class=&quot;language-text&quot;&gt;pumping-iron,&lt;/code&gt; set the &lt;code class=&quot;language-text&quot;&gt;animation-duration&lt;/code&gt; to &lt;code class=&quot;language-text&quot;&gt;3s,&lt;/code&gt; used the boring-old linear timing-function and set the loop to infinite because Paul never gets tired of pumping-iron.
Keyframe #1 sets the starting position of Paul’s arm and keyframe #2 sets the end position. The &lt;code class=&quot;language-text&quot;&gt;animation-direction&lt;/code&gt; value &lt;code class=&quot;language-text&quot;&gt;alternate&lt;/code&gt; tells the animation that once it has completed, it should alternate the keyframes. This brings the animation back to the starting position. The animation-iteration-count value &lt;code class=&quot;language-text&quot;&gt;infinite&lt;/code&gt; tells the animation to continue forever.
You would really feel the vendor-prefixes on this one. A prefix on the &lt;code class=&quot;language-text&quot;&gt;@keyframes&lt;/code&gt; means you duplicate that entire keyframe section 5 times! Looking at the prefixed version of animation and &lt;code class=&quot;language-text&quot;&gt;@keyframes&lt;/code&gt; is definitely intimidating, but as long as you realize it’s just CSS bloat you should be fine. Let’s take a look at this for visual reference… Be prepared:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#paul .arm&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-animation&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; pumping-iron 2s ease-out alternate infinite&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-animation&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; pumping-iron 2s ease-out alternate infinite&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-ms-animation&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; pumping-iron 2s ease-out alternate infinite&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-o-animation&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; pumping-iron 2s ease-out alternate infinite&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; pumping-iron 2s ease-out alternate infinite&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@-webkit-keyframes&lt;/span&gt; pumping-iron&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;-webkit-transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;20deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 70px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;-webkit-transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;-20deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@-moz-keyframes&lt;/span&gt; pumping-iron&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;-moz-transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;20deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;-moz-transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;20deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@-ms-keyframes&lt;/span&gt; pumping-iron&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;-ms-transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;20deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;-ms-transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;20deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@-o-keyframes&lt;/span&gt; pumping-iron&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;-o-transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;20deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;-o-transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;20deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@keyframes&lt;/span&gt; pumping-iron&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;20deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -90px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;20deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And now for the final product!&lt;/p&gt;
&lt;iframe height=&quot;550&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;CSS Animation - Strong Paul&quot; src=&quot;https://codepen.io/jamygolden/embed/YzedXqY/4c59d4c82e6a8d832f0f1a392042844d?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/YzedXqY/4c59d4c82e6a8d832f0f1a392042844d&quot;&gt;
  CSS Animation - Strong Paul&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;h3&gt;Cross Browser compatibility&lt;/h3&gt;
&lt;p&gt;To quote HTML5Please:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For now, either use animations only to provide non-essential aesthetic enhancements or use feature detection to provide an alternative experience for browsers that do not support this feature.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Currently all modern browsers and/including IE10 support CSS animations with a vendor prefix. Next time you come across an animation you need to add, use CSS animations and either fall back to no animation or use Modernizr to detect for the support and fall back to the javascript you would have added anyway. Viva la progressive enhancement.&lt;/p&gt;
&lt;p&gt;…And because Modernizr is so damn cool and simple to use I’ll briefly explain how exactly to make use of this feature detection and fallback option.&lt;/p&gt;
&lt;iframe height=&quot;300&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;CSS Animations - Working with fallbacks&quot; src=&quot;https://codepen.io/jamygolden/embed/eYVbNdp/1746ddc41b40a6d74f00c9a822174891?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/eYVbNdp/1746ddc41b40a6d74f00c9a822174891&quot;&gt;
  CSS Animations - Working with fallbacks&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;p&gt;Modernizr adds various classes to the HTML element depending on whether the browser supports a feature or not. You could make use of classes such as .boxshadow, .no-boxshadow, .borderradius, .no-borderradius, etc. This puts the power of feature detection right into the CSS which is great and easy to make use of. You could also do more intricate feature detection by using their Modernizr javascript object.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;I think you should all be using CSS animations right now, provided you include the vendor-prefixed versions and have a decent fallback for non-modern browsers.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to horizontally center elements of a dynamic width]]></title><description><![CDATA[A couple of months ago I wrote an article titled "How to horizontally center anything with CSS". The featured method of the article was to…]]></description><link>https://css-plus.com/2012/05/how-to-horizontally-center-elements-of-a-dynamic-width</link><guid isPermaLink="false">https://css-plus.com/2012/05/how-to-horizontally-center-elements-of-a-dynamic-width</guid><pubDate>Mon, 21 May 2012 00:00:00 GMT</pubDate><content:encoded>&lt;!-- switch from jsfiddle to codepen? --&gt;
&lt;p&gt;A couple of months ago I wrote an article titled &quot;&lt;a href=&quot;http://css-plus.com/2010/11/how-to-horizontally-centre-anything-with-css/&quot; title=&quot;How to horizontally center anything with CSS&quot;&gt;How to horizontally center anything with CSS&lt;/a&gt;&quot;. The featured method of the article was to &lt;strong&gt;center an element with a dynamic width&lt;/strong&gt; using &lt;code&gt;display: table&lt;/code&gt;. &lt;!--more--&gt;This works wonderfully in IE8+ and modern browsers. I would usually ignore IE7&apos;s inability to render this property, however, every now and then it would &lt;em&gt;have&lt;/em&gt; to work in IE7. This is an example of the &lt;code&gt;display: table&lt;/code&gt; method:&lt;/p&gt;
&lt;iframe style=&quot;margin-top: 10px; width: 100%; height: 300&quot; src=&quot;http://jsfiddle.net/cssplus/5grwG/embedded/result,html,css/&quot; allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;
&lt;h2&gt;New Method&lt;/h2&gt;
Ever since I came across the IE7 inline-block hack, I&apos;ve been using it whenever I can. It works in IE7, why wouldn&apos;t I use it everywhere?
&lt;p&gt;Inline-blocks can be centered with the use of &lt;code&gt;text-align: center&lt;/code&gt;. Therefore, a list of inline-blocks can be centered extremely easily. &lt;em&gt;This works absolutely wonderfully for horizontally centered navigations&lt;/em&gt;, or anything that doesn&apos;t have block level elements within it.
This is an example of a navigation dynamically centered with the use of inline-block elements and the &lt;code&gt;text-align: center&lt;/code&gt; property:&lt;/p&gt;
&lt;iframe style=&quot;width: 100%; height: 300px&quot; src=&quot;http://jsfiddle.net/cssplus/Wa37V/2/embedded/result,html,css/&quot; allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;
You may have noticed that the HTML doesn&apos;t have spaces between the elements for readability like the previous example does. This is because the elements are treating the spaces/enters/tabs between them as an actual space since they are behaving like inline elements. IE7 doesn&apos;t support &lt;code&gt;inline-block&lt;/code&gt;, however an inline element which receives &lt;a href=&quot;http://www.satzansatz.de/cssd/onhavinglayout.html&quot;&gt;hasLayout&lt;/a&gt; behaves as if it were an inline-block. &lt;code&gt;zoom: 1&lt;/code&gt; is one of the properties which forces hasLayout on an element in IE.
&lt;h2&gt;Conclusion&lt;/h2&gt;
This is an extremely simple way of solving a dynamically centered navigation problem with brilliant browser support. It may not be the solution for every &lt;code&gt;display: table&lt;/code&gt; that is/was used, but it can definitely help in a bunch of different scenarios.</content:encoded></item><item><title><![CDATA[A border-image Investigation]]></title><description><![CDATA[is a really great property that can and should be used right now. There are some decent fallbacks which gets covered later on in the article…]]></description><link>https://css-plus.com/2012/04/a-border-image-investigation</link><guid isPermaLink="false">https://css-plus.com/2012/04/a-border-image-investigation</guid><pubDate>Wed, 18 Apr 2012 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; is a really great property that can and should be used right now. There are some decent fallbacks which gets covered later on in the article.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/&quot;&gt;MDN&lt;/a&gt; is usually really great resource when it comes to documentation relating to HTML, CSS and Javascript but their &lt;a href=&quot;https://developer.mozilla.org/en/CSS/border-image&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; documentation&lt;/a&gt;        is definitely lacking - I think it&apos;s due to the absence of actual examples. The best resource I&apos;ve come across for &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; is definitely the &lt;a href=&quot;http://www.w3.org/TR/css3-background/#border-images&quot;&gt;/W3C spec/&lt;/a&gt; - I can&apos;t
say I&apos;ve said that before. That&apos;s the reason I&apos;ve decided to write this article - A resource that thoroughly explains the basics of the &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; properties with relevant examples.&lt;/p&gt;
&lt;h2&gt;What is &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt;?&lt;/h2&gt;
&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; is quite self-descriptive - It allows you to use an image as a border for an element. Before getting into too detailed, here is an example:&lt;/p&gt;
&lt;iframe height=&quot;200&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;Basic border-image example&quot; src=&quot;https://codepen.io/jamygolden/embed/gOvQymR/e195f3d5b86e4783136b101dac93bb51?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/gOvQymR/e195f3d5b86e4783136b101dac93bb51&quot;&gt;
  Basic border-image example&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; is shorthand for the following properties:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#border-image-source&quot;&gt;border-image-source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#border-image-slice&quot;&gt;border-image-slice&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#border-image-width-and-outset&quot;&gt;border-image-width&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#border-image-width-and-outset&quot;&gt;border-image-outset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#border-image-repeat&quot;&gt;border-image-repeat&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If these properties replaced their value counterparts in the &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; property, it would look like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.border&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &amp;lt;border-image-source&gt; &amp;lt;border-image-slice&gt; &amp;lt;border-image-width&gt; &amp;lt;border-image-outset&gt; &amp;lt;border-image-repeat&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;the bolded properties are required, the others may be left out.&lt;/p&gt;
&lt;p&gt;Where are the pixel values?
A typical example of a &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; property could look like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.border&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;border-image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../img/border.png&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; 20 10 20 10&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;border-width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Numerical values are used instead of pixel values and percentage values are accepted too. The numerical values refer to pixels if it&apos;s a rasterized image ( &lt;code class=&quot;language-text&quot;&gt;jpg&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;png&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;gif&lt;/code&gt; ) and co-ordinates if it&apos;s a SVG image.
Every &lt;code class=&quot;language-text&quot;&gt;border-image-*&lt;/code&gt; property is heavily reliant upon the border-width property since no pixel values are set within the &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; property.&lt;/p&gt;
&lt;h3&gt;Vendor Prefixes&lt;/h3&gt;
&lt;p&gt;Vendor prefixed versions of &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; only support the &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; shorthand and not &lt;code class=&quot;language-text&quot;&gt;border-image-slice&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;border-image-repeat&lt;/code&gt;, etc.&lt;/p&gt;
&lt;p&gt;Now for the &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; properties&lt;/p&gt;
&lt;h2&gt;&lt;span id=&quot;border-image-source&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;border-image-source&lt;/code&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;This property requires the CSS url function just like background-image property does. The image we provide here is the image that is going to be used as the border&apos;s image.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.border&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;border-image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../img/border.png&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;SVG&lt;/h3&gt;
&lt;p&gt;Svg elements can be used. They are handled slightly differently within the different browsers - firefox seems to rasterize the svg element and apart from IE9, at the moment Firefox seems to have the worst &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; support.&lt;/p&gt;
&lt;h2&gt;&lt;span id=&quot;border-image-slice&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;border-image-slice&lt;/code&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;This property accepts 4 values, just like the &lt;code class=&quot;language-text&quot;&gt;margin&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;padding&lt;/code&gt; property as well as an optional fill value:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.border&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;border-image-slice&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; top right bottom left fill&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;The 4 numerical values&lt;/h3&gt;
&lt;p&gt;These 4 values cut the image into 9 parts or regions. TopLeft, Top, TopRight, Right, BottomRight, Bottom, BottomLeft and the Center region.&lt;/p&gt;
&lt;p&gt;The image below is an example &lt;code class=&quot;language-text&quot;&gt;.png&lt;/code&gt; file that could be used for the &lt;code class=&quot;language-text&quot;&gt;border-image-source&lt;/code&gt;.&lt;/p&gt;
&lt;img src=&quot;http://css-plus.com/examples/2012/04/border-image/img/example-2.png&quot; alt=&quot;&quot;&gt;
&lt;p&gt;Below is the same image with the &lt;code class=&quot;language-text&quot;&gt;border-image-slice&lt;/code&gt; region as a grid overlay:&lt;/p&gt;
&lt;img src=&quot;http://css-plus.com/examples/2012/04/border-image/img/example-2-grid.png&quot; alt=&quot;&quot;&gt;
&lt;p&gt;Obviously 4 numerical values are not required, there are shorthand versions just like the &lt;code class=&quot;language-text&quot;&gt;margin&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;padding&lt;/code&gt; properties have.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.border&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;border-image-slice&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10 10 10 10&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.border2&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;border-image-slice&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20 10 20 10&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;/** Shorthand version **/&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.border&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;border-image-slice&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.border2&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;border-image-slice&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20 10&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Fill&lt;/h3&gt;
&lt;p&gt;You may be a bit unsure as to what exactly the 9th section of the image is for. Well, it&apos;s up to you whether you want to use it or not, but it could be used as a pseudo-background. You have the option to completely ignore it and use the background property, or you could use this &apos;pseudo-background&apos; by appending the fill value to the &lt;code class=&quot;language-text&quot;&gt;border-image-slice&lt;/code&gt; property. This &apos;fills&apos; everything within the border with that section of the image. This fill image is either repeated or stretched depending on the &lt;code class=&quot;language-text&quot;&gt;border-image-repeat&lt;/code&gt; property. An example of fill in use:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.border&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;border-image-slice&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10 20 fill&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;/** or **/&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.border&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;border-image-slice&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 30 40 10 20 fill&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;/** or **/&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.border&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;border-image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../img/border.png&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; 10 fill&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If the fill keyword is left out, by default the fill is not applied, HOWEVER: all vendor prefixed versions of &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; have fill applied by default and there is no way of disabling this option. A work around would be to have the center area of the &lt;code class=&quot;language-text&quot;&gt;border-image-source&lt;/code&gt; image transparent.&lt;/p&gt;
&lt;h3&gt;Ratio&lt;/h3&gt;
&lt;p&gt;The &lt;code class=&quot;language-text&quot;&gt;border-image-slice&lt;/code&gt; is heavily dependant upon the border-width property. Imagine these properties being linked by ratio: &lt;code class=&quot;language-text&quot;&gt;border-width&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;border-image-slice&lt;/code&gt;. Let&apos;s say we have a &lt;code class=&quot;language-text&quot;&gt;30px&lt;/code&gt; border - 90% of the time we would make sure the &lt;code class=&quot;language-text&quot;&gt;border-image-slice&lt;/code&gt; matches the border width:&lt;/p&gt;
&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;30px:30&lt;/code&gt; - There is a &lt;strong&gt;1:1&lt;/strong&gt; ratio.&lt;/p&gt;
&lt;p&gt;If we have: &lt;code class=&quot;language-text&quot;&gt;90px:30&lt;/code&gt; - that is a &lt;strong&gt;3:1&lt;/strong&gt; ratio. This means the border image will be stretched to 3 times its original size.&lt;/p&gt;
&lt;iframe height=&quot;450&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;border-image-slice exampl&quot; src=&quot;https://codepen.io/jamygolden/embed/wvyRvgM/7f4667ecb9838ac48d703159ef193d83?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/wvyRvgM/7f4667ecb9838ac48d703159ef193d83&quot;&gt;
  border-image-slice example&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;h3&gt;Bugs&lt;/h3&gt;
&lt;p&gt;The firefox doesn&apos;t seem to actually set the slice area correctly while using a vector image. When the border-width increases, the slice doesn&apos;t scale along with it. This defeats the point of using a vector image for a border image. Hopefully this
will be fixed soon.&lt;/p&gt;
&lt;h2&gt;&lt;span id=&quot;border-image-width-and-outset&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;border-image-width&lt;/code&gt; &amp;#x26; &lt;code class=&quot;language-text&quot;&gt;border-image-outset&lt;/code&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;These properties don&apos;t affect the box-model.
By default the &lt;code class=&quot;language-text&quot;&gt;border-image-width&lt;/code&gt; value is 1 and the &lt;code class=&quot;language-text&quot;&gt;border-image-outset&lt;/code&gt; is 0.
These properties accept a numerical value.
Their values are multiplied by the border-width and rendered accordingly.&lt;/p&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;border-image-width&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;This value represents how large the border&apos;s image should be. If you had something like:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.border&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    border-image-width`&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The width of the border&apos;s image would be 120px. The more the &lt;code class=&quot;language-text&quot;&gt;border-image-width&lt;/code&gt; value increases, the more the border&apos;s image grows into the box model without affecting the box-model by layering itself on top of the element&apos;s background.&lt;/p&gt;
&lt;iframe height=&quot;700&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;border-image-width example&quot; src=&quot;https://codepen.io/jamygolden/embed/abqPbKQ/e5c560d2721f550668fbe7ac9c6b86e8?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/abqPbKQ/e5c560d2721f550668fbe7ac9c6b86e8&quot;&gt;
  border-image-width example&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;h3&gt;&lt;code class=&quot;language-text&quot;&gt;border-image-outset&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;This value represents how far outside of the box-model the border image should be rendered. So:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.border&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-image-outset&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 30px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Would render the border 60px outside of the box model without affecting the box model.&lt;/p&gt;
&lt;iframe height=&quot;700&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;border-image-outset example&quot; src=&quot;https://codepen.io/jamygolden/embed/KKQbKZq/62a52d72c6298b99239dbabbbb638735?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/KKQbKZq/62a52d72c6298b99239dbabbbb638735&quot;&gt;
  border-image-outset example&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;h2&gt;&lt;span id=&quot;border-image-repeat&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;border-image-repeat&lt;/code&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;This property attempts to solve a possible problem with the repeated &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; area. 4 possible values are accepted: stretch, repeat, round or space.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Stretch&lt;/strong&gt; is the default value for the property. This value stretches the tile across the height/width of the element.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Repeat&lt;/strong&gt; merely repeats tiles.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Round&lt;/strong&gt; is the &apos;magic&apos; property. It repeats this area, however if a whole number of tiles don&apos;t fit in this area, the browser resizes the tiles so that it fits snugly. Currently only Firefox and Opera support this value. Any value Chrome
doesn&apos;t recognize in this property is treated as &apos;repeat&apos;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Space&lt;/strong&gt; is similar to round. A whole number of tiles must fit in correctly, otherwise the left over space is distributed evenly between the tiles. This is the only value that is currently not supported by any browser.&lt;/p&gt;
&lt;p&gt;An example of each follows:&lt;/p&gt;
&lt;iframe height=&quot;600&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;border-image-repeat examplw&quot; src=&quot;https://codepen.io/jamygolden/embed/QWQzWVg/dce1eee964284cac1672b54b95d92c5c?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/QWQzWVg/dce1eee964284cac1672b54b95d92c5c&quot;&gt;
  border-image-repeat example&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;h2&gt;Cool Tricks&lt;/h2&gt;
&lt;p&gt;The stretching colours cause gradients! You can do some pretty cool things with this:&lt;/p&gt;
&lt;iframe height=&quot;200&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;Creating a gradient with border-image&quot; src=&quot;https://codepen.io/jamygolden/embed/MWQZWLG/d3b72a15de2628f97563e48ae5572ac9?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/MWQZWLG/d3b72a15de2628f97563e48ae5572ac9&quot;&gt;
  Creating a gradient with border-image&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;h3&gt;Fallback&lt;/h3&gt;
&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; overwrites the &lt;code class=&quot;language-text&quot;&gt;border-color&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;border-style&lt;/code&gt; properties or visa versa depending on which has a higher specificity. Make sure you apply &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; after the usual border properties for a &apos;normal border&apos; fallback. Alternatively, there is always a web-developer&apos;s best friend, &lt;a href=&quot;http://www.modernizr.com/&quot;&gt;Modernizr&lt;/a&gt;. As for IE support, there is &lt;a href=&quot;http://css3pie.com/&quot;&gt;CSS3PIE&lt;/a&gt;. Unfortunately I&apos;ve failed to get this to work even though I followed the site&apos;s documentation. I never have much like with CSS3PIE outside of &lt;code class=&quot;language-text&quot;&gt;border-radius&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;box-shadow,&lt;/code&gt; it&apos;s probably something I&apos;m doing wrong. Firefox Nightly doesn&apos;t yet have support for prefix-free border-image. Firefox Nightly 14.0a1 wasn&apos;t able to render any example of &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; I had so I wasn&apos;t able to see how well it faired with proerties/values Firefox doesn&apos;t currently support, but I&apos;m sure it will support the prefix-free version &lt;a href=&quot;http://firefoxnightly.tumblr.com/post/14710582699/support-of-css3-border-image-added-prefixed&quot;&gt;sooner than later&lt;/a&gt;. Chrome Canary doesn&apos;t yet support the &lt;code class=&quot;language-text&quot;&gt;border-image-repeat&lt;/code&gt; properties apart from &lt;code class=&quot;language-text&quot;&gt;stretch&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;repeat&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Great resources&lt;/h2&gt;
&lt;p&gt;If you don&apos;t already know, &lt;a href=&quot;http://html5please.com&quot;&gt;HTML5Please&lt;/a&gt; is an excellent resource and lead me to &lt;a href=&quot;http://border-image.com&quot;&gt;border-image.com&lt;/a&gt; which is a great webapp that could help with any &lt;code class=&quot;language-text&quot;&gt;border-image&lt;/code&gt; development and understanding.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Gaussian Blur and CSS3/SVG]]></title><description><![CDATA[Edited: 07 January 2014 - Updated article to reflect current browser support.
Gaussian blur is something I use a lot when it comes to…]]></description><link>https://css-plus.com/2012/03/gaussian-blur</link><guid isPermaLink="false">https://css-plus.com/2012/03/gaussian-blur</guid><pubDate>Tue, 27 Mar 2012 00:00:00 GMT</pubDate><content:encoded>&lt;!-- switch from jsfiddle to codepen? --&gt;
&lt;p&gt;Edited: 07 January 2014 - Updated article to reflect current browser support.
Gaussian blur is something I use a lot when it comes to Photoshop. It would be very handy to have that kind of &apos;filter&apos; power within a browser environment.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;Before we get started, I think it&apos;s just important to understand that both the SVG and CSS filter properties affect an element and all of it&apos;s children. A child element cannot be &apos;un-blurred&apos;, only blurred more. There are a few methods of recreating this Gaussian blur effect, some work cross-browser, others don&apos;t but will be supported in future.&lt;/p&gt;
&lt;p&gt;In the example jsfiddles you may notice HTML IE conditional statements: Usually those conditional statements are applied to the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;html&gt;&lt;/code&gt; element and I&apos;ve added them to a div to mimic that functionality.&lt;/p&gt;
&lt;h2&gt;CSS3 text-shadow&lt;/h2&gt;
&lt;p&gt;Supported by:
&lt;img src=&quot;/99f0b30c952a8c2db4d206f9953db65d/chrome.svg&quot; alt=&quot;Chrome logo&quot; title=&quot;Supported by Chrome&quot; height=&quot;32&quot; width=&quot;32&quot;&gt;
&lt;img src=&quot;/ffa00c8838eb63e4355c57a47fcc9420/firefox.svg&quot; alt=&quot;Firefox logo&quot; title=&quot;Supported by Firefox&quot; height=&quot;32&quot; width=&quot;32&quot;&gt;
&lt;img src=&quot;/e3538ebd0eb1e90c5441a88b11e1a609/internet-explorer.svg&quot; alt=&quot;Internet Explorer logo&quot; title=&quot;Supported by Internet Explorer&quot; height=&quot;32&quot; width=&quot;32&quot;&gt;
&lt;img src=&quot;/de2866806e25c6080b5a6d84b379b2fc/opera.svg&quot; alt=&quot;Opera logo&quot; title=&quot;Supported by Opera&quot; height=&quot;32&quot; width=&quot;32&quot;&gt;
&lt;img src=&quot;/612592909559c93234168a9df8a5235b/safari.svg&quot; alt=&quot;Safari logo&quot; title=&quot;Supported by Safari&quot; height=&quot;32&quot; width=&quot;32&quot;&gt;&lt;/p&gt;
&lt;p&gt;I&apos;m sure you&apos;re either aware of, or easily understand how this trick works. Very simply, you give the text a text-shadow and make the it transparent so that only the shadow is visible. This gives a simple and effective blurred text effect. Usually I would detect for IE9 but it&apos;s necessary in this case since IE9 doesn&apos;t support text-shadow.&lt;/p&gt;
&lt;iframe height=&quot;200&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;Gaussian Blur applied through Blur effect applied to text with CSS3&quot; src=&quot;https://codepen.io/jamygolden/embed/wvyQZvq/2873341cbbff62b5b6a48bc87ecd4046?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/wvyQZvq/2873341cbbff62b5b6a48bc87ecd4046&quot;&gt;
  Gaussian Blur applied through Blur effect applied to text with CSS3&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;h3&gt;Problems&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Opera doesn&apos;t currently support the transition to the text-shadow property. The blur works well though!&lt;/li&gt;
&lt;li&gt;I&apos;ve applied a lte-IE8 shadow filter to the text. It looks more like a smudge than a blur, but there you have it - use it, don&apos;t use it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Fallback&lt;/h3&gt;
&lt;p&gt;Use &lt;a href=&quot;http://www.modernizr.com/&quot;&gt;Modernizr&lt;/a&gt; ( or feature detect manually ) for text-shadow support to apply fallback styles. This is necessary due to the fact that the text has a transparent color and without the shadow, the font is illegible.&lt;/p&gt;
&lt;h2&gt;SVG blur filter applied to a SVG element&lt;/h2&gt;
&lt;p&gt;Supported by: &lt;img title=&quot;Supported by Chrome&quot; src=&quot;/99f0b30c952a8c2db4d206f9953db65d/chrome.svg&quot; alt=&quot;Chrome Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;img title=&quot;Supported by Firefox&quot; src=&quot;/ffa00c8838eb63e4355c57a47fcc9420/firefox.svg&quot; alt=&quot;Firefox Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;img title=&quot;Supported by Opera&quot; src=&quot;/de2866806e25c6080b5a6d84b379b2fc/opera.svg&quot; alt=&quot;Opera Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;/p&gt;
&lt;p&gt;The title may seem superfluous but it&apos;s actually quite important to understand when it comes to SVG filters. SVG supports filters and we can easily and freely apply these filters to all kinds of SVG elements. Note: &lt;em&gt;NOT&lt;/em&gt; all kinds of &lt;em&gt;HTML&lt;/em&gt; elements, I&apos;ll elaborate a little later.&lt;/p&gt;
&lt;iframe height=&quot;200&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;Gaussian Blur applied through SVG blur filter applied to a SVG text element&quot; src=&quot;https://codepen.io/jamygolden/embed/poaQBzV/96cc9dd4d9712c3efaded27feaf168df?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/poaQBzV/96cc9dd4d9712c3efaded27feaf168df&quot;&gt;
  Gaussian Blur applied through SVG blur filter applied to a SVG text element&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;h3&gt;Problems&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Chrome isn&apos;t currently able to apply a SVG filter if one has already been applied to an element. This means: if a SVG element contains a filter, another filter won&apos;t be applied via class change, hover or any other CSS pseudo class.&lt;/li&gt;
&lt;li&gt;IE6-IE8 doesn&apos;t support SVG within HTML. They see these tags as made up tags and treats them as that. They elements are not able to be styled unless the SVG is wrapped in an element and that wrapper element is styled. Alternatively document.createElement() could be used (This is what the HTML5 shim/shiv makes use of. more about it by Paul Irish).&lt;/li&gt;
&lt;li&gt;No browser supports the transition property being applied to a SVG element&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;SVG blur filter applied to a SVG image element&lt;/h2&gt;
&lt;p&gt;Supported by:
&lt;img title=&quot;Supported by Chrome&quot; src=&quot;/99f0b30c952a8c2db4d206f9953db65d/chrome.svg&quot; alt=&quot;Chrome Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;
&lt;img title=&quot;Supported by Firefox&quot; src=&quot;/ffa00c8838eb63e4355c57a47fcc9420/firefox.svg&quot; alt=&quot;Firefox Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;
&lt;img title=&quot;Supported by Opera&quot; src=&quot;/de2866806e25c6080b5a6d84b379b2fc/opera.svg&quot; alt=&quot;Opera Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;/p&gt;
&lt;p&gt;Most of us want to apply a blur filter to images so the above example is all well and good, but it probably won&apos;t be of too much assistance since the CSS3 text-shadow blur does the same thing. We&apos;re not able to drop &lt;code class=&quot;language-text&quot;&gt;&amp;lt;img&gt;&lt;/code&gt; elements into SVG an image, luckily SVG has it&apos;s own way of inserting external images. Suddenly this gives us quite a lot of freedom when it comes to Gaussian blur or &lt;a href=&quot;https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html&quot;&gt;other&lt;/a&gt; &lt;a href=&quot;http://updates.html5rocks.com/2011/12/CSS-Filter-Effects-Landing-in-WebKit&quot;&gt;SVG filters&lt;/a&gt;.&lt;/p&gt;
&lt;iframe height=&quot;400&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;Gaussian Blur applied to SVG element&quot; src=&quot;https://codepen.io/jamygolden/embed/gOvQENL/04ac6ed8460245bda2e6bc89c7c9c074?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/gOvQENL/04ac6ed8460245bda2e6bc89c7c9c074&quot;&gt;
  Gaussian Blur applied to SVG element&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;h3&gt;Most of the above problems apply here as well as a few more:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Chrome can&apos;t apply a SVG filter if one has already been applied, however there is a work around for this in &lt;a href=&quot;http://tools.google.com/dlpage/chromesxs&quot;&gt;Chrome Canary&lt;/a&gt;. If you apply a filter to a parent SVG element and a hover filter to the child element, the hover effect will take place.&lt;/li&gt;
&lt;li&gt;No browser supports the transition property being applied to an SVG element&lt;/li&gt;
&lt;li&gt;IE9 renders the image (without an applied filter), But lte-IE8 doesn&apos;t display the image whatsoever.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;SVG Blur Filter applied to HTML elements&lt;/h2&gt;
&lt;p&gt;Supported by: &lt;img title=&quot;Supported by Firefox&quot; src=&quot;/ffa00c8838eb63e4355c57a47fcc9420/firefox.svg&quot; alt=&quot;Firefox Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;/p&gt;
&lt;iframe height=&quot;400&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;Gaussian Blur applied through SVG Blur Filter applied to HTML elements&quot; src=&quot;https://codepen.io/jamygolden/embed/xxYQeGv/2f19fa26b15a630cf035e733edd71519?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/xxYQeGv/2f19fa26b15a630cf035e733edd71519&quot;&gt;
  Gaussian Blur applied through SVG Blur Filter applied to HTML elements&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;h3&gt;Problems&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Firefox is the only browser that supports this&lt;/li&gt;
&lt;li&gt;The transition property still doesn&apos;t take affect when applied&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;CSS Blur Filter&lt;/h2&gt;
&lt;p&gt;Supported by:
&lt;img title=&quot;Supported by Chrome Canary&quot; src=&quot;/4cc94642bfe8f36ad5e22e8892f1f93b/chrome-canary.svg&quot; alt=&quot;Chrome Canary Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;
&lt;img title=&quot;Supported by Opera&quot; src=&quot;/de2866806e25c6080b5a6d84b379b2fc/opera.svg&quot; alt=&quot;Opera Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is where it all gets very exciting. A CSS property that fully supports all kinds of filters including the most important one (for this article at least), the blur filter. It is more simple to use than you could ever imagine – element { filter: blur(2px) }&lt;/p&gt;
&lt;p&gt;Unfortunately this can&apos;t be applied to SVG elements, however there is a bit of a work around: You can wrap the SVG element within an HTML tag and apply the CSS filter to that. The only draw back is that the entire SVG element will be blurred, and not a single element.&lt;/p&gt;
&lt;iframe height=&quot;400&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;Gaussian blur applied through CSS Blur Filter&quot; src=&quot;https://codepen.io/jamygolden/embed/qBxQwZB/69031ea6ed21fc8e8f77e3a882a703cc?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/qBxQwZB/69031ea6ed21fc8e8f77e3a882a703cc&quot;&gt;
  Gaussian blur applied through CSS Blur Filter&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;p&gt;It&apos;s merely a filter property with a blur value applied. Absolutely amazing. On top of everything, since it&apos;s a standard CSS property, the transition property works perfectly. You can transition from a normal image, to a half blurred/half grey scale image if you&apos;d like. It&apos;s all up to your imagination.&lt;/p&gt;
&lt;h3&gt;Problems&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Not complete browser support. Webkit only, currently.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &quot;problem&quot; is quite a large set back here. The only browser that supports this is a nightly browser version - This means that we should pretty much stay away from it until at least 2 popular browsers support it... Right?&lt;/p&gt;
&lt;h3&gt;I think you could use it now actually&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;As long as it&apos;s not an absolutely dependant feature, browsers will degrade gracefully - If the property isn&apos;t supported, the image is unaffected.&lt;/li&gt;
&lt;li&gt;It should be supported in Chrome pretty soon&lt;/li&gt;
&lt;li&gt;You could use the CSS filter (Webkit only) along with the SVG filter applied to an HTML element (Firefox only)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is an example of the CSS Filter used alongside the SVG filter.&lt;/p&gt;
&lt;iframe height=&quot;400&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;Gaussian blur applied through CSS Blur Filter and SVG filter&quot; src=&quot;https://codepen.io/jamygolden/embed/poaQBbO/c2284b884a664fbb3aed72adaf853237?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/poaQBbO/c2284b884a664fbb3aed72adaf853237&quot;&gt;
  Gaussian blur applied through CSS Blur Filter and SVG filter&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;p&gt;&lt;a href=&quot;http://updates.html5rocks.com/2011/12/CSS-Filter-Effects-Landing-in-WebKit&quot;&gt;HTML5 Rocks&lt;/a&gt; has a cool article and demo about this property - Keep in mind the demo currently only works in Chrome Canary.&lt;/p&gt;
&lt;h2&gt;Good old fashioned images&lt;/h2&gt;
&lt;p&gt;Supported by: &lt;img title=&quot;Supported by Chrome&quot; src=&quot;/99f0b30c952a8c2db4d206f9953db65d/chrome.svg&quot; alt=&quot;Chrome Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;img title=&quot;Supported by Firefox&quot; src=&quot;/ffa00c8838eb63e4355c57a47fcc9420/firefox.svg&quot; alt=&quot;Firefox Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;img title=&quot;Supported by Internet Explorer&quot; src=&quot;/e3538ebd0eb1e90c5441a88b11e1a609/internet-explorer.svg&quot; alt=&quot;Internet Explorer Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;img title=&quot;Supported by Opera&quot; src=&quot;/de2866806e25c6080b5a6d84b379b2fc/opera.svg&quot; alt=&quot;Opera Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;img title=&quot;Supported by Safari&quot; src=&quot;/612592909559c93234168a9df8a5235b/safari.svg&quot; alt=&quot;Safari Logo&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;/p&gt;
&lt;p&gt;This is obviously the most popular at the moment due to the browser support.&lt;/p&gt;
&lt;iframe height=&quot;600&quot; style=&quot;width: 100%;&quot; scrolling=&quot;no&quot; title=&quot;Gaussian blur effect applied through images&quot; src=&quot;https://codepen.io/jamygolden/embed/zYRyxvb/0b22d68f6f6d1464c2311a644f9d5e56?default-tab=result&quot; frameborder=&quot;no&quot; loading=&quot;lazy&quot; allowtransparency=&quot;true&quot; allowfullscreen=&quot;true&quot;&gt;
  See the Pen &lt;a href=&quot;https://codepen.io/jamygolden/pen/zYRyxvb/0b22d68f6f6d1464c2311a644f9d5e56&quot;&gt;
  Gaussian blur effect applied through images&lt;/a&gt; by Jamy (&lt;a href=&quot;https://codepen.io/jamygolden&quot;&gt;@jamygolden&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.
&lt;/iframe&gt;
&lt;h3&gt;Problems&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Increased page size due to extra images&lt;/li&gt;
&lt;li&gt;Increased HTTP requests (if you don&apos;t use a sprite)&lt;/li&gt;
&lt;li&gt;Annoying to manage if something has to change across all images&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What was learnt?&lt;/h2&gt;
&lt;p&gt;Chrome can&apos;t swap SVG filters. This means that an element can&apos;t have a SVG filter applied and then have that filter change on hover. IE9 can&apos;t do much of this which was expected, but what I didn&apos;t expect was for Safari to be almost as bad at it.&lt;/p&gt;
&lt;h2&gt;Anything else?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;You could blur the images via the HTML5 canvas, but that&apos;s another article.&lt;/li&gt;
&lt;li&gt;I don&apos;t really mention Safari in this article - Most of this doesn&apos;t seem to work in Safari 5.0.1 for Windows.&lt;/li&gt;
&lt;li&gt;The CSS filters are going to be very cool&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Article influences&lt;/h2&gt;
&lt;p&gt;Paul Irish helped me look in the right direction - There is a surprisingly little amount of information about this topic out there.&lt;/p&gt;
&lt;blockquote class=&quot;twitter-tweet&quot; data-in-reply-to=&quot;176918533891035136&quot;&gt;@&lt;a href=&quot;https://twitter.com/jamygolden&quot;&gt;jamygolden&lt;/a&gt; canary supports CSS filters &lt;a title=&quot;https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html&quot; href=&quot;https://t.co/vD34peBH&quot;&gt;dvcs.w3.org/hg/FXTF/raw-fi...&lt;/a&gt; certainly the shorthands. havent tried the others. you should!
— Paul Irish ◕‿◕ (@paul_irish) &lt;a href=&quot;https://twitter.com/paul_irish/status/176928121675726849&quot; data-datetime=&quot;2012-03-06T07:12:06+00:00&quot;&gt;March 6, 2012&lt;/a&gt;&lt;/blockquote&gt;
Paul&apos;s article &lt;a href=&quot;http://paulirish.com/2010/svg-filters-on-html5-video/&quot;&gt;SVG filters on HTML5 video&lt;/a&gt; was quite informative. &lt;a href=&quot;http://paulirish.com/2010/high-res-browser-icons/&quot;&gt;High Res Browser Icons&lt;/a&gt; was a life saver and I now make use of &lt;a href=&quot;http://css3please.com/&quot;&gt;CSS3 Please&lt;/a&gt; multiple times a day.
&lt;p&gt;The IE &apos;blur&apos; method which was used originates from a &lt;a href=&quot;http://www.useragentman.com/blog/2011/04/23/css-blurred-text-shadow-in-ie-part-i/&quot;&gt;useragentman article&lt;/a&gt;. Subsequently &lt;a href=&quot;http://www.useragentman.com/&quot;&gt;Zoltan Hawryluk&apos;s&lt;/a&gt; (the owner of the useragentman blog) added some really helpful comments in the comments area and helped achieve a really good looking text-blur effect for IE7+.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[My Journey to the Perfect Text-Editor]]></title><description><![CDATA[This article is about why I feel SublimeText 2 is the best text editor ever and how/why I ended up using it. I've decided to write this…]]></description><link>https://css-plus.com/2012/02/my-journey-to-the-perfect-text-editor</link><guid isPermaLink="false">https://css-plus.com/2012/02/my-journey-to-the-perfect-text-editor</guid><pubDate>Mon, 20 Feb 2012 00:00:00 GMT</pubDate><content:encoded>&lt;style type=&quot;text/css&quot;&gt;
.logo-list { display: flex; justify-content: left; }
.logo-list &gt; * { min-height: 40px; min-width: 40px; margin: 0 !important; }
.logo-list img[alt=&quot;GEdit logo&quot;] { min-width: 100px; }
&lt;/style&gt;
&lt;p&gt;This article is about why I feel SublimeText 2 is the best text editor ever and how/why I ended up using it. I&apos;ve decided to write this because I seem to talk about this topic quite often and it would be easier for me to reference someone to an article rather than explaining my rationale over and over again.&lt;/p&gt;
&lt;h2&gt;Dreamweaver&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAGAABAQEBAQAAAAAAAAAAAAAAAAMCBAX/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAemOdM+ukW8wuF//xAAbEAACAgMBAAAAAAAAAAAAAAACAwABBBESE//aAAgBAQABBQJ2Rdt9GLizpgGHGQzXnjDwkhopSh3P/8QAFhEBAQEAAAAAAAAAAAAAAAAAEBEh/9oACAEDAQE/AbhD/8QAFhEBAQEAAAAAAAAAAAAAAAAAAREg/9oACAECAQE/AWiTH//EABsQAAICAwEAAAAAAAAAAAAAAAABAhEQIUET/9oACAEBAAY/AvOHC9ikukrV7spCTN5//8QAHRABAQACAQUAAAAAAAAAAAAAAREAMUEQIVFhcf/aAAgBAQABPyFJQ0U5cXcB5aZreGIyJh7y4Rrsx9se+Dw3B1L96f/aAAwDAQACAAMAAAAQHzi8/8QAGREBAAIDAAAAAAAAAAAAAAAAAQAREDFB/9oACAEDAQE/EKqOkNRC3WP/xAAZEQACAwEAAAAAAAAAAAAAAAABEQAQMWH/2gAIAQIBAT8QHYA8h2MpV//EABsQAQEAAwEBAQAAAAAAAAAAAAERADFBIRDh/9oACAEBAAE/EE1BaB6e8DWKCpI0SbEcAuUR49MoAIHQW/mU1+lfCteXBgiMvK4cDGnphZtmqofP/9k=&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Windows logo&quot; title=&quot;&quot; src=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg&quot; srcset=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAADn0lEQVR42p1UT2gjdRTObsWLKHioVQQXD24PLtiDl+rFi15aEL0a9rB2K83iQQqLYnEOa2FVXAJRsrtQEFaq1EhaKO5uu92kSZpkkqYz+Z90MslMZppkkrRJmjbpn5n5ZEIHGlOk+i6/Nz/e73vf+968ZzCc0wBc0E6C+HZoenr63dN3/9ueLC19XW/swOVyWk8A+/7Ley37Bf3R4uLC5wCwU6vg1i3iA+1ubm6u71ylnSqlcw4NDfXn81y+0SjjwYOZ26fiLuox/6qTFmQymS5NTk5eMRgMfaOjo6/du2eev379k2sDAwMvTU1NvTU+Pv7K6aQ9RhCEls1gNpvfoChqvlbb2W02m4csy0YfP354c2bml6uxRGKmXClL1e3KMcOkqnb7H98PDg4+3wOsgxHEl5cFIc9pWilQFEVV0PFVBbIid/zG7g5EMYfCVk5WcYCFBdsPPQ3SSw3TtF171NxrHrUPWmgftNFuH6j7+02lUpUUUcjJPJ9BNpdWxK0sSNK9aTKZ3uySS2c3NjZ2uVyRWq12SwNUW+19HB0do96oQZJESNIWtgo8OC4NhompqRQNs/m70Z5u6x937/78cWO3gXqjru7tNXF4eAipJKJYymO7VkGxKIDjNpFOR1Q2E8N60FOamJh4sUc/h8PxzAnwVQ2wVt9RtHI5joEgZFFrVFGSRPACiwwTRyy6riaTFGg6IBIE8ULPxOgMzeYfP6pUy2ju76kZJgmGiaNWr6JYEjrAbDaBRIICTfnUIOlEJByU71gsb/eUrGt4zWi8UiwVjwSRA0k61eq2hEKBhyCwYLNJaKzCNIlQwAWve0mOR0h4PKt//mOyupy+ELUeCJBOsGxS0X4NjmfAsgmkkjQi4QBCQTdI71N43cvwOB+psTCJleWHvxkMhue6sHTK30zd/CoS9oPPZ+QMG0cmE0cqFUY0GgC1sYb1wGoH0Odehtv5SPV5luD1rNRHRkZe7dJSd/r7+1+mKD+fz29qrBQNLB4LIUKT2AitIRR0IeB3wLf2BI7lRTlGeTFvn7OcYFzsGj2d5f371k+FPINkgpKjkaAcjQaVZGID6ZRWtl8N+J2Ky/nXccC7AtK/KhqNxtdP9+LM5WC3234qFnKQSrwiihlsbPiOvWtPazTtl3kuBYFPIx4NHVmt1g/PZHdGp56dnf31C6djZdFm+/220Wh8Z3h4+NKNG5+9Z1+w3fF43LMWi/X9c2/t8672s+L+BnV/5SLYLOfbAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Apple logo&quot; title=&quot;&quot; src=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png&quot; srcset=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/8bbad176f0e19e675b2d71218e621f05/6cb0f/dreamweaver.png&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF8UlEQVR42k3QfVSMaRgG8EeUGjNJX9PMNNPXWlI+i6HyEWENrVKUZQ+7Z609rLCUmlSaooyaTtnsFrGIHTprY50+0KSUKGpG2dLU1DQVtt2o4ZWPd649b/aP/eN37j+e81z3dW5yoWLBvZquFaYq7cpXtZ0S6p4umKrXh1APDeuoRkMY9cCwjmowhFD13WupOt0aqkYnoe50rqRua5dTFU+WUjdaF1OlzQHUdbXfyJX74gGirPTXNA2swV3darqhZy0eGtahqXc9HvVHorl/IzT9EVD3bUBTbxgeGELQoP8c97okqNWtRHVnECqfBOLm40UobwlAcf38V0RZFdDU9DwY1e0Suk73uel+V6ipoTsMTYYN0PRtGA1T94aj0fAxsF4fjDrdKtR0rkBV+zJU/LkE5c0LUfYoAL/fFxvJxUo/tfrv1VAPrKFbBkPw58t1aBsKR/NfYXigD0WjIRQPDSF40LMWDfpg3Ov+r502CJWtS3GzZTFK1QEoafLDlbp5RnKpaoFa9WQZYg57v94ZO436bp/n68TMOSNFlUtMmr+CUdclwV3dKtR2foY7nctR3RGEyraluPV4MW60LBwNu9awAFcbxFDe8TWSy7XzNb+Ui0GIVddYM7aezZpoIGRCj6Ulp2+XdNrru4YgVHUsQ61+GW5rA3GjZREqWhfhVusiXG/0Q3G9GNceilFcPxfnK2YbSWGlr6ag1BeEsDr8AwXPiuv96eyLPm8+nerYS8j4blnu9JGSRwE4cWXOB+VtsankkT9+Kfcx5RbNpC/d8YWy2geKC1708SJvnCmbYSSnymdpcotngpDx7f7LnZ6VtfmhqicAh/OnU4RYdCwP4Q+k/Ow1Qoh596pwwWBZ63zM9bcfIMRCn1Yw9V1OkdcH5i14I2/ozC2vV+TENS+N4pI3CBnbNm+JXf/leh9crPHByZKZNIfD0oncrHvSTnu+NRtjqZ3ibdNbUDYDAhFHT8i4tqhkt1f7090pQsxadyS6UCf+mPqaZP/mqZGf92QCW30X2vYVVs/CmYoZyL3qZbJzYHVxOFY6hdKTFrpzuu0dWd3xOR5vBS7sHo61lW51JHdw/Te8IULMn8h+9jAplJONJPPXqZojBVPAbJztb9t/+uZ0nCz1RuZFT9qKZdXJFbC7T5V7Yf5Su6eWVpYda77gvvRdOOnpgkC7Z9NmT+wXB9o+5zmzu7KUn+LIaXcjOXpuskaWN3m0oY//pP7TN71RWDUdO5NcKOYM4iW2TwurvRH+Ne/FGGKhFbiy+yQRjv9s2sF/aefA0vOE7J6AINvn2UWfIPmEyzBJPeWhSfjRY7ThtFkT+2R5HqadiaJ3DjxWDyHmbVHJrtTJUk/sOiSixo2z0BJiod26h2+MSha+GWtmoWVEbOMOZRS642C2cJgk/+SqOZDhygS2EmLePmaMuY6QcVo226pj627BUJZyMuRnPZBw3PUDi23ZwSzZny58F5Mhes/czsxsfHtUkuCdLM8FcZmCYRKbIVIfKXBH5DanF2FbuYNhW7iDW6L4QwdzXN9nFHogJc8VKfluSM13xdbdPGPkNu5QQo7IdDBbiIhvHIc3fus4HJcpMEkVzohJ5w+T3al8tfycO+Rn3Wj5OTdm4uhZN6TkuSDxRxGSckWjMyFHhJQ8EVLzRYjPcmba4FCuMxKPCxCdxkd0Gg97UrlGsiuJp07Nd0GcQkhLs4RgNjHis4SjpArB6OfYDAFi5HxEp/OZJtifxsPeVCfskTG42JvMxfcJ9kayXcptTMxxRrSc/z7mGJ+Olv/nKJ/en84bte8Ij/7hsBO9l5HCpXfLuHTUIUd6V6ID/X2CA71Tak/vkNpje4zdENkR79As+8kZcQo+HZ/Fh1TB4EGawUPcMR5ijzkhVu6EA0edEJPORXQaF/sOO+KHFEfslTlgT7IDopLsEZVkh+0HJo0QyQbrgshtNjXrv7apCP/KRvV/YVtsVKFbrD/60loVupmjCtnMUa1lbOKogjeyVcGRbNXqCLZKsn7CbUn4hJJ/Ae2xUedv+GbEAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Dreamweaver logo&quot; title=&quot;&quot; src=&quot;/static/8bbad176f0e19e675b2d71218e621f05/6cb0f/dreamweaver.png&quot; srcset=&quot;/static/8bbad176f0e19e675b2d71218e621f05/6cb0f/dreamweaver.png 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;I started using Dreamweaver&apos;s design mode when I began web-development. I didn&apos;t touch HTML. I started using some of the &lt;abbr title=&quot;Dreamweaver&quot;&gt;DW&lt;/abbr&gt; javascript functionality which I thought was quite powerful at the time ( this was literally all done without looking at HTML ), but I was getting frustrated with the tabular layout - It felt like I was fighting it more than working with it. Changing the width of tabular layouts isn&apos;t easy when you have multiple nested tables.&lt;/p&gt;
&lt;p&gt;I started seeing all kinds of unbelievable tutorials and javascript plugins online. Things like dragging elements around as if they were windows in an operating system. I slowly started manipulating other people&apos;s code within the &lt;abbr title=&quot;Dreamweaver&quot;&gt;DW&lt;/abbr&gt; code view and eventually I was permanently using that view. I felt design mode was for newbies and tabular design was old-school and evil. It was at this time that I started following popular online blogs such as &lt;a href=&quot;http://css-tricks.com/&quot;&gt;CSS-Tricks&lt;/a&gt; and &lt;a href=&quot;http://davidwalsh.name/&quot;&gt;David Walsh&lt;/a&gt;, etc.&lt;/p&gt;
&lt;p&gt;Dreamweaver features that stood out for me:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I enjoyed the syntax highlighting colours&lt;/li&gt;
&lt;li&gt;Wrap text in element functionality&lt;/li&gt;
&lt;li&gt;tags closed automatically&lt;/li&gt;
&lt;li&gt;Find/replace throughout open files&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note: It took Dreamweaver 30 seconds to load up so I could take the screenshot. Core2Quad 2.3ghz with 3gb of ram.&lt;/p&gt;
&lt;h2&gt;Notepad++&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAGAABAQEBAQAAAAAAAAAAAAAAAAMCBAX/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAemOdM+ukW8wuF//xAAbEAACAgMBAAAAAAAAAAAAAAACAwABBBESE//aAAgBAQABBQJ2Rdt9GLizpgGHGQzXnjDwkhopSh3P/8QAFhEBAQEAAAAAAAAAAAAAAAAAEBEh/9oACAEDAQE/AbhD/8QAFhEBAQEAAAAAAAAAAAAAAAAAAREg/9oACAECAQE/AWiTH//EABsQAAICAwEAAAAAAAAAAAAAAAABAhEQIUET/9oACAEBAAY/AvOHC9ikukrV7spCTN5//8QAHRABAQACAQUAAAAAAAAAAAAAAREAMUEQIVFhcf/aAAgBAQABPyFJQ0U5cXcB5aZreGIyJh7y4Rrsx9se+Dw3B1L96f/aAAwDAQACAAMAAAAQHzi8/8QAGREBAAIDAAAAAAAAAAAAAAAAAQAREDFB/9oACAEDAQE/EKqOkNRC3WP/xAAZEQACAwEAAAAAAAAAAAAAAAABEQAQMWH/2gAIAQIBAT8QHYA8h2MpV//EABsQAQEAAwEBAQAAAAAAAAAAAAERADFBIRDh/9oACAEBAAE/EE1BaB6e8DWKCpI0SbEcAuUR49MoAIHQW/mU1+lfCteXBgiMvK4cDGnphZtmqofP/9k=&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Windows logo&quot; title=&quot;&quot; src=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg&quot; srcset=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 56px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/89ac662eb9b3cddd2be04696087d2abe/e500d/notepad-plus-plus.png&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 71.42857142857143%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC4ElEQVR42oVSW0hUQRgey1Ck1Dx75sycmXMOK4uYqaSruyqsqavrekHddN0tXZXdbFWUSlEqr22sGdtDQiAV9JBhsAgKYSKUPpjSSwY99CS44IM9dXkrbyfOthKJlw9+Zob/n28+vm8ACEGW5bDQekJZ73u9vpWVj3J1dZWzze1uGhkevgcAiAqNh4GjsEeWWaRvqvE1zuc4855PvJhY397dkhfm538H1gLbCrnJZCpS5qxW68lDyfaa2nxdQ9f7TnnkR/+Od6Nb9oz27ax+DmzPvJ7Zmn/7bmt2ZvYrAEAKXTtxhDp/kLB93Lk0I/vkqc3BzUm5f2dstXv31dwT+dlK79bYly7ZbDb1BgX4j1C3h6SLSZo7b1wB1yPLmmep5efdxZZfPZOOb11z9u9d0/XrdY8tU5FngXisOgUPap11V2wl4/am3EB2ftonY2H6WmV5xktdVtJyniF1udCQstBaqm+73TPQfC4hwXgIzb+QPDZHr8Vc4LfVGRaLyzJ9zvrc6VutRQ8ttdlPWxpzffb6nI1rroIPA31D3kSNxnRswgo0Gk2EzqEb5Sini7+gmUqzaDsAAOqoqDOlAGPlq/AAABIaVzwMDxWIjo6OEzFOD/XCQUeHOULZ6SszbFpjql8t0naDTT+BENsgEXJD6REIsyRJMu/zMKiUZVkkYVq1399gMzXnfHWyNtGbnJOYHXs6NhdzXDvFuJiHsIIg5CYc0VMIUwSMDViF0ynHJVOEzAIhbgghByGMP8jY4CsMw+TxEA2IPD/IqVS1bBzbIPFCJ4bwOg9RC2JZh8jTQUEQmiRCPAImQ5Ig9P7npVarPSVJUmSQMEYhhMMSITcRy1oRy7ZKgtCJWPYSQaiBZ9k2inG7mooukZAaSmkcwzD8QRntKTRiFbwsUupCKlUpZJgKkefLCcTNFOOrBKESwpEyiad2iZCsY/8o/ptuMEkNABGhM+BUXFlMTIz6gICC9QfawNFhE9Hl8QAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Notepad++ logo&quot; title=&quot;&quot; src=&quot;/static/89ac662eb9b3cddd2be04696087d2abe/e500d/notepad-plus-plus.png&quot; srcset=&quot;/static/89ac662eb9b3cddd2be04696087d2abe/e500d/notepad-plus-plus.png 56w&quot; sizes=&quot;(max-width: 56px) 100vw, 56px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;I eventually moved over to &lt;a href=&quot;https://notepad-plus-plus.org/&quot;&gt;Notepad++&lt;/a&gt;. I enjoyed how quick it was - Lightning quick compared to the bulky Dreamweaver. However it didn&apos;t have most of the things I liked about Dreamweaver and it wasn&apos;t nearly as aesthetically pleasing with regards to icon layout, icons, colours in general and the syntax highlighting. I actually found - and still do find - the toolbar of icons ( including print, copy/cut/paste, find, etc) very insulting. Eventually I was using Notepad++ without turning back to Dreamweaver for anything, but still I didn&apos;t feel completely comfortable with it, something was missing.&lt;/p&gt;
&lt;p&gt;Note: I probably didn&apos;t use this editor to it&apos;s full potential.&lt;/p&gt;
&lt;h2&gt;E-TextEditor&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAGAABAQEBAQAAAAAAAAAAAAAAAAMCBAX/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAemOdM+ukW8wuF//xAAbEAACAgMBAAAAAAAAAAAAAAACAwABBBESE//aAAgBAQABBQJ2Rdt9GLizpgGHGQzXnjDwkhopSh3P/8QAFhEBAQEAAAAAAAAAAAAAAAAAEBEh/9oACAEDAQE/AbhD/8QAFhEBAQEAAAAAAAAAAAAAAAAAAREg/9oACAECAQE/AWiTH//EABsQAAICAwEAAAAAAAAAAAAAAAABAhEQIUET/9oACAEBAAY/AvOHC9ikukrV7spCTN5//8QAHRABAQACAQUAAAAAAAAAAAAAAREAMUEQIVFhcf/aAAgBAQABPyFJQ0U5cXcB5aZreGIyJh7y4Rrsx9se+Dw3B1L96f/aAAwDAQACAAMAAAAQHzi8/8QAGREBAAIDAAAAAAAAAAAAAAAAAQAREDFB/9oACAEDAQE/EKqOkNRC3WP/xAAZEQACAwEAAAAAAAAAAAAAAAABEQAQMWH/2gAIAQIBAT8QHYA8h2MpV//EABsQAQEAAwEBAQAAAAAAAAAAAAERADFBIRDh/9oACAEBAAE/EE1BaB6e8DWKCpI0SbEcAuUR49MoAIHQW/mU1+lfCteXBgiMvK4cDGnphZtmqofP/9k=&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Windows logo&quot; title=&quot;&quot; src=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg&quot; srcset=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/6027352f9425616a8c9a3f49bc1d3b5f/92935/e-texteditor.jpg&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAIEA//EABcBAQEBAQAAAAAAAAAAAAAAAAECAwT/2gAMAwEAAhADEAAAAc2hly6eaUXVC8wP/8QAGhAAAgMBAQAAAAAAAAAAAAAAAQIAAxITNP/aAAgBAQABBQKivpY/N4wyw8rOS0BKlm2Z/8QAGBEAAgMAAAAAAAAAAAAAAAAAABEBEEH/2gAIAQMBAT8BTkRtf//EABYRAQEBAAAAAAAAAAAAAAAAABAxQf/aAAgBAgEBPwGGH//EAB8QAAIBBAIDAAAAAAAAAAAAAAERAAIDECEiQTEycf/aAAgBAQAGPwLfqNmM2zbp6qETB+ThtnnCfD6wwVGVj//EAB0QAAIDAAIDAAAAAAAAAAAAAAERACExEFFBYXH/2gAIAQEAAT8hoKWPqFchmo/RHlD5xKpZk1QOCgJMXUUGCi7EOgAq0E+P/9oADAMBAAIAAwAAABAAKD3/xAAYEQEAAwEAAAAAAAAAAAAAAAABABARQf/aAAgBAwEBPxDTJyCiGGv/xAAYEQADAQEAAAAAAAAAAAAAAAAAAREQMf/aAAgBAgEBPxCpCi6z/8QAHxABAAICAgIDAAAAAAAAAAAAAREhAGEQMUFRcdHx/9oACAEBAAE/EDJoOgPvI1KxPAV+F4ZJOjysExswHUePje8W9cShoho4FUPSQ4VaRK49u+P/2Q==&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;E-TextEditor logo&quot; title=&quot;&quot; src=&quot;/static/6027352f9425616a8c9a3f49bc1d3b5f/92935/e-texteditor.jpg&quot; srcset=&quot;/static/6027352f9425616a8c9a3f49bc1d3b5f/92935/e-texteditor.jpg 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;I began noticing how many people were talking about TextMate but I could not use it since it was/is a Mac specific application. After some googling I noticed there was a &apos;Windows&apos; version of TextMate called &apos;&lt;a href=&quot;https://github.com/etexteditor/e&quot;&gt;E-TextEditor&lt;/a&gt;&apos;.&lt;/p&gt;
&lt;p&gt;I found the syntax highlighting very pleasing and it had almost everything I could want, including FTP built into the app - This felt much more simple to get going than the Dreamweaver FTP functionality. One thing it didn&apos;t have was &apos;Find/replace throughout open files&apos;. This was something I had missed since Dreamweaver.&lt;/p&gt;
&lt;p&gt;Without a doubt, this became my text-editor of choice.&lt;/p&gt;
&lt;h2&gt;GEdit&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/2b0f2616a4e90a73caf375da09d0f105/92935/linux-tux.jpg&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAGAABAAMBAAAAAAAAAAAAAAAAAAMEBQH/xAAWAQEBAQAAAAAAAAAAAAAAAAACAAH/2gAMAwEAAhADEAAAAd7LuVzaThUcQdshZ//EABwQAAICAgMAAAAAAAAAAAAAAAECAAMEExEiMf/aAAgBAQABBQI+Y72bZeeuWCUjLzNKBp//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAEDAQE/AR//xAAWEQADAAAAAAAAAAAAAAAAAAABEBH/2gAIAQIBAT8BoUC//8QAHRAAAgEFAQEAAAAAAAAAAAAAARECABASQXEDMv/aAAgBAQAGPwKsfSTyDFlrfKhKH2Cxdhvtv//EAB0QAAIBBAMAAAAAAAAAAAAAAAABERAhMUFRccH/2gAIAQEAAT8haGfArY7rGKWOxr2EAyjCLAl5lroWoiNjB//aAAwDAQACAAMAAAAQ5AgA/8QAFxEBAQEBAAAAAAAAAAAAAAAAARARUf/aAAgBAwEBPxDHkFn/xAAYEQADAQEAAAAAAAAAAAAAAAABEDERIf/aAAgBAgEBPxA7WVHY8q//xAAfEAEBAAIBBAMAAAAAAAAAAAABEQAhMRBBUWFxgaH/2gAIAQEAAT8QY6ULvBo9SpQmienj102FiU2h3E8yfFxfSYfbv9RLiodb8YWSjVUzWiqK6OZu/mAADgz/2Q==&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Linux Tux logo&quot; title=&quot;&quot; src=&quot;/static/2b0f2616a4e90a73caf375da09d0f105/92935/linux-tux.jpg&quot; srcset=&quot;/static/2b0f2616a4e90a73caf375da09d0f105/92935/linux-tux.jpg 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 100px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/471425be3d200eb6d1b7c65f45b442ee/7e516/gedit.png&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 50%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAAsTAAALEwEAmpwYAAACzklEQVR42pVR3UtTYRh/0yxwbudsZ+g+3I5uKkIi6jhn533Pzs7ZPNNpkEVtqSmilkroMkvmLD1akWLT/MIbg1CSxAIDvbCbLjLQm+pChSS7qIi86LKISjjxTvoDeuDH8+P5+D3PwwOeRa88fz07ra5PxX+9mhr9vTEz/nNzelSdbwhfAACAZZEmu236tlaLdrLRrL3dlKHpaDem1HRadOFYtiYDHFqSoihJCTbu53YXz1eqc2cCB4vnytXHZ8v/LAQ4Vcm3tih0Wn6bhVitSk9rpSigxfWFgYCmwO8PlJ1w2npsRGdPNsXgeAiA5IRor1W7E88i1WGaPOgwad6GiWPzilnzbYAmVhvSNTMIAEuiIQSSsa+rC2gQ5PaLKqvQmCml/mJ6mpLIl3GGxIY3aP3ORK5R7bCSD2N2w1qXnRyL0YaVRqNmOC+voBB6pYiEUBWuhRAWI4QUhmH2ZUkSXR7JzZSWQ7fb3cNx3I7P5/ODPlr/sc+ufzNIG5aGsg3vA/rUilgmudRvp+qLIP9U9HgeIYR2fT4f4jhuXZblGpZl94LBYDEP4aAkSb0sy3YjhDarq6stoI8mP93KMrxsNuvmao2Ea8hBRaecBjWSa50u5j1blbJc7/V6K3ieb+I4bhtvyjDMFhYsKSl5gBC6zzDMNZ7nZw9PtpPv7jkotdakre+xkadGnZQ67qTU7iwqWgTRhoBQ3Ov1hkVRPM2y7BdRFC9BCD/7/f5qjuOeCIKw4PF4IhDCvdLS0iC4Ses/9NrJF5FM4m4/bVgbcVBq3EmpfTZdW2qowcRDOCkIQgMezvN8QBCEmCiKjZIkncSDMGRZJiCEd3AMDGSR21EbMdFp1Y2MOqn9uINSZ3KNaj9NXMUiigiOgv+xdqtupdmsm2+xaJev24gfXVbia1cm8f2ymUx8NpiTc1wURSx6JBQKJWOOgfk/4JzL5UrB/C8vNtoartI3rwAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;GEdit logo&quot; title=&quot;&quot; src=&quot;/static/471425be3d200eb6d1b7c65f45b442ee/7e516/gedit.png&quot; srcset=&quot;/static/471425be3d200eb6d1b7c65f45b442ee/7e516/gedit.png 100w&quot; sizes=&quot;(max-width: 100px) 100vw, 100px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;I was getting fed up with Windows for various reasons and I couldn&apos;t afford a Mac, so Linux ( Ubuntu ) was my next logical step. &lt;a href=&quot;https://wiki.gnome.org/Apps/Gedit&quot;&gt;GEdit&lt;/a&gt; was/is the default text editor for Ubuntu and I was surprised that the default text editor that was so &apos;advaced&apos; compared to other default OS text editors. This mainly included pleasing syntax highlighting and tabbed functionality. GEdit didn&apos;t have the &apos;Find/replace throughout open files&apos; functionality and something about it didn&apos;t feel great when using it for larger projects. As far as features went, it didn&apos;t have too many that I was aware of. For small HTML/CSS/JS projects or tests it was perfect though.&lt;/p&gt;
&lt;h2&gt;Scite&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/2b0f2616a4e90a73caf375da09d0f105/92935/linux-tux.jpg&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAGAABAAMBAAAAAAAAAAAAAAAAAAMEBQH/xAAWAQEBAQAAAAAAAAAAAAAAAAACAAH/2gAMAwEAAhADEAAAAd7LuVzaThUcQdshZ//EABwQAAICAgMAAAAAAAAAAAAAAAECAAMEExEiMf/aAAgBAQABBQI+Y72bZeeuWCUjLzNKBp//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAEDAQE/AR//xAAWEQADAAAAAAAAAAAAAAAAAAABEBH/2gAIAQIBAT8BoUC//8QAHRAAAgEFAQEAAAAAAAAAAAAAARECABASQXEDMv/aAAgBAQAGPwKsfSTyDFlrfKhKH2Cxdhvtv//EAB0QAAIBBAMAAAAAAAAAAAAAAAABERAhMUFRccH/2gAIAQEAAT8haGfArY7rGKWOxr2EAyjCLAl5lroWoiNjB//aAAwDAQACAAMAAAAQ5AgA/8QAFxEBAQEBAAAAAAAAAAAAAAAAARARUf/aAAgBAwEBPxDHkFn/xAAYEQADAQEAAAAAAAAAAAAAAAABEDERIf/aAAgBAgEBPxA7WVHY8q//xAAfEAEBAAIBBAMAAAAAAAAAAAABEQAhMRBBUWFxgaH/2gAIAQEAAT8QY6ULvBo9SpQmienj102FiU2h3E8yfFxfSYfbv9RLiodb8YWSjVUzWiqK6OZu/mAADgz/2Q==&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Linux Tux logo&quot; title=&quot;&quot; src=&quot;/static/2b0f2616a4e90a73caf375da09d0f105/92935/linux-tux.jpg&quot; srcset=&quot;/static/2b0f2616a4e90a73caf375da09d0f105/92935/linux-tux.jpg 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/b3918ac3308ae50f9d80bf5c6930bb84/6cb0f/scite.png&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFOElEQVR42m2V60/TdxTGq4kv9YWaZat3BkLBCoWytrQFWmkLbWmhpRdoC71AqYW2tNyxLeNSr8yobQlCBWQaUWEq0QnugmQuMxLci00SkkHi3LK/oMle9Pd7FkCdbp5X33OS55Pvk5w8h0L5t7ZQKN1b1x/bqWm7WEKNOV9aPSVU1K4KFPa4sMwZL1A0rHIktVOZfJ2Zmpa267Vu66b2f4X14ZZMttggLreuaC3NsDZ2kzZXANWOThgcAVRY/Sg1BcnCMi+YAvNKenax4TXsPeCbZhvtSG5EU+OG3d0Ft9dPdnSdJJwePxnovQBzfQdsnj5SZ+8j1qFy82lw5V6kZhVF1rVvWcDGzyjZeZKw3uZFS0d/wlrrJi+GYzDbfBgdn4a83IboyCT0lmZYms7C2DgAaVWQFFWFEoXqAFIzOOFNk5ssCiNPZCwzuNDUEiQ6/afJ+obPcf7SGBrcfrS09yM6OI6iYj2iEw9Q5QhBWd2Dat8oKhyDpFh/kuAUu5BMyzO+sbxTXuletrm6EOw5Rzg8fbh85RYkchOeP38BBlOI2JXrGIpNgi+sQv/QLByBCRSV+aB1DkHtHCPU9THQskTL6ywKS6g0Gxx+VNqaiaHYbUiUx7HwwxJKFGacOhvF/MIikpLZiMSmEJt+Ar7IAlNjBM6T36C89iIESh9UDTcItrwNqZl8M6WiumG6ztcDqzuUOB+9Cbs7hKa2AXw3/xOoSfm4cXsO9x4+QcqREjg7hjB4bxUyfQDHZE5o3eOoDT2FQB1M8EpbwJM1TVM0Fuea3u5Fz8AoqbH2Ye77JaQzVXg0v4iRqzNIossx/tUsJudXwBVZIdM0Izj6K+p6Z3FM6YVU3w+xZZj0RZ9CVeNZo2jMjrjdcwIDgxPQ2PsxcXNuwx4934hnL17h1OXb2JMqhLd/DKPzf8HkC4Mv0kPfNIz2q3/A1HkZuvo+SA0+1LaH4hSlwRU/cSqKtlAU0w8XkCOoxdIvq6jznUcGtw73f36JC9e+RjZTAp0tgC/uryE88wzaGifyxEYEhh9hdvVv2PzXkc4oiVME0rq1htZzMLpOk5euPICvOwah0o0Xv/0JfV0IdHYV7j5exJ0fl6E1uaHWmnB6eBIj376E99wCCqROFEi1ZJHahQJ50xqlsMQxLdX4Ue8JJ3iKIG7cWYJE0wtxRStmHr+C2RkBgyVH15kJXLr1Oxo7v0SxzABrQxBGzxgMbXMwtN5PsIsc+GTvoWlKZp7SXFTaCEmJkbA6L0Ag8yEyvAihzAeu0IqBwSfwtI+gVGFApdEDR/tNOE7MQFd3FgViI4orWtZ3ksiXNyOdpTJTduzYsZNToF7mF6qhVHmImua7KCxtQaDnHsr13eAITTjuG4KrdRgavRPl6hroLcENF/zSLtA5JiKHp0canbu52Ot1mMYw8oR6cHhlhK1lgmzsuQa+vAO2xqswmHshUjih0LVDZQygoroXRfJ6FBZbkZcvJzOZEiIjV4XDmSLje2lDy+CE+YJKfMYpT8i0TlJlO4NcURvEZW0o03WgpNwDoew4ZJoOSNXtyGIpSSZPl2ByVdi9e3f4Xdbb+Eqh5UYYLBky6HzkcDWkUOYiWPkGksmrQoHYAq5AT7LzNUQOu4SkZwuQTGPj4z2pkRy7fdt/ovBts2X/oXRDKp27kskUI4tZTOaw5GAwJchgCJB+lAd6tpBMy8jDgWTGykd7D30wYN8FbpwAKpW6i7ovybzvQMrUwaSMVdrRwvinh3Pj+w/SVpNSsqeo1APm7dspHzwB/wC1ks+yMuw6HgAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Scite logo&quot; title=&quot;&quot; src=&quot;/static/b3918ac3308ae50f9d80bf5c6930bb84/6cb0f/scite.png&quot; srcset=&quot;/static/b3918ac3308ae50f9d80bf5c6930bb84/6cb0f/scite.png 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;By default &lt;a href=&quot;https://www.scintilla.org/SciTE.html&quot;&gt;Scite&lt;/a&gt; has ( or my default installation at the time ) the line numbers disabled. This is/was highly annoying and on top of that, it wouldn&apos;t &apos;remember&apos; my option to keep line numbers enabled. Small things like this can really get to me - I want to feel completely at ease, comfortable and happy with my tools.&lt;/p&gt;
&lt;p&gt;I didn&apos;t really like the icons and the general look and feel of the editor, however, it was definitely much more advanced and nicer to use than GEdit - with options like “Convert selection to lowercase” to regular expression searches. By this time I had decided Scite was the Linux text editor for me, however as much as I liked it I preferred E-TextEditor, but I had completely moved away from Windows - apart from my virtual machine with PhotoshopCS3 and IETester. It&apos;s difficult using a text editor when I would have switched it for E-TextEditor or TextMate in a heartbeat.&lt;/p&gt;
&lt;h2&gt;Coda&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAADn0lEQVR42p1UT2gjdRTObsWLKHioVQQXD24PLtiDl+rFi15aEL0a9rB2K83iQQqLYnEOa2FVXAJRsrtQEFaq1EhaKO5uu92kSZpkkqYz+Z90MslMZppkkrRJmjbpn5n5ZEIHGlOk+i6/Nz/e73vf+968ZzCc0wBc0E6C+HZoenr63dN3/9ueLC19XW/swOVyWk8A+/7Ley37Bf3R4uLC5wCwU6vg1i3iA+1ubm6u71ylnSqlcw4NDfXn81y+0SjjwYOZ26fiLuox/6qTFmQymS5NTk5eMRgMfaOjo6/du2eev379k2sDAwMvTU1NvTU+Pv7K6aQ9RhCEls1gNpvfoChqvlbb2W02m4csy0YfP354c2bml6uxRGKmXClL1e3KMcOkqnb7H98PDg4+3wOsgxHEl5cFIc9pWilQFEVV0PFVBbIid/zG7g5EMYfCVk5WcYCFBdsPPQ3SSw3TtF171NxrHrUPWmgftNFuH6j7+02lUpUUUcjJPJ9BNpdWxK0sSNK9aTKZ3uySS2c3NjZ2uVyRWq12SwNUW+19HB0do96oQZJESNIWtgo8OC4NhompqRQNs/m70Z5u6x937/78cWO3gXqjru7tNXF4eAipJKJYymO7VkGxKIDjNpFOR1Q2E8N60FOamJh4sUc/h8PxzAnwVQ2wVt9RtHI5joEgZFFrVFGSRPACiwwTRyy6riaTFGg6IBIE8ULPxOgMzeYfP6pUy2ju76kZJgmGiaNWr6JYEjrAbDaBRIICTfnUIOlEJByU71gsb/eUrGt4zWi8UiwVjwSRA0k61eq2hEKBhyCwYLNJaKzCNIlQwAWve0mOR0h4PKt//mOyupy+ELUeCJBOsGxS0X4NjmfAsgmkkjQi4QBCQTdI71N43cvwOB+psTCJleWHvxkMhue6sHTK30zd/CoS9oPPZ+QMG0cmE0cqFUY0GgC1sYb1wGoH0Odehtv5SPV5luD1rNRHRkZe7dJSd/r7+1+mKD+fz29qrBQNLB4LIUKT2AitIRR0IeB3wLf2BI7lRTlGeTFvn7OcYFzsGj2d5f371k+FPINkgpKjkaAcjQaVZGID6ZRWtl8N+J2Ky/nXccC7AtK/KhqNxtdP9+LM5WC3234qFnKQSrwiihlsbPiOvWtPazTtl3kuBYFPIx4NHVmt1g/PZHdGp56dnf31C6djZdFm+/220Wh8Z3h4+NKNG5+9Z1+w3fF43LMWi/X9c2/t8672s+L+BnV/5SLYLOfbAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Apple logo&quot; title=&quot;&quot; src=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png&quot; srcset=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/6ebc1a4c5c928fba2302847e29f6b1ff/6cb0f/coda.png&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEsElEQVR42oWUa0zTVxjGCywzmx+2KRBu0lEQEFosGnSgRaEVSqEUobWUUhyXKZeBOsQBwzSb87YZFXEogSooA+y9hVqwhXLHe0XAedmcZs7IF7MtRhdp/89SBkbGjG9yck7evOf3Xk7OQyK9xaSQOgvkApc5TpCcHD6pVOrsWA6X7lpJ2NlBof7NoJnAVwzACcC7AN6ZG0iajtutWFN/QM+onQcCSE7SmaDh4eH36scKuAeuptUeGRV1HxuVjFZbxVf3XhToqnp4+/dZ8pMcCaSalC0lTVEXAbjMg82eT0xs3XR8NGvs2EQ66u5vJo7c2oS9Vh52X0nA7msJKL/CxM7BGOLTtlWPRNX0R0dV+dR5s3LssusVbt9e5p87/BMf342nElUj8UTlUKytcijeXmqJIYpNDKLIvNZW3BtlEyupdkEzFd/0Zt3DDSx8bV7/tlg+wKSUD8VPVFhZ2GaJtmUbVhBFpmiU9fIgUi+DSBUKiZaOzTo6Us4GQCKPQMXFRPve26nY150vmVNZ49ge/2IL427JYDSy2yOmMjXhECvoyNPE4HNdKvjNIRC20JAkCwCvIQiFF9Zjz4QAO64ypsrvrkV5H/fw6y+4oNgcO5xrXglhK83Gb6WB1xQEzikKODI/sBvIYJ30Br8xHFs1CdhiikLVTQ6+usxFUe86W+F4IL7uzzC8An5xgVspbg+DoDnMxq7zA69hOTY2hCOulozYal9EH/JESgMVO7q4KBtMRK5lBYqHPkHJSCSyepbZRSMeqOnf9QDAQlLHr6c90lvDH3NkFDBrfYjYYz5YX+0F5g9eiD3uDW5DIAqNLJT2cbB9KAabzTTkdq/EloFw5AxQIekPtGf0+UHRd+oXAO+TCtvjCpLO+INTt9S24cQSrDnkhrUHPZDaSEWBcR3yjJEo6InG1u5IZJvp2N7LnoaKLQHI6aNDMOBjK7UkwHrppmK63cy21WpG7WLE1HjbNpxcgo2nqZCoViHXGIW8rtUQaWkQd4RB3BkC4flAFHVxIDHRkNZFRvoABRzjInurSYanD//mTgMFP9IeRNZ8CGbNx0SOkgm+PBhCLRUCbTD42kAINMFIN4SAf94fG/UUcNVkCE1BSLNQEN/5wdRRQxVuX/+5eeY5nEjcFsoLRt1ixNeRkaoKREKLD5LlFCSr/cBVkpGi9QdX54tUw1Kk6P0h7A5FYo8nwdK4Th3SVeDGyPgV4M/Fs/+dxFNQnrNOeUGgCkWyyg/sNh8kqwKQqKQgQUVGYrsvkgy+YBu8CFanq42ld7VnnVtDtBhluHnplunZs0mPOWKSoVv+kK3wBk8VRCSqKGDrvBGn8SRiVW629cpFBFPuDs45Cja1RGCnIpOQ6WtgMfVN3r/9+y4CxIJXlc1afhfDGN/hBabS0x7duohIa1yBMnkWvtdXoka9D/XK41NybdtTU2fPhHVwQv7bnSefAXCfATnPgTmsrIf7Jcfsg6gzH72UNm2DqdP8wjoy1nvP+mD/kzt/iF4+RgQAb8dv+o8+Ov+vkJrHtSFx7e7Pd6ozMDZ8d2Dy2SR9Xta5IuvyNpUnHR0qbTIMqu/hL7jNDlgul7s4Lr8J/ib7By29wWF79SePAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Coda logo&quot; title=&quot;&quot; src=&quot;/static/6ebc1a4c5c928fba2302847e29f6b1ff/6cb0f/coda.png&quot; srcset=&quot;/static/6ebc1a4c5c928fba2302847e29f6b1ff/6cb0f/coda.png 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;I began using a Mac at work and it had Coda pre-installed. I had heard almost as much about Coda as I had about TextMate, mainly from Chris Coyier and a co-worker/friend. I enjoyed Coda - It had extremely simple and intuitive FTP support and was very nice to use. Coda had random nuggets I hadn&apos;t seen in editors, like a wildcard character within searches. This could be achieved with regular expressions in other text editors, but the simple option was nice. The lack of functionality I was used to got to me. Coda was nice for larger PHP projects or smaller HTML projects.&lt;/p&gt;
&lt;h2&gt;TextMate&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAADn0lEQVR42p1UT2gjdRTObsWLKHioVQQXD24PLtiDl+rFi15aEL0a9rB2K83iQQqLYnEOa2FVXAJRsrtQEFaq1EhaKO5uu92kSZpkkqYz+Z90MslMZppkkrRJmjbpn5n5ZEIHGlOk+i6/Nz/e73vf+968ZzCc0wBc0E6C+HZoenr63dN3/9ueLC19XW/swOVyWk8A+/7Ley37Bf3R4uLC5wCwU6vg1i3iA+1ubm6u71ylnSqlcw4NDfXn81y+0SjjwYOZ26fiLuox/6qTFmQymS5NTk5eMRgMfaOjo6/du2eev379k2sDAwMvTU1NvTU+Pv7K6aQ9RhCEls1gNpvfoChqvlbb2W02m4csy0YfP354c2bml6uxRGKmXClL1e3KMcOkqnb7H98PDg4+3wOsgxHEl5cFIc9pWilQFEVV0PFVBbIid/zG7g5EMYfCVk5WcYCFBdsPPQ3SSw3TtF171NxrHrUPWmgftNFuH6j7+02lUpUUUcjJPJ9BNpdWxK0sSNK9aTKZ3uySS2c3NjZ2uVyRWq12SwNUW+19HB0do96oQZJESNIWtgo8OC4NhompqRQNs/m70Z5u6x937/78cWO3gXqjru7tNXF4eAipJKJYymO7VkGxKIDjNpFOR1Q2E8N60FOamJh4sUc/h8PxzAnwVQ2wVt9RtHI5joEgZFFrVFGSRPACiwwTRyy6riaTFGg6IBIE8ULPxOgMzeYfP6pUy2ju76kZJgmGiaNWr6JYEjrAbDaBRIICTfnUIOlEJByU71gsb/eUrGt4zWi8UiwVjwSRA0k61eq2hEKBhyCwYLNJaKzCNIlQwAWve0mOR0h4PKt//mOyupy+ELUeCJBOsGxS0X4NjmfAsgmkkjQi4QBCQTdI71N43cvwOB+psTCJleWHvxkMhue6sHTK30zd/CoS9oPPZ+QMG0cmE0cqFUY0GgC1sYb1wGoH0Odehtv5SPV5luD1rNRHRkZe7dJSd/r7+1+mKD+fz29qrBQNLB4LIUKT2AitIRR0IeB3wLf2BI7lRTlGeTFvn7OcYFzsGj2d5f371k+FPINkgpKjkaAcjQaVZGID6ZRWtl8N+J2Ky/nXccC7AtK/KhqNxtdP9+LM5WC3234qFnKQSrwiihlsbPiOvWtPazTtl3kuBYFPIx4NHVmt1g/PZHdGp56dnf31C6djZdFm+/220Wh8Z3h4+NKNG5+9Z1+w3fF43LMWi/X9c2/t8672s+L+BnV/5SLYLOfbAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Apple logo&quot; title=&quot;&quot; src=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png&quot; srcset=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/001ae77f7a43e0fc67fd63dee6ce54a9/92935/textmate.jpg&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAGQABAAMBAQAAAAAAAAAAAAAAAAIDBAEG/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAID/9oADAMBAAIQAxAAAAHZmtyXp6BBGcOheD//xAAcEAADAAEFAAAAAAAAAAAAAAABAgMABBAREiL/2gAIAQEAAQUCregstqiyt2Gr80AQCZ5nVFfFki7f/8QAFhEBAQEAAAAAAAAAAAAAAAAAASAh/9oACAEDAQE/AQyP/8QAFBEBAAAAAAAAAAAAAAAAAAAAIP/aAAgBAgEBPwEf/8QAHxAAAgICAQUAAAAAAAAAAAAAAAECERIhEBNBUVJx/9oACAEBAAY/AunCK+kc5LG+xYn7KjzW2JiyNLj/xAAbEAADAQADAQAAAAAAAAAAAAAAAREhMUFR8f/aAAgBAQABPyHz1arGS80NcEYBOCRc1ncU+A66qIpLNOIUJQ//2gAMAwEAAgADAAAAEADHwP/EABkRAAMAAwAAAAAAAAAAAAAAAAABERAhMf/aAAgBAwEBPxBG0OFcmP/EABcRAAMBAAAAAAAAAAAAAAAAAAEQETH/2gAIAQIBAT8QEmKr/8QAHhABAAICAwADAAAAAAAAAAAAAQARITFBYXGRocH/2gAIAQEAAT8QU2ulYDyhoMxdbq2jVqe3AoZavF9xFCEQaMN5+YU2yC1bivC/sCrUajw8xipNGU6iA4zQfcAUFE//2Q==&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;TextMate logo&quot; title=&quot;&quot; src=&quot;/static/001ae77f7a43e0fc67fd63dee6ce54a9/92935/textmate.jpg&quot; srcset=&quot;/static/001ae77f7a43e0fc67fd63dee6ce54a9/92935/textmate.jpg 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;I was really eager to try out &lt;a href=&quot;https://macromates.com/&quot;&gt;TextMate&lt;/a&gt;. I had heard so much about it and E-TextEditor was based on it.&lt;/p&gt;
&lt;p&gt;TextMate was very different from other editors - especially since I was new to OSx. It was pretty much just a window of text. All the options could be accessed via keyboard-shortcuts or by the options panel. It took me a couple of minutes to get used to it but I really loved it.&lt;/p&gt;
&lt;h2&gt;Komodo Edit&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAGAABAQEBAQAAAAAAAAAAAAAAAAMCBAX/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAemOdM+ukW8wuF//xAAbEAACAgMBAAAAAAAAAAAAAAACAwABBBESE//aAAgBAQABBQJ2Rdt9GLizpgGHGQzXnjDwkhopSh3P/8QAFhEBAQEAAAAAAAAAAAAAAAAAEBEh/9oACAEDAQE/AbhD/8QAFhEBAQEAAAAAAAAAAAAAAAAAAREg/9oACAECAQE/AWiTH//EABsQAAICAwEAAAAAAAAAAAAAAAABAhEQIUET/9oACAEBAAY/AvOHC9ikukrV7spCTN5//8QAHRABAQACAQUAAAAAAAAAAAAAAREAMUEQIVFhcf/aAAgBAQABPyFJQ0U5cXcB5aZreGIyJh7y4Rrsx9se+Dw3B1L96f/aAAwDAQACAAMAAAAQHzi8/8QAGREBAAIDAAAAAAAAAAAAAAAAAQAREDFB/9oACAEDAQE/EKqOkNRC3WP/xAAZEQACAwEAAAAAAAAAAAAAAAABEQAQMWH/2gAIAQIBAT8QHYA8h2MpV//EABsQAQEAAwEBAQAAAAAAAAAAAAERADFBIRDh/9oACAEBAAE/EE1BaB6e8DWKCpI0SbEcAuUR49MoAIHQW/mU1+lfCteXBgiMvK4cDGnphZtmqofP/9k=&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Windows logo&quot; title=&quot;&quot; src=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg&quot; srcset=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/2b0f2616a4e90a73caf375da09d0f105/92935/linux-tux.jpg&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAGAABAAMBAAAAAAAAAAAAAAAAAAMEBQH/xAAWAQEBAQAAAAAAAAAAAAAAAAACAAH/2gAMAwEAAhADEAAAAd7LuVzaThUcQdshZ//EABwQAAICAgMAAAAAAAAAAAAAAAECAAMEExEiMf/aAAgBAQABBQI+Y72bZeeuWCUjLzNKBp//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAEDAQE/AR//xAAWEQADAAAAAAAAAAAAAAAAAAABEBH/2gAIAQIBAT8BoUC//8QAHRAAAgEFAQEAAAAAAAAAAAAAARECABASQXEDMv/aAAgBAQAGPwKsfSTyDFlrfKhKH2Cxdhvtv//EAB0QAAIBBAMAAAAAAAAAAAAAAAABERAhMUFRccH/2gAIAQEAAT8haGfArY7rGKWOxr2EAyjCLAl5lroWoiNjB//aAAwDAQACAAMAAAAQ5AgA/8QAFxEBAQEBAAAAAAAAAAAAAAAAARARUf/aAAgBAwEBPxDHkFn/xAAYEQADAQEAAAAAAAAAAAAAAAABEDERIf/aAAgBAgEBPxA7WVHY8q//xAAfEAEBAAIBBAMAAAAAAAAAAAABEQAhMRBBUWFxgaH/2gAIAQEAAT8QY6ULvBo9SpQmienj102FiU2h3E8yfFxfSYfbv9RLiodb8YWSjVUzWiqK6OZu/mAADgz/2Q==&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Linux Tux logo&quot; title=&quot;&quot; src=&quot;/static/2b0f2616a4e90a73caf375da09d0f105/92935/linux-tux.jpg&quot; srcset=&quot;/static/2b0f2616a4e90a73caf375da09d0f105/92935/linux-tux.jpg 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAADn0lEQVR42p1UT2gjdRTObsWLKHioVQQXD24PLtiDl+rFi15aEL0a9rB2K83iQQqLYnEOa2FVXAJRsrtQEFaq1EhaKO5uu92kSZpkkqYz+Z90MslMZppkkrRJmjbpn5n5ZEIHGlOk+i6/Nz/e73vf+968ZzCc0wBc0E6C+HZoenr63dN3/9ueLC19XW/swOVyWk8A+/7Ley37Bf3R4uLC5wCwU6vg1i3iA+1ubm6u71ylnSqlcw4NDfXn81y+0SjjwYOZ26fiLuox/6qTFmQymS5NTk5eMRgMfaOjo6/du2eev379k2sDAwMvTU1NvTU+Pv7K6aQ9RhCEls1gNpvfoChqvlbb2W02m4csy0YfP354c2bml6uxRGKmXClL1e3KMcOkqnb7H98PDg4+3wOsgxHEl5cFIc9pWilQFEVV0PFVBbIid/zG7g5EMYfCVk5WcYCFBdsPPQ3SSw3TtF171NxrHrUPWmgftNFuH6j7+02lUpUUUcjJPJ9BNpdWxK0sSNK9aTKZ3uySS2c3NjZ2uVyRWq12SwNUW+19HB0do96oQZJESNIWtgo8OC4NhompqRQNs/m70Z5u6x937/78cWO3gXqjru7tNXF4eAipJKJYymO7VkGxKIDjNpFOR1Q2E8N60FOamJh4sUc/h8PxzAnwVQ2wVt9RtHI5joEgZFFrVFGSRPACiwwTRyy6riaTFGg6IBIE8ULPxOgMzeYfP6pUy2ju76kZJgmGiaNWr6JYEjrAbDaBRIICTfnUIOlEJByU71gsb/eUrGt4zWi8UiwVjwSRA0k61eq2hEKBhyCwYLNJaKzCNIlQwAWve0mOR0h4PKt//mOyupy+ELUeCJBOsGxS0X4NjmfAsgmkkjQi4QBCQTdI71N43cvwOB+psTCJleWHvxkMhue6sHTK30zd/CoS9oPPZ+QMG0cmE0cqFUY0GgC1sYb1wGoH0Odehtv5SPV5luD1rNRHRkZe7dJSd/r7+1+mKD+fz29qrBQNLB4LIUKT2AitIRR0IeB3wLf2BI7lRTlGeTFvn7OcYFzsGj2d5f371k+FPINkgpKjkaAcjQaVZGID6ZRWtl8N+J2Ky/nXccC7AtK/KhqNxtdP9+LM5WC3234qFnKQSrwiihlsbPiOvWtPazTtl3kuBYFPIx4NHVmt1g/PZHdGp56dnf31C6djZdFm+/220Wh8Z3h4+NKNG5+9Z1+w3fF43LMWi/X9c2/t8672s+L+BnV/5SLYLOfbAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Apple logo&quot; title=&quot;&quot; src=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png&quot; srcset=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/d765d00825c185ab596b42da744359b4/6cb0f/komodo-edit.png&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFYklEQVR42m2UCUzTZxjGP6hQylEKlLsFxBYQGOMoh+WQo4WCUAVEyqkcokg5PECsIFoyrsAEPMac4slQPCbgPFARvKZmmYJOIeqcYFx06nRxyzb+/T8LzBk1PsmX98335f3lfZIvDyHvqqpKe7KIxXIj4ibKYAdHHo5eXv5TUVPr68KNm19LlxXfNwqSdhE3f4WHVGrw7szHNPVgGihJIN7iUe/sfHScHaR/efkS/1AUJjQaPHn1O3acPEM7Jy8E8RbfMgmRxbyZ1foQNnXhPE+hZs6Ohk/hanx+6Jhm+9FTVPO+I/Tmzm5sPdCLXT199OCN29SeC1c1TllKEN8QsMXhqncXersyLzq+0jm7APwCFRWQV6oJWViMOQVrkbWuCcUNbcivbsGC5RuQWdEAZUs70tuP0EZZKynLhDTMiE1a9Z59ptesCK48GYLiStpqTgZt6hcDz/l5kOaVIXGFGvOXb0Dl9k40dvchvaoJS7d1IqS8DjYl1TRPWQFBWu7fNmEx4rd+GYERA+ZLVsIiLpNie8wGN0gOR1kqPOcvhjijCOI0JVIrG1HZeRSKhjZk7zyEiLYuCCs2wq6sjhIWqsBPSDsxBeP4Bocw5Aropylh7BFCc3wjwfGTwTxIDtvQRHilLoNXSj5iVXVQXx6CYsseSOvbENS6F347e2Bb3khPVzWAn5pLscUSEWEFSaoZS0rBjEyaMJrpD2ORBByRFCZ+MnBEUbCPSUNcVSO4ATEouzwM9dgzSLfsg7itC95nh2FRWgueejNlp1wDM2lcGWFHJ3Rrr1KDGSij9J18YOQ1G8Y+4TAWScH2kcDUX4bSM1dgGRoP38IKrBh9jNw74/Cs3wbLEjU4uatg3fI1ZVNeA25MYgcxTsm5pN26G8xwuUbPwRUG7rNg6BEEY58wsNwCIYxfhJqHv6LxzgMotu9H7u1xKH64j6ibY7Asr4XBpgMwXN9KmaoaYBabdJKwU7LP6XT0wmBpqUbHwg56M33AchHBwD1gCm4ujgJXLINk5TocfP4aZTd/RvrVEUgGhuF16zGszg6Bk1NMWdRthblc0UMM5ia3M5u+gvnh/gmWpxg6dk5gCj3AFHqC5eINPRcfaNu7wsIvDLtu30ftyBhKrt9D8sWb8L00Cou2LvDziib4Ow7CMDa5lRhFzsvWr2mG9clrGrPMAjCs7KErcIfuDDcwhZ+AWDsismQ1bAJCMWdNNdaPPkLWdz8iYXAIoSNPwUnOBSu/TGNU0QC2ODKZEMKy4aobnvp9cwLTrB3paXZO0LYVYJqDM3QdXUF4AvADw5HR2IqWa0P48tmfyB9+gKThcQjW1kHXw5822dcNVm7RmI2RjdnUXzTJyKtx6D4FY0XWBNPRDdzgSBi4eIIxaV/gDmLlAF6wBMode1F14Rriu45jesZSaJtYw6y6mTJt3w9DefLad8OBwy2rujHj2ADE316kvFWfwT19MTwyl4CwzaHn/CkYfCGIme1/1cQa2hxL2KjqJmx7+8HJUV7hEcJ6LxysvCQzHTbUP5x1/ntE956jMnv76dXXRyGIWzAF0OLyoGVpDx0HF9jFLaD9Oropl/4r4K5Q3WO7Bgjez8Y3jUVEgqPb+roLstODKL47Rjc8eqrZ+uQ3TWHnEU1KfbOmYHenJuv8VU3KvXHa89hpWBaX9pmIgvlvIB8EbVISgwCTuWhqPTep2ldd+3zRidMoG7lL17x4hU1//IXK8ce07HgfHEsrXhiERlcTQsyJq6vu1PmItIi9PYfYOzsQQoSEwUpkCD02mkbJe+xSFp1zyswZ4ITJjjMcXL4gOvqZREffm/Ac3QnXznoyAf+n/At6QaDGYMDGhAAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Komodo Edit logo&quot; title=&quot;&quot; src=&quot;/static/d765d00825c185ab596b42da744359b4/6cb0f/komodo-edit.png&quot; srcset=&quot;/static/d765d00825c185ab596b42da744359b4/6cb0f/komodo-edit.png 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;As much as I liked TextMate, I could never get completely used to it because at the time I was working on 2 operating systems - OSx ( work ) and Ubuntu ( home/dev ). I was also sure I would end up using Windows for some or other reason in future due to work or somewhere else I was forced to. This meant that I would be using a different text editor on each operating system. This made me feel uncomfortable and I didn&apos;t want to learn to use something I&apos;d end up not using. It felt like a waste of time investment. I definitely wanted to get used to an editor that worked across all platforms. I wanted a text editor I would use for the rest of my life.&lt;/p&gt;
&lt;p&gt;My seeking continued until I had found &lt;a href=&quot;https://www.activestate.com/products/komodo-edit/&quot;&gt;KomodoEdit&lt;/a&gt;. It was great. It had a couple of things I wasn&apos;t ecstatic about, but the fact that it was cross platform made me forget about those quickly. KomodoEdit was definitely a very powerful text editor. I was referred to the application by a hardcore PHP backend friend and that made me feel good since I felt that I could grow with the editor if I needed to.&lt;/p&gt;
&lt;p&gt;KomodoEdit is a light-weight and free version of KomodoIDE. I had found pretty much everything I had wanted.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Light-weight - Check&lt;/li&gt;
&lt;li&gt;Multiple language support - Check&lt;/li&gt;
&lt;li&gt;Plenty of options - Check&lt;/li&gt;
&lt;li&gt;Powerful - Check&lt;/li&gt;
&lt;li&gt;Cross-Platform compatible - Check&lt;/li&gt;
&lt;li&gt;Aesthetically pleasing - No&lt;/li&gt;
&lt;li&gt;Find/replace throughout open tabs - No&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;SublimeText 2&lt;/h2&gt;
&lt;div class=&quot;logo-list&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAGAABAQEBAQAAAAAAAAAAAAAAAAMCBAX/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAemOdM+ukW8wuF//xAAbEAACAgMBAAAAAAAAAAAAAAACAwABBBESE//aAAgBAQABBQJ2Rdt9GLizpgGHGQzXnjDwkhopSh3P/8QAFhEBAQEAAAAAAAAAAAAAAAAAEBEh/9oACAEDAQE/AbhD/8QAFhEBAQEAAAAAAAAAAAAAAAAAAREg/9oACAECAQE/AWiTH//EABsQAAICAwEAAAAAAAAAAAAAAAABAhEQIUET/9oACAEBAAY/AvOHC9ikukrV7spCTN5//8QAHRABAQACAQUAAAAAAAAAAAAAAREAMUEQIVFhcf/aAAgBAQABPyFJQ0U5cXcB5aZreGIyJh7y4Rrsx9se+Dw3B1L96f/aAAwDAQACAAMAAAAQHzi8/8QAGREBAAIDAAAAAAAAAAAAAAAAAQAREDFB/9oACAEDAQE/EKqOkNRC3WP/xAAZEQACAwEAAAAAAAAAAAAAAAABEQAQMWH/2gAIAQIBAT8QHYA8h2MpV//EABsQAQEAAwEBAQAAAAAAAAAAAAERADFBIRDh/9oACAEBAAE/EE1BaB6e8DWKCpI0SbEcAuUR49MoAIHQW/mU1+lfCteXBgiMvK4cDGnphZtmqofP/9k=&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Windows logo&quot; title=&quot;&quot; src=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg&quot; srcset=&quot;/static/f9138083d7a5c571b89c339be90b8363/92935/windows-logo.jpg 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/2b0f2616a4e90a73caf375da09d0f105/92935/linux-tux.jpg&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAUABQDASIAAhEBAxEB/8QAGAABAAMBAAAAAAAAAAAAAAAAAAMEBQH/xAAWAQEBAQAAAAAAAAAAAAAAAAACAAH/2gAMAwEAAhADEAAAAd7LuVzaThUcQdshZ//EABwQAAICAgMAAAAAAAAAAAAAAAECAAMEExEiMf/aAAgBAQABBQI+Y72bZeeuWCUjLzNKBp//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAEDAQE/AR//xAAWEQADAAAAAAAAAAAAAAAAAAABEBH/2gAIAQIBAT8BoUC//8QAHRAAAgEFAQEAAAAAAAAAAAAAARECABASQXEDMv/aAAgBAQAGPwKsfSTyDFlrfKhKH2Cxdhvtv//EAB0QAAIBBAMAAAAAAAAAAAAAAAABERAhMUFRccH/2gAIAQEAAT8haGfArY7rGKWOxr2EAyjCLAl5lroWoiNjB//aAAwDAQACAAMAAAAQ5AgA/8QAFxEBAQEBAAAAAAAAAAAAAAAAARARUf/aAAgBAwEBPxDHkFn/xAAYEQADAQEAAAAAAAAAAAAAAAABEDERIf/aAAgBAgEBPxA7WVHY8q//xAAfEAEBAAIBBAMAAAAAAAAAAAABEQAhMRBBUWFxgaH/2gAIAQEAAT8QY6ULvBo9SpQmienj102FiU2h3E8yfFxfSYfbv9RLiodb8YWSjVUzWiqK6OZu/mAADgz/2Q==&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Linux Tux logo&quot; title=&quot;&quot; src=&quot;/static/2b0f2616a4e90a73caf375da09d0f105/92935/linux-tux.jpg&quot; srcset=&quot;/static/2b0f2616a4e90a73caf375da09d0f105/92935/linux-tux.jpg 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAADn0lEQVR42p1UT2gjdRTObsWLKHioVQQXD24PLtiDl+rFi15aEL0a9rB2K83iQQqLYnEOa2FVXAJRsrtQEFaq1EhaKO5uu92kSZpkkqYz+Z90MslMZppkkrRJmjbpn5n5ZEIHGlOk+i6/Nz/e73vf+968ZzCc0wBc0E6C+HZoenr63dN3/9ueLC19XW/swOVyWk8A+/7Ley37Bf3R4uLC5wCwU6vg1i3iA+1ubm6u71ylnSqlcw4NDfXn81y+0SjjwYOZ26fiLuox/6qTFmQymS5NTk5eMRgMfaOjo6/du2eev379k2sDAwMvTU1NvTU+Pv7K6aQ9RhCEls1gNpvfoChqvlbb2W02m4csy0YfP354c2bml6uxRGKmXClL1e3KMcOkqnb7H98PDg4+3wOsgxHEl5cFIc9pWilQFEVV0PFVBbIid/zG7g5EMYfCVk5WcYCFBdsPPQ3SSw3TtF171NxrHrUPWmgftNFuH6j7+02lUpUUUcjJPJ9BNpdWxK0sSNK9aTKZ3uySS2c3NjZ2uVyRWq12SwNUW+19HB0do96oQZJESNIWtgo8OC4NhompqRQNs/m70Z5u6x937/78cWO3gXqjru7tNXF4eAipJKJYymO7VkGxKIDjNpFOR1Q2E8N60FOamJh4sUc/h8PxzAnwVQ2wVt9RtHI5joEgZFFrVFGSRPACiwwTRyy6riaTFGg6IBIE8ULPxOgMzeYfP6pUy2ju76kZJgmGiaNWr6JYEjrAbDaBRIICTfnUIOlEJByU71gsb/eUrGt4zWi8UiwVjwSRA0k61eq2hEKBhyCwYLNJaKzCNIlQwAWve0mOR0h4PKt//mOyupy+ELUeCJBOsGxS0X4NjmfAsgmkkjQi4QBCQTdI71N43cvwOB+psTCJleWHvxkMhue6sHTK30zd/CoS9oPPZ+QMG0cmE0cqFUY0GgC1sYb1wGoH0Odehtv5SPV5luD1rNRHRkZe7dJSd/r7+1+mKD+fz29qrBQNLB4LIUKT2AitIRR0IeB3wLf2BI7lRTlGeTFvn7OcYFzsGj2d5f371k+FPINkgpKjkaAcjQaVZGID6ZRWtl8N+J2Ky/nXccC7AtK/KhqNxtdP9+LM5WC3234qFnKQSrwiihlsbPiOvWtPazTtl3kuBYFPIx4NHVmt1g/PZHdGp56dnf31C6djZdFm+/220Wh8Z3h4+NKNG5+9Z1+w3fF43LMWi/X9c2/t8672s+L+BnV/5SLYLOfbAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;Apple logo&quot; title=&quot;&quot; src=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png&quot; srcset=&quot;/static/37c7663814ae0af050092a06e492dd4e/6cb0f/apple-logo.png 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;span class=&quot;gatsby-resp-image-wrapper&quot; style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 40px; &quot;&gt;
      &lt;a class=&quot;gatsby-resp-image-link&quot; href=&quot;/static/7197f0bd71e77a636ae3741d865ebdd3/6cb0f/sublimetext.png&quot; style=&quot;display: block&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;
    &lt;span class=&quot;gatsby-resp-image-background-image&quot; style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAADxUlEQVR42rWUb0gbdxjHr3XQF1MYlIHCYLCuMAYZhfWFLO6FLjUmuVwupsmqY0m0U1s1jS6I6NbWpFajMZJLYiY6g6aaqCAXWWzCXfxTEG3Zi+7N9qavNhjrYJs4Otgwd9/xS9tbxmCsgx58eI7f8zzf556He34U9bwel8t1wu/324LBYNvExERrIBC4+G+QGBI7OjpqbWhoOKEIra6ulhEbDAYvplIpLC0tSYuLi1C4davkveR8cbEYm0wmMTk5ealUi/L7/a+sra095DgOHMcVOI6TQhwnhcMRaSo6JcWinBSLhqVoNCZx4bBE/E8ohEIhbGQyB+Pj46eUrwyHw3UrKysYHBzEjRs+2ev1EovI2Cf4gnPi3rQFd6ctyHB2RMcG4fX5UIzx+TAwMCBnMhnMzMzQiuD8/Lx5bm4OHR0dcm9vD9xuN4YG3Lg/2wgI5/Ew240fbnfjUc6OxPgluK70oMftRm9vL9rb26WFhQXwPO9UBHme/4i0+77NJrW2tuJDhxM3+1pwtMGisG7A7TEG09eaERq6jI9dbWhxOuB0OkFibTZbIRqNYmdnp18RFAThOmlBq60vWCwWmM1mOJobsTHeiN9T7wGJM/gp/Bru+t7EaFc9mi6ch9nMgsTW19cfDQ8PY3d3d0oRzOVysx6PB3V1dUc0TYM2GGBiaDQ3NeJqtwXJ6zQehM4CE8fwo/dF9Dh10BtoGGkatbW1BZIrimKytOW1rq4uaDSagtFIgzEx8Ng1iHe8gUB7Nfra9Ij31eKPa2XAzRfgu9wAnYEBYzTi3DlNobOzE+l0OqsIplKpXbvdDq1WK5GqesaEz93vAsNlkD+l8HPfcfzWTwHeY/hq6C20fMAWuzAajcUcMk+e57+kKOp4cUMSicQ3VqsVOp1OIi0TUWeTCZ95dLhztRpf+87gvvdtJPs16HCwYBgaxdHQNMmRSe76+vp3brf7JSoSiZyMx+Pfk2p6vV42GAx4jB4GoxHmRhY2mxlWqxk0w+Avv4Ks1+uRSqUOA4HAq9TIyMjryWTyERFkWVZmWRZ/w2SC6Qn/8D2mKMjzvBSJRM6StXsnm80Wq6nValmtVuNZqKmpIZ1BEATEYjEtRVYml8tBpVLJVVVVqKysfCZIjkqlkkRRxPLy8gUyw5aDgwPs7e1Jm5ub2Nrawvb2tmKfnpXy1E/I5/PY398vHB4eYnZ29gpltVpVPM8/yOfzvwqC8IsgCAf/BVEUi5AcURQP0+n0tw6Ho7r4H1ZUVJykKOo0RVGn/ieny8vLX34uV/+fdP7h+aH1ohwAAAAASUVORK5CYII=&apos;); background-size: cover; display: block;&quot;&gt;&lt;/span&gt;
  &lt;img class=&quot;gatsby-resp-image-image&quot; alt=&quot;SublimeText 2 logo&quot; title=&quot;&quot; src=&quot;/static/7197f0bd71e77a636ae3741d865ebdd3/6cb0f/sublimetext.png&quot; srcset=&quot;/static/7197f0bd71e77a636ae3741d865ebdd3/6cb0f/sublimetext.png 40w&quot; sizes=&quot;(max-width: 40px) 100vw, 40px&quot; style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;&gt;
  &lt;/a&gt;
    &lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Finally I stumbled upon &lt;a href=&quot;https://www.sublimetext.com/&quot;&gt;SublimeText 2&lt;/a&gt;. And it was good.&lt;/p&gt;
&lt;p&gt;It had everything I could ever want and more, this went from &lt;a href=&quot;http://www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html&quot;&gt;Multi-select&lt;/a&gt; to &lt;a href=&quot;http://www.sublimetext.com/docs/2/distraction_free.html&quot;&gt;distraction free mode&lt;/a&gt;. It had all the above checks, it was aesthetically pleasing and had an unbelievable find functionality. The Mac text editors ( TextMate and Coda ) look and feel far better to use than applications on other operating systems - It&apos;s like they&apos;re just made better. SublimeText2 has kept this feeling, even on different operating systems. The fact that text editors had to look ugly in Linux and Windows had been something I had wondered about on and off for a long time - Finally there was one editor that broke my perception.&lt;/p&gt;
&lt;p&gt;I had never used a dark theme before but the default SublimeText 2 was perfect. It had Chrome styled tabs, you could record macros, create your own snippets very easily and it had a visual map of document on the side of the editor ( this seemed like it could get old quickly, but I find it very useful in spotting patterns in larger documents).&lt;/p&gt;
&lt;p&gt;The options worked differently compared to any other application I had used before. An options page was a text page in a sort of object/array layout. At first I thought this was temporary and it would be updated in a future version, but I finally realized how brilliant it was. You could search for options via the text editor. Search results appear in another default text-editor tab and it&apos;s all consistent. You don&apos;t ever leave tabs and text, brilliant.&lt;/p&gt;
&lt;p&gt;The best part is, it&apos;s only a beta. That&apos;s right, until the time of this writing &lt;abbr title=&quot;SublimeText 2&quot;&gt;ST2&lt;/abbr&gt; is a beta and it gets updated VERY often. New features, functionality and bug fixes come out with every update. &lt;abbr title=&quot;SublimeText 2&quot;&gt;ST2&lt;/abbr&gt; has always been expensive for a text-editor, atleast $59 is expensive for one to me, but &lt;abbr title=&quot;SublimeText 2&quot;&gt;ST2&lt;/abbr&gt; allows you to trial the software for as long as you&apos;d like. On the site it says:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SublimeText may be downloaded and evaluated for free, however a license must be purchased for continued use.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The license comes with a bunch of perks, the most noticable includes a per-user license, not per-install or per-machine. This means you can use the registered version on whatever operating system and machine you&apos;re using. After running and using it on all operating systems I decided to purchase it and I would urge anyone who loves it half as much as I do to support the development.&lt;/p&gt;
&lt;p&gt;On top of all of this, I&apos;ve subsequently began to learn Ruby and it&apos;s got a Ruby build system installed - along with a bunch of other builds, including ant build. &lt;abbr title=&quot;SublimeText 2&quot;&gt;ST2&lt;/abbr&gt; supports a vast amount of languages ( more than just syntax highlighting ), has plugin support and it supports Textmate snippets. The &lt;a href=&quot;http://www.sublimetext.com/forum/&quot;&gt;community &lt;/a&gt;is also pretty great.&lt;/p&gt;
&lt;p&gt;As you may possibly know, I develop HTML, CSS, Javascript, PHP and Ruby. I&apos;ve got friends who I&apos;ve convinced to permanently use &lt;abbr title=&quot;SublimeText 2&quot;&gt;ST2&lt;/abbr&gt; and they use languages ranging from Python to C++.&lt;/p&gt;
&lt;p&gt;According to me, it is by far the best text-editor around.&lt;/p&gt;
&lt;h2&gt;tl;dr&lt;/h2&gt;
&lt;p&gt;SublimeText 2 is awesome.&lt;/p&gt;
&lt;h2&gt;Disclaimer&lt;/h2&gt;
&lt;p&gt;I don&apos;t own any of the icons used, they belong to the text-editor/operating system.
I may have unfairly moved on from some of the text editors due to lack of specific functionality (or perceived lack of), aesthetics and cross-OS support. I may have been a bit unfair and some of you may disagree with me, but for me &lt;abbr title=&quot;SublimeText 2&quot;&gt;ST2&lt;/abbr&gt; wins in every field. Also, if I&apos;ve misrepresented any text-editor above, please correct me by with a comment.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Bulletproof full page background images don't exist]]></title><description><![CDATA[They don't and can't exist. Before I continue, let me explain what a 'bulletproof full page background' is. This is a solution that will…]]></description><link>https://css-plus.com/2012/01/bulletproof-full-page-background-images</link><guid isPermaLink="false">https://css-plus.com/2012/01/bulletproof-full-page-background-images</guid><pubDate>Thu, 05 Jan 2012 00:00:00 GMT</pubDate><content:encoded>&lt;!-- get images --&gt;
&lt;p&gt;They &lt;em&gt;don&apos;t&lt;/em&gt; and &lt;em&gt;can&apos;t exist&lt;/em&gt;. Before I continue, let me explain what a &apos;bulletproof full page background&apos; is. This is a solution that will always give the &apos;perfect&apos; full page background-image across multiple viewports &lt;strong&gt;regardless of which image you are using&lt;/strong&gt;.
&lt;strong&gt;Note:&lt;/strong&gt; I understand &apos;perfect&apos; is a very subjective term.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;I have been asked to create a full page background image before; There was a problem, however...&lt;/p&gt;
&lt;p&gt;Images can stretch nicely as long as the proportion remains constant, otherwise the image looks stretched. This is an example of what someone might consider a perfect full page background-image:
&lt;img src=&quot;http://css-plus.com/wp-content/uploads/2012/01/perfect-scale-1.png&quot; alt=&quot;&quot; title=&quot;perfect-scale-1&quot; width=&quot;366&quot; height=&quot;218&quot; class=&quot;alignnone size-full wp-image-1394&quot;&gt;
As you can see, the scale remains constant and this works with the perfect full page background-image.&lt;/p&gt;
&lt;h2&gt;Problem 1&lt;/h2&gt;
The background in the previous example contains the width/height of the viewport. If the second viewport didn&apos;t have the same dimension ratio, that very same background could look something like this:
&lt;img src=&quot;http://css-plus.com/wp-content/uploads/2012/01/scale-stretch-height.png&quot; alt=&quot;&quot; title=&quot;scale-stretch-height&quot; width=&quot;466&quot; height=&quot;197&quot; class=&quot;alignnone size-full wp-image-1396&quot;&gt;
That is clearly an example of a &apos;failed&apos; full page background.
&lt;h2&gt;Problem 2&lt;/h2&gt;
A &lt;em&gt;typical and easy&lt;/em&gt; way to fix it would be to set the background-image width to be equal to the viewport&apos;s width, but &lt;em&gt;leave the height a dynamic size&lt;/em&gt;. This would give you something that looks like this:
&lt;img src=&quot;http://css-plus.com/wp-content/uploads/2012/01/scale-cutoff.png&quot; alt=&quot;&quot; title=&quot;scale-cutoff&quot; width=&quot;466&quot; height=&quot;197&quot; class=&quot;alignnone size-full wp-image-1395&quot;&gt;
Obviously the problem here is that the entire bottom area of the image is currently not visible... Unless you scroll down, which defeats the purpose of a full-page background-image.
&lt;h2&gt;Problem 3&lt;/h2&gt;
You could very well set the height to fit the viewport&apos;s height and have a dynamic width. With this example, the output would now look something like this:
&lt;img src=&quot;http://css-plus.com/wp-content/uploads/2012/01/scale-cutoff-width.png&quot; alt=&quot;&quot; title=&quot;scale-cutoff-width&quot; width=&quot;466&quot; height=&quot;197&quot; class=&quot;alignnone size-full wp-image-1400&quot;&gt;
This seems like the perfect full page background image solution right? Well... Not really. If we used the exact same technique with an image that has a larger width than it does height, it would look like this:
&lt;img src=&quot;http://css-plus.com/wp-content/uploads/2012/01/scale-stretch-width.png&quot; alt=&quot;&quot; title=&quot;scale-stretch-width&quot; width=&quot;466&quot; height=&quot;197&quot; class=&quot;alignnone size-full wp-image-1397&quot;&gt;
&lt;h2&gt;So, what is the solution?&lt;/h2&gt;
The perfect solution exists, as long as you don&apos;t feel that &apos;perfect&apos; implies every image should look great with the specific solution. As long as you have background images with similar layouts ( All have width &amp;gt; height or visa versa ) you could use a solution to work with them all.
&lt;p&gt;I have seen a static image used as a centered background image which worked well for that situation.
&lt;img src=&quot;http://css-plus.com/wp-content/uploads/2012/01/static-example.png&quot; alt=&quot;&quot; title=&quot;static-example&quot; width=&quot;466&quot; height=&quot;197&quot; class=&quot;alignnone size-full wp-image-1398&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
When it comes to full page background images and dynamic backgrounds, make sure you understand how the dimensions work and pick the right solution for your needs.</content:encoded></item><item><title><![CDATA[Use :pseudo-elements as list-style-image alternatives]]></title><description><![CDATA[Styling lists with CSS can be a bit of a pain from time to time. If I require an kind of customized bullet, the first CSS property I think…]]></description><link>https://css-plus.com/2011/12/control-your-list-items</link><guid isPermaLink="false">https://css-plus.com/2011/12/control-your-list-items</guid><pubDate>Thu, 01 Dec 2011 00:00:00 GMT</pubDate><content:encoded>&lt;!-- manual get images from now --&gt;
&lt;p&gt;Styling lists with &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt; can be a bit of a pain from time to time. If I require an kind of customized bullet, the first &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt; property I think of is &lt;code&gt;list-style: none;&lt;/code&gt;. I&apos;ve tried on more than one occasion to use &lt;code&gt;list-style-image&lt;/code&gt; but it&apos;s given me nothing but trouble when attempting to position it. A popular alternative is to use the image as a &lt;code&gt;background-image&lt;/code&gt; of the list item.&lt;/p&gt;
&lt;!--more--&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;li { background: url(images/bullet.png) no-repeat left top; list-style: none; }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This gives us the ability to move the &apos;&lt;i&gt;list-item&lt;/i&gt;&apos; around as we please without problems. Great solution! right?! No, there are three very annoying (however, small) problems with this method:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;You can&apos;t effectively include the list item in a sprite, as you&apos;d run into problems displaying areas of the sprite you wish to remain hidden.&lt;/li&gt;
 	&lt;li&gt;An image obviously can&apos;t work with ordered lists as the numbered &lt;code&gt;list-style-type&lt;/code&gt; would require a different image for each list item. This is possible but not very effective as it would require a lot of images and it wouldn&apos;t be ever-expanding - It would have static amount of numbered images.&lt;/li&gt;
 	&lt;li&gt;Adds to HTTP requests - this is especially annoying if you&apos;ve got a couple of different lists all using this method&lt;/li&gt;
&lt;/ul&gt;
Those are my two problems I have with the &lt;code&gt;background-image&lt;/code&gt;, but I have managed to find a way around it.
&lt;h2&gt;Standard background-image method&lt;/h2&gt;
Before I get started on the way I usually do this, let me show you what I did before and what I think most people do.
&lt;h3&gt;The &lt;abbr title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/abbr&gt; necessary&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;ul class=&quot;first-example&quot;&amp;gt;
	&amp;lt;li&amp;gt;SEO&amp;lt;/li&amp;gt;
	&amp;lt;li&amp;gt;Content Management System&amp;lt;/li&amp;gt;
	&amp;lt;li&amp;gt;Social Network Integration&amp;lt;/li&amp;gt;
	&amp;lt;li&amp;gt;Another list item for emphasis&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;The &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt; necessary&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;.first-example li { background: url(../i/tick.png) no-repeat left 8px; }
.first-example li { border-bottom: 1px solid #eee; font-size: 14px; list-style: none; padding: 10px 0 10px 40px; }&lt;/code&gt;&lt;/pre&gt;
You can see what&apos;s going on, no explanation needed. The only thing to note here is the list items contain a background image and that image is a single file separate from the sprite which adds to http requests.
&lt;h2&gt;Make use of &lt;b&gt;pseudo elements&lt;/b&gt;&lt;/h2&gt;
Pseudo elements are our friends. They are that extra bit of gas in the tank. When everything looks dull and there is no easy way to do what it is you want to do, look towards pseudo elements.
&lt;p&gt;We could use pseudo elements as the &apos;bullets&apos;. This would solve the problem of showing more sprite than we&apos;d like since we can set the pseudo-element&apos;s &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt; and give it the sprite background.&lt;/p&gt;
&lt;h3&gt;The HTML&lt;/h3&gt;
The HTML is exactly the same as the first example with. The only difference is the class selector used for us to target.
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;ul class=&quot;second-example&quot;&amp;gt;
	&amp;lt;li&amp;gt;SEO&amp;lt;/li&amp;gt;
	&amp;lt;li&amp;gt;Content Management System&amp;lt;/li&amp;gt;
	&amp;lt;li&amp;gt;Social Network Integration&amp;lt;/li&amp;gt;
	&amp;lt;li&amp;gt;Another list item for emphasis&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;li { border-bottom: 1px solid #eee; font-size: 14px; list-style: none; padding: 10px 0 10px 40px; position: relative; }
&lt;p&gt;ul.second-example li:before {
content: &apos;&apos;;
background: url(../i/sprite.png) no-repeat left top;
height: 20px;
width: 20px;
position: absolute;
left: 0;
top: 8px;
}&lt;/p&gt;
&lt;p&gt;ul.second-example li:nth-child(2n):before {
background-position: -21px 0;
}&lt;/code&gt;&lt;/pre&gt;
Why exactly are we giving every second example a different list item image? For two reasons:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;It gives me an excuse to use a sprite in this example&lt;/li&gt;
 	&lt;li&gt;We&apos;re just retro and hip like that&lt;/li&gt;
&lt;/ul&gt;
Le&apos;s see what would have happened if we gave the first example the sprite as the background.
&lt;h3&gt;List item with the sprite as a background-image&lt;/h3&gt;
&lt;img class=&quot;alignleft size-full wp-image-1318&quot; title=&quot;background-with-sprite&quot; src=&quot;http://css-plus.com/wp-content/uploads/2011/11/background-with-sprite.jpg&quot; alt=&quot;List items with a sprite background image&quot; width=&quot;270&quot; height=&quot;150&quot;&gt;
&lt;h3&gt;List item with pseudo element using the sprite as a background image - Preferred method&lt;/h3&gt;
&lt;img class=&quot;alignleft size-full wp-image-1319&quot; title=&quot;pseudo-element-with-sprite&quot; src=&quot;http://css-plus.com/wp-content/uploads/2011/11/pseudo-element-with-sprite.jpg&quot; alt=&quot;Pseudo elements acting as list item bullets&quot; width=&quot;270&quot; height=&quot;150&quot;&gt;
&lt;h2&gt;Make use of &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt; counters&lt;/h2&gt;
&lt;img class=&quot;alignleft size-full wp-image-1337&quot; title=&quot;ordered-list-pseudo-elements&quot; src=&quot;http://css-plus.com/wp-content/uploads/2011/12/ordered-list-pseudo-elements.jpg&quot; alt=&quot;&quot; width=&quot;241&quot; height=&quot;167&quot;&gt;What exactly are &lt;a href=&quot;https://developer.mozilla.org/en/CSS_Counters&quot;&gt;CSS counters&lt;/a&gt;? A &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt; counter is a function that is accepted by the &lt;code&gt;content&lt;/code&gt; property of a pseudo element. You can count whatever it is you like. The amount of &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; elements in an article, the amount of &lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt; elements, etc. In this case we&apos;re going to be counting the amount of &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; elements. This way we can dynamically give the :before/:after pseudo elements a numerical value which will help to number our list items.
&lt;p&gt;The &lt;a href=&quot;https://developer.mozilla.org/en/CSS_Counters&quot;&gt;CSS counter&lt;/a&gt; property is within the &lt;a href=&quot;http://www.w3.org/TR/CSS2/generate.html#counters&quot;&gt;CSS 2.1 spec&lt;/a&gt;. So this means that it has support down to IE8. I understand that it won&apos;t work in IE7 &amp;#x26; IE6, but I don&apos;t really care too much — I&apos;d probably just give them the default numerical &lt;code&gt;list-item-type&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Bring on the CSS&lt;/h3&gt;
Some of &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt; following will be the same as the previous CSS, but that&apos;s because the list is styled in a similar fashion.
li { border-bottom: 1px solid #eee; font-size: 14px; list-style: none; padding: 10px 0 10px 40px; position: relative; }
li:first-child { border-top: 1px solid #eee; }
&lt;p&gt;ul.first-example li { content: &apos;&apos;; background: url(../i/tick.png) no-repeat left 8px; }&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascipt&quot;&gt;ol.third-example { counter-reset: li; }

ol.third-example li { position: relative; }

ol.third-example li:before { 
	content: counter(li); 
	counter-increment: li; 
	background: #f692bb; 
	color: #333;
	font: bold 14px/20px sans-serif; 
	height: 20px; 
	text-align: center; 
	width: 20px; 
	position: absolute; 
	left: 0; 
	top: 8px; 
	-webkit-border-radius: 10px;
	   -moz-border-radius: 10px;
	        border-radius: 10px;
	-webkit-box-shadow: inset 0 0 5px #F0498D, 2px 2px 0 rgba(0,0,0,.15);
	   -moz-box-shadow: inset 0 0 5px #F0498D, 2px 2px 0 rgba(0,0,0,.15);
		box-shadow: inset 0 0 5px #F0498D, 2px 2px 0 rgba(0,0,0,.15);
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Before I continue, thanks &lt;a href=&quot;http://twitter.com/paulirish&quot;&gt;paulirish&lt;/a&gt; and &lt;a href=&quot;http://twitter.com/jon_neal&quot;&gt;jon_neal&lt;/a&gt; for &lt;a href=&quot;http://css3please.com/&quot;&gt;CSS3 Please&lt;/a&gt; - Quite a helpful tool.&lt;/p&gt;
&lt;p&gt;Note: the position relative on the list item is very necessary since you&apos;ll be absolutely positioning the pseudo elements within each item.&lt;/p&gt;
&lt;p&gt;To use the counter() function properly, 3 things need to ne done.&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;The counter of the specific element needs to be reset — Or as I like to think of it, enabled&lt;/li&gt;
 	&lt;li&gt;The counter-increment needs to be told what to count, and by how much. (the increment could be by 2, or 10, in this example we&apos;re going to leave it on 1 by default)&lt;/li&gt;
 	&lt;li&gt;The counter() function needs to be passed into the content property and then told what to count&lt;/li&gt;
&lt;/ul&gt;
Ok so first thing to do is to add the &lt;code&gt;counter-reset&lt;/code&gt; property to the parent/ancestor container of the item you wish to count. You then give the &lt;code&gt;counter-reset&lt;/code&gt; value the element type of the element to count. If you&apos;d like to count the amount of paragraphs in the article element, you could reset the counting by adding the following &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt; to your document:
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;body { counter-reset: p; }
/* Or */
article { counter-reset: p; }&lt;/code&gt;&lt;/pre&gt;
It cascades, so any container will do.
&lt;p&gt;You would then add the &lt;code&gt;counter-increment&lt;/code&gt; property to the pseudo element, this tells the pseudo element which element to count and by how much.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;li { counter-increment: li 5; }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That example would count in increments of 5 starting on that value, so: 5, 10, 15, etc. If you leave that value out it defaults to 1.&lt;/p&gt;
&lt;p&gt;Finally, you would then add the &lt;code&gt;counter()&lt;/code&gt; function to the &lt;code&gt;content&lt;/code&gt; property of the pseudo element. This literally tells the pseudo element to contain the incremented value.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
I find this extremely useful and consider it one of my better &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt; tricks.
Browser support isn&apos;t horrible, but not brilliant either — The inclusion of IE7 would make it brilliant. Never the less, it&apos;s completely usable in every day scenarios since I use it fairly often and I give IE7 the deafult numbered styling.
&lt;p&gt;To recap: &lt;b&gt;counter-reset&lt;/b&gt;: element, &lt;b&gt;counter-increment&lt;/b&gt;: element num, &lt;b&gt;content&lt;/b&gt;: counter(element).&lt;/p&gt;
&lt;p&gt;Note: I actually make use of the custom bullets via pseudo elements on my unordered list items within my current website design.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to make the input placeholder more user friendly]]></title><description><![CDATA[I've always loved placeholder text for input fields. Not too long ago the only way to achieve this would be to create a special javascript…]]></description><link>https://css-plus.com/2011/09/make-the-input-placeholder-user-friendly</link><guid isPermaLink="false">https://css-plus.com/2011/09/make-the-input-placeholder-user-friendly</guid><pubDate>Thu, 22 Sep 2011 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;ve always loved placeholder text for input fields. Not too long ago the only way to achieve this would be to create a special javascript function that enabled the desired functionality, but now it &lt;strong&gt;magically comes pre-built into &lt;abbr title=&quot;Hypertext Markup Language 5&quot;&gt;HTML5&lt;/abbr&gt;&lt;/strong&gt;. Incase you&apos;re wondering, placeholder text is the text within an input field that disappears once you click on it. It&apos;s often used in place of a label.&lt;!--more--&gt;&lt;/p&gt;
&lt;h2&gt;How is it not user friendly? &lt;a href=&quot;#h1-html&quot;&gt;&lt;abbr title=&quot;Too long, didn&apos;t read&quot;&gt;tl;dr&lt;/abbr&gt; - Take me to the tutorial already&lt;/a&gt;&lt;/h2&gt;
Placeholder text can be very helpful and can save a lot of page space while also being aesthetically pleasing. With this great feature, however, comes a problem: If the placeholder text is being used in place of a label, it can become very confusing when you focus on the field and the &apos;label&apos; disappears.
&lt;p&gt;It&apos;s important for users to know:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;What field they are currently on&lt;/li&gt;
 	&lt;li&gt;What field they have filled in&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Typical input placeholder problem&lt;/h3&gt;
&lt;figure&gt;&lt;img class=&quot;alignnone size-full wp-image-1234&quot; title=&quot;Figure 1 - Standard input placeholder problem&quot; src=&quot;http://css-plus.com/wp-content/uploads/2011/09/placeholder-problem.png&quot; alt=&quot;Figure 1 - Standard input placeholder problem&quot; width=&quot;365&quot; height=&quot;30&quot;&gt;&lt;figcaption&gt;Which input field am I on?&lt;/figcaption&gt;&lt;/figure&gt;
Based on the image above, it&apos;s impossible to tell what the first/focused field is. It is relatively simple to deduce &lt;em&gt;it&apos;s either&lt;/em&gt; a &apos;&lt;em&gt;username&lt;/em&gt;&apos; or &apos;&lt;em&gt;email&lt;/em&gt;&apos; field. The only way to find out which field you&apos;re on would be to remove all the text in the field and blur (lose focus). I have personally been caught by this dozens and dozens of times and I find it very annoying.
&lt;p&gt;One method that websites, such as &lt;a href=&quot;http://twitter.com&quot; rel=&quot;external&quot;&gt;Twitter&lt;/a&gt;, have been adopting is to have the &lt;em&gt;placeholder text fade out slightly on focus&lt;/em&gt;, but only disappear once the user inputs some text. This is arguably the way that the &lt;abbr title=&quot;Hypertext Markup Language 5&quot;&gt;HTML5&lt;/abbr&gt; placeholder should work by default.&lt;/p&gt;
&lt;h3&gt;An improved version&lt;/h3&gt;
&lt;img class=&quot;alignleft size-full wp-image-1247&quot; title=&quot;Figure 2 - The Twitter input placeholder&quot; src=&quot;http://css-plus.com/wp-content/uploads/2011/09/twitter-placeholder.jpg&quot; alt=&quot;Figure 2 - The Twitter input placeholder&quot; width=&quot;385&quot; height=&quot;375&quot;&gt;
&lt;ol&gt;
 	&lt;li&gt;Normal Placeholder text&lt;/li&gt;
 	&lt;li&gt;Placeholder text fades out slightly on focus&lt;/li&gt;
 	&lt;li&gt;The input field is unknown once text has been added&lt;/li&gt;
 	&lt;li&gt;The title attribute is used to add information&lt;/li&gt;
&lt;/ol&gt;
The method that the &lt;strong&gt;Twitter login system&lt;/strong&gt; uses is a big step up from the problem in fig.1, however the &lt;strong&gt;same problem still exists&lt;/strong&gt; once the user has added text.
&lt;p&gt;The &lt;strong&gt;title attribute&lt;/strong&gt; has been used here so a user can see the placeholder text by hovering over the input field which is a great addition. Unfortunately in general, I still don&apos;t feel this is as very user friendly as it could be.&lt;/p&gt;
&lt;h2&gt;The solution&lt;/h2&gt;
I would like all of the bonuses of both the placeholder method and the standard label method. I&apos;ve decided there is one basic way to achieve this: Have either the &lt;strong&gt;label of the input field&lt;/strong&gt; or an &lt;em&gt;appropriate icon&lt;/em&gt; appear to the right of the field after the field has received focus.
&lt;p&gt;So that&apos;s it, in this tutorial I&apos;m going to show you how you can make a form with placeholder text that is semantic, user-friendly and degrades gracefully for legacy browsers.&lt;/p&gt;
&lt;h2&gt;&lt;a id=&quot;h1-html&quot;&gt;&lt;/a&gt;The HTML&lt;/h2&gt;
The following &lt;abbr title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/abbr&gt; is normal &amp;lt;form&amp;gt; markup. It&apos;s what we do with the &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt; that really matters.
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;form id=&quot;login&quot;&amp;gt;
    &amp;lt;ul&amp;gt;
        &amp;lt;li&amp;gt;
            &amp;lt;input id=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Your Email&quot; title=&quot;Your Email&quot; type=&quot;email&quot; required /&amp;gt;
            &amp;lt;label for=&quot;email&quot;&amp;gt;Your Email&amp;lt;/label&amp;gt;
        &amp;lt;/li&amp;gt;
        &amp;lt;li&amp;gt;
            &amp;lt;input id=&quot;password&quot; name=&quot;password&quot; placeholder=&quot;Your Password&quot; title=&quot;Your Password&quot; type=&quot;password&quot; required /&amp;gt;
            &amp;lt;label for=&quot;password&quot;&amp;gt;Your Password&amp;lt;/label&amp;gt;
        &amp;lt;/li&amp;gt;
        &amp;lt;li&amp;gt;
            &amp;lt;input id=&quot;submit&quot; name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;Login&quot;&amp;gt;
        &amp;lt;/li&amp;gt;
    &amp;lt;/ul&amp;gt;
&amp;lt;/form&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;#login{font-size: 12px; margin: 0 auto; width: 700px;}
# login li{float: left; list-style: none; margin-left: 30px; position: relative;}
# login li:first-child{margin-left: 0;}
&lt;p&gt;label{line-height: 40px; position: absolute; right: 120px; top: 0; bottom: 0;
-moz-transition: 0.3s right ease;
-ms-transition: 0.3s right ease;
-o-transition: 0.3s right ease;
-webkit-transition: 0.3s right ease;
transition: 0.3s right ease;
z-index: 0}&lt;/p&gt;
&lt;p&gt;input{color: transparent; font-size: 12px; height: 35px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px;
-moz-transition: 0.3s all ease;
-ms-transition: 0.3s all ease;
-o-transition: 0.3s all ease;
-webkit-transition: 0.3s all ease;
transition: 0.3s all ease;}&lt;/p&gt;
&lt;p&gt;input[type=&quot;email&quot;], input[type=&quot;password&quot;]{border: 1px solid #ccc; height: 35px; padding: 0 10px; width: 240px; position: relative;
-moz-box-shadow: inset 0 0 10px rgba(0,0,0,.06);
-webkit-box-shadow: inset 0 0 10px rgba(0,0,0,.06);
box-shadow: inset 0 0 10px rgba(0,0,0,.06);
z-index: 2;}&lt;/p&gt;
&lt;p&gt;input[type=&quot;email&quot;]{color: rgba(47,130,194,.8);}
input[type=&quot;password&quot;]{color: rgba(237,28,112,.8);}&lt;/p&gt;
&lt;p&gt;/_ Placeholder _/
input[type=&quot;email&quot;]:-moz-placeholder{color: rgba(47,130,194,.6);}
input[type=&quot;email&quot;]:-ms-input-placeholder{color: rgba(47,130,194,.6);}
input[type=&quot;email&quot;]::-webkit-input-placeholder{color: rgba(47,130,194,.6);}&lt;/p&gt;
&lt;p&gt;input[type=&quot;password&quot;]:-moz-placeholder{color: rgba(237,28,112,.6);}
input[type=&quot;password&quot;]:-ms-input-placeholder{color: rgba(237,28,112,.6);}
input[type=&quot;password&quot;]::-webkit-input-placeholder{color: rgba(237,28,112,.6);}&lt;/p&gt;
&lt;p&gt;/_ Label _/
input[type=&quot;email&quot;] + label{color: rgb(47,130,194);}
input[type=&quot;password&quot;] + label{color: rgb(237,28,112);}&lt;/p&gt;
&lt;p&gt;input:focus + label{right: 10px;}&lt;/p&gt;
&lt;p&gt;input[type=&quot;email&quot;]:focus, input[type=&quot;password&quot;]:focus{background-color: rgba(255,255,255,.8);}&lt;/p&gt;
&lt;p&gt;/_ Submit _/
input[type=&quot;submit&quot;]{
background-color: #333;
background: -moz-linear-gradient(bottom, #333, #444);
background: -ms-linear-gradient(bottom, #333, #444);
background: -o-linear-gradient(bottom, #333, #444);
background: -webkit-linear-gradient(bottom, #333, #444);
background: linear-gradient(bottom, #333, #444);
border: 1px solid #222; color: #fff; cursor: pointer; height: 35px; width: 110px;
}&lt;/p&gt;
&lt;p&gt;input[type=&quot;submit&quot;]:hover{color: #ff6937;text-shadow: 0 0 1px rgba(255,255,255,.2);}&lt;/code&gt;&lt;/pre&gt;
The &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt; mostly consists of general styling, I&apos;d say the most important two lines are:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;input:focus + label{right: 10px;}
input[type=&quot;email&quot;]:focus, input[type=&quot;password&quot;]:focus{background-color: rgba(255,255,255,.8);}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So the label is absolutely placed behind the input field. On focus the label moves to the right while the input&apos;s background fades to a lower opacity. This gives the illusion of the label sliding right while fading in.&lt;/p&gt;
&lt;p&gt;That&apos;s pretty much all there is to it. I think it&apos;s a neat little trick.&lt;/p&gt;
&lt;h2&gt;Let&apos;s give IE a bit of love&lt;/h2&gt;
As always, IE spoils the party, but as always &lt;a href=&quot;http://www.modernizr.com/&quot;&gt;Modernizr&lt;/a&gt; is here to save the day. We can get the form to act almost identically (sans animations) on IE8 and functionally on IE 6 and 7. Firstly, make sure you&apos;ve given either the &amp;lt;html&amp;gt; or the &amp;lt;body&amp;gt; tag IE specific styles. For example:
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;!--[if lt IE 7 ]&amp;gt; &amp;lt;html class=&quot;no-js ie6 ie&quot; lang=&quot;en&quot;&amp;gt; &amp;lt;![endif]--&amp;gt;
&amp;lt;!--[if IE 7 ]&amp;gt;    &amp;lt;html class=&quot;no-js ie7 ie&quot; lang=&quot;en&quot;&amp;gt; &amp;lt;![endif]--&amp;gt;
&amp;lt;!--[if IE 8 ]&amp;gt;    &amp;lt;html class=&quot;no-js ie8 ie&quot; lang=&quot;en&quot;&amp;gt; &amp;lt;![endif]--&amp;gt;
&amp;lt;!--[if (gte IE 9)|!(IE)]&amp;gt;&amp;lt;!--&amp;gt; &amp;lt;html class=&quot;no-js&quot; lang=&quot;en&quot;&amp;gt; &amp;lt;!--&amp;lt;![endif]--&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;meta charset=&quot;utf-8&quot;&amp;gt;
  &amp;lt;script src=&quot;../../../js/libs/modernizr-2.0.6-min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/pre&gt;
Also, notice I&apos;ve included Modernizr. I make use of Modernizr on pretty much every project I work on. It allows me to feature detect with javascript and I can make some pretty cool fallbacks with that.
&lt;p&gt;Once we&apos;ve got that set up we can easily start fixing up IE.&lt;/p&gt;
&lt;h3&gt;IE specific CSS&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;.ie input{line-height: 35px;}
.ie input[type=&quot;email&quot;]{color: #2F82C2;}
.ie input[type=&quot;password&quot;]{color: #ED1C70;}
.ie label{right: 10px;}
&lt;p&gt;.ie input[type=&quot;email&quot;]:focus, .ie input[type=&quot;password&quot;]:focus{
background:transparent;
-ms-filter:&quot;progid:DXImageTransform.Microsoft.gradient(startColorstr=#80ffffff,endColorstr=#80ffffff)&quot;;
zoom: 1;
}
.ie7 label, .ie6 label{display: none;}&lt;/code&gt;&lt;/pre&gt;
The &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt; just makes things work in IE. Nothing special really. The weird -ms-filter is to add opacity to the background in IE.&lt;/p&gt;
&lt;h3&gt;Placeholder functionality fallback - jQuery with Modernizr&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;if(!Modernizr.input.placeholder) {
    $(&quot;input[placeholder]&quot;).each(function() {
        var placeholder = $(this).attr(&quot;placeholder&quot;);
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;    $(this).val(placeholder).focus(function() {
        if($(this).val() == placeholder) {
            $(this).val(&quot;&quot;)
        }
    }).blur(function() {
        if($(this).val() == &quot;&quot;) {
            $(this).val(placeholder)
        }
    });
});&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;}&lt;/code&gt;&lt;/pre&gt;
This little snippet does the following:&lt;/p&gt;
&lt;ol&gt;
 	&lt;li&gt;Detects for the placeholder attribute support. If no support is found, it continues&lt;/li&gt;
 	&lt;li&gt;It then looks for all input elements with the placeholder attribute&lt;/li&gt;
 	&lt;li&gt;It then takes the placeholder value and puts that within the &apos;value&apos; attribute&lt;/li&gt;
 	&lt;li&gt;When focus is given to the element the value is set to none&lt;/li&gt;
 	&lt;li&gt;When blurred, if the value attribute isn&apos;t nothing, it leaves the text alone&lt;/li&gt;
 	&lt;li&gt;If the value attribute is nothing, it replaces it with the placeholder text again&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Foreseeable problems&lt;/h2&gt;
&lt;blockquote&gt;The user can&apos;t see the text if the input is full of characters.&lt;/blockquote&gt;
True story, but the opacity of the label is so low that it doesn&apos;t really interfere with the readability of the text itself. A way around this would be to add padding-right which covers the length of the label. The only downside to this would be the input field having to be very long.
&lt;p&gt;In general I think this is fine, but if you&apos;re very worried about this, I&apos;d say add &lt;code&gt;padding-right&lt;/code&gt; to the label and use icons instead of text. This will save a lot of space.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
I think it&apos;s a pretty solid technique that will leave your website visitors — or me at least — happier and less confused while logging in.</content:encoded></item><item><title><![CDATA[Master the jQuery for each loop]]></title><description><![CDATA[The above example is selecting all <li> elements and looping over them. It is then adding a class of 'item-' with its index value appended…]]></description><link>https://css-plus.com/2011/09/master-the-jquery-for-each-loop</link><guid isPermaLink="false">https://css-plus.com/2011/09/master-the-jquery-for-each-loop</guid><pubDate>Mon, 05 Sep 2011 00:00:00 GMT</pubDate><content:encoded>&lt;p class=&quot;clearfix&quot;&gt;The &lt;strong&gt;jQuery for each loop&lt;/strong&gt; can be very powerful. It is used just like any other jQuery function such as &lt;a href=&quot;#&quot;&gt;.click()&lt;/a&gt;, &lt;a href=&quot;http://api.jquery.com/hover&quot;&gt;.hover()&lt;/a&gt;, etc. and it accepts a callback. As you know, or have probably guessed, the &lt;em&gt;jQuery&lt;/em&gt; for each function &lt;strong&gt;loops over selected items&lt;/strong&gt; and does whatever you&apos;d like to targetted items.&lt;!--more--&gt;&lt;/p&gt;
You may be asking yourself:
&lt;blockquote&gt;But isn&apos;t that what CSS or jQuery selectors do anyway? What&apos;s the difference?&lt;/blockquote&gt;
&lt;h2&gt;Standard jQuery for .each()&lt;/h2&gt;
Not only does the jQuery for each function loop over each selected element, it also keeps track of the element index within the loop. For example:
&lt;iframe class=&quot;jsfiddle&quot; src=&quot;http://jsfiddle.net/jamygolden/JhpfD/embedded/&quot;&gt;&lt;/iframe&gt;
As you can see in the example, it&apos;s some very basic HTML with some very basic CSS. The jQuery is also relatively simple, I&apos;m pretty sure you would be able to guess what is going on even if I didn&apos;t explain, but I will!
&lt;p&gt;The above example is selecting all &lt;code&gt;&amp;#x3C;li&gt;&lt;/code&gt; elements and looping over them. It is then adding a class of &apos;item-&apos; with its index value appended to it. The index begins at 0.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;$(this)&lt;/code&gt; keyword references each iterated element. This is where .each() becomes very useful.&lt;/p&gt;
&lt;p&gt;I feel that&apos;s a pretty straight forward jQuery for each loop that you should be able to get the hang of pretty quickly if you&apos;re fairly familiar with jQuery.&lt;/p&gt;
&lt;h2&gt;The javascript for loop&lt;/h2&gt;
If you&apos;re still pretty new to jQuery and you&apos;re feeling adventurous, how about throwing in a javascript for loop instead of a jQuery for each loop? &apos;Why&apos; you ask? Well because it is &lt;a href=&quot;http://jsperf.com/javascript-vs-jquery-foreach&quot;&gt;much faster&lt;/a&gt;.
&lt;p&gt;While you won&apos;t notice the difference on small scripts and pages, it could make a difference while looping through many items and even other loops. It&apos;s also never a bad thing to learn some javascsript when you can.&lt;/p&gt;
&lt;iframe class=&quot;jsfiddle&quot; src=&quot;http://jsfiddle.net/jamygolden/dvcaD/1/embedded/&quot;&gt;&lt;/iframe&gt;
Personally I prefer doing this. It certainly isn&apos;t much more complicated than the jQuery version.
&lt;h2&gt;Alright, how is &lt;a href=&quot;http://api.jquery.com/jQuery.each/&quot;&gt;$.each()&lt;/a&gt; any different?&lt;/h2&gt;
If you didn&apos;t already know, there is another jQuery for each function, but it&apos;s not the same as the one we&apos;ve already covered. The $.each() function loops over items in an array or items in an object. I didn&apos;t run into arrays or objects until quite a while after I was comfortable with jQuery, so don&apos;t feel left out if you don&apos;t know what&apos;s going on. I suggest having a look at the &lt;a href=&quot;http://jqfundamentals.com/&quot;&gt;jQuery fundamentals&lt;/a&gt; page. It covers basic javascript and helps you use jQuery to it&apos;s full potential.
&lt;p&gt;Back to the point: how would we use $.each()? Without further ado, here&apos;s an example!&lt;/p&gt;
&lt;iframe class=&quot;jsfiddle&quot; style=&quot;width: 100%; height: 300px;&quot; src=&quot;http://jsfiddle.net/jamygolden/rrGmp/1/embedded/&quot;&gt;&lt;/iframe&gt;
In this example I&apos;ve used an object instead of an array, but they both work pretty much the same way. First the object &lt;code&gt;obj&lt;/code&gt; is declared with a couple of random &lt;code&gt;key&lt;/code&gt; and &lt;code&gt;value&lt;/code&gt; values. It is then looped over using the jQuery function. As an example, I&apos;ve appended the values to a div and also used the key as the class of each paragraph.
&lt;h2&gt;Conclusion&lt;/h2&gt;
As you can see, there isn&apos;t much to jQuery or javascript for each loops! Save time and make your life more simple by making use of them!</content:encoded></item><item><title><![CDATA[Create Accordions with CSS3, HTML5 and jQuery]]></title><description><![CDATA[First thing is first, let me clarify what I mean by Create an Accordion with CSS3, HTML5 and jQuery. I am talking about creating 3 different…]]></description><link>https://css-plus.com/2011/08/create-accordions-with-css3-html5-and-jquery</link><guid isPermaLink="false">https://css-plus.com/2011/08/create-accordions-with-css3-html5-and-jquery</guid><pubDate>Mon, 22 Aug 2011 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;First thing is first, let me clarify what I mean by &lt;strong&gt;Create an Accordion with CSS3, HTML5 and jQuery&lt;/strong&gt;. I am talking about creating 3 &lt;em&gt;different&lt;/em&gt; accordions, one which relies heavily on CSS3, one with jQuery and one with HTML5.&lt;/p&gt;
&lt;p&gt;If you haven&apos;t already had to create some sort of accordion by now, I&apos;m sure you will run into it sooner or later. It&apos;s actually a very simple concept that requires very little script to create a fully functional accordion.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;Accordions are typically used to toggle extra information. They help to organize and de-clutter information. You could make use of an accordion to display:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;child pages in a menu&lt;/li&gt;
 	&lt;li&gt;the answers to questions on a FAQ page&lt;/li&gt;
 	&lt;li&gt;Wordpress makes heavy use of accordions in it&apos;s admin-area.&lt;/li&gt;
 	&lt;li&gt;Your imagination is the limit&lt;/li&gt;
&lt;/ul&gt;
Whatever the use, it&apos;s essential to have the ability to create any kind of accordion in your web-dev-brain-toolbox.
&lt;p&gt;First, we&apos;re going to create a basic accordion with &lt;strong&gt;jQuery&lt;/strong&gt;, then an accordion with &lt;strong&gt;CSS3&lt;/strong&gt; and finally an accordion with &lt;strong&gt;HTML5&lt;/strong&gt;. The jQuery version will have excellent browser support while the CSS3 version will have less, and finally the HTML5 version will have the least browser support.&lt;/p&gt;
&lt;p&gt;All right, let&apos;s get started.&lt;/p&gt;
&lt;h2&gt;HTML and basic CSS&lt;/h2&gt;
This is the basic HTML and CSS of the accordion we&apos;ll be working with:
&lt;h3&gt;HTML&lt;/h3&gt;
The layout is pretty basic.
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;div class=&quot;accordion&quot;&amp;gt;
	&amp;lt;h2&amp;gt;Aliquam tincidunt mauris eu risus&amp;lt;/h2&amp;gt;
	&amp;lt;p&amp;gt;lorem ipsum dolor....&amp;lt;/p&amp;gt;
	&amp;lt;h2&amp;gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit&amp;lt;/h2&amp;gt;
	&amp;lt;p&amp;gt;lorem ipsum dolor....&amp;lt;/h2&amp;gt;
	&amp;lt;h2&amp;gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit&amp;lt;/h2&amp;gt;
	&amp;lt;div&amp;gt;
		&amp;lt;p&amp;gt;lorem ipsum dolor....&amp;lt;/p&amp;gt;
		&amp;lt;p&amp;gt;lorem ipsum dolor....&amp;lt;/p&amp;gt;
	&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
The h2 will be the &quot;button&quot; for the accordion. The element that comes directly after that will be the element being toggled by clicking on the previous h2. Any element, meaning it could be an image, a paragraph, a div containing whatever you want. I feel that&apos;s the most efficient way of creating this type of accordion.
&lt;h3&gt;CSS&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;.accordion{border: 1px solid #ddd; border-top: none; margin: 10px 0; width: 470px;}
# accordion &amp;gt; a{display: block; text-decoration: none;}
# accordion &amp;gt; h2, .accordion &amp;gt; a{background-color: #fff; background-image: url(../img/gradient.jpg);
background-image: -moz-linear-gradient(bottom, #f1f1f1, #fff);
background-image: -ms-linear-gradient(bottom, #f1f1f1, #fff);
background-image: -o-linear-gradient(bottom, #f1f1f1, #fff);
background-image: -webkit-linear-gradient(bottom, #f1f1f1, #fff);
background-image: linear-gradient(bottom, #f1f1f1, #fff); border-top: 1px solid #ddd;
color: #222; font: 14px/30px &apos;Verdana&apos;, sans-serif; height: 30px; margin: 0; padding: 0; text-indent: 10px;}
p{color: #555; font: 12px/18px &apos;Verdana&apos;, sans-serif; padding: 20px 10px;}&lt;/code&gt;&lt;/pre&gt;
The CSS is just doing some basic styling. I&apos;ve thrown in some CSS3 gradients with a fallback image because that&apos;s how I roll.
&lt;h3&gt;The jQuery&lt;/h3&gt;
It&apos;s really amazing at how simple jQuery can make our lives. This is all that is required for the accordion:
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;$(&apos;h2.accordion&apos;).click(function(){
    $(this).next().slideToggle();
}).next().hide();&lt;/code&gt;&lt;/pre&gt;
Now if that&apos;s not simple, I don&apos;t know what is.
&lt;p&gt;That&apos;s it. You now have a fully functional jQuery accordion!&lt;/p&gt;
&lt;h2&gt;The CSS3 version&lt;/h2&gt;
The CSS version has some slightly different HTML and 2 new CSS lines.
&lt;h3&gt;The HTML becomes&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;&amp;lt;div class=&quot;accordion&quot;&amp;gt;
	&amp;lt;a href=&quot;#accordion-1&quot;&amp;gt;Aliquam tincidunt mauris eu risus&amp;lt;/a&amp;gt;
	&amp;lt;p id=&quot;accordion-1&quot;&amp;gt;lorem ipsum dolor....&amp;lt;/p&amp;gt;
	&amp;lt;a href=&quot;#accordion-2&quot;&amp;gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit&amp;lt;/h2&amp;gt;
	&amp;lt;p id=&quot;accordion-2&quot;&amp;gt;lorem ipsum dolor....&amp;lt;/h2&amp;gt;
	&amp;lt;a href=&quot;#accordion-3&quot;&amp;gt;Aliquam tincidunt mauris eu risus&amp;lt;/a&amp;gt;
	&amp;lt;div id=&quot;accordion-3&quot;&amp;gt;
		&amp;lt;p&amp;gt;lorem ipsum dolor....&amp;lt;/p&amp;gt;
		&amp;lt;p&amp;gt;lorem ipsum dolor....&amp;lt;/p&amp;gt;
	&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
There are 3 basic changes:
&lt;ul&gt;
 	&lt;li&gt;The &lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt;s have been turned in to anchor links&lt;/li&gt;
 	&lt;li&gt;The hidden contents have been given an id&lt;/li&gt;
 	&lt;li&gt;The anchor links have been given an &lt;code&gt;href&lt;/code&gt; containing the id of the following element with an appended hash&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;The CSS&lt;/h3&gt;
The CSS is the same as before, but with the added lines:
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;a[href^=&quot;#accordion&quot;] + *{display: none;}
# accordion :target{display: block;}&lt;/code&gt;&lt;/pre&gt;
Very basically, the CSS is doing this:
&lt;p&gt;Target all &lt;em&gt;anchor links&lt;/em&gt; that have an &lt;code&gt;href&lt;/code&gt; that begins with &apos;#accordion&apos; and target whatever element comes &lt;strong&gt;directly&lt;/strong&gt; after that.&lt;/p&gt;
&lt;p&gt;As for the &lt;code&gt;#accordion :target&lt;/code&gt; line, that&apos;s saying whatever is target should just display block. Unfortunately we can&apos;t use the transition property over here since we would have to define a set height. Transition doesn&apos;t animate &lt;code&gt;display&lt;/code&gt; or &lt;code&gt;height: auto&lt;/code&gt; so the height can&apos;t be dynamic — or maybe I just haven&apos;t figured that out yet.&lt;/p&gt;
&lt;p&gt;There is a con to using the CSS3 method: The anchor links cause the page to jump to the &lt;code&gt;:target&lt;/code&gt; which is pretty annoying. There are two ways around this that I&apos;ve come up with.&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;code&gt;return false&lt;/code&gt; with javascript&lt;/li&gt;
 	&lt;li&gt;Make sure the page height is too short to have a scrollbar - This will work, but I&apos;m not serious about this one&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;The Javascript - Remove page jump&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;$(&apos;#accordion a&apos;).click(function(){
	return false;
});&lt;/code&gt;&lt;/pre&gt;
Return false just tells the HTML not react with it&apos;s normal behaviour.
&lt;h2&gt;The HTML5 method&lt;/h2&gt;
I think this is the most semantic way of doing this and it has a pretty decent fallback (Same fallback as the jQuery version). If the sliding functionality isn&apos;t 100% essential, this is a pretty cool way of doing it. Currently only webkit (Chrome and Safari) support this.
&lt;h3&gt;The HTML&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;div id=&quot;accordion-html5&quot; class=&quot;accordion&quot;&amp;gt;
	&amp;lt;details&amp;gt;
	  &amp;lt;summary&amp;gt;&amp;lt;h2&amp;gt;Vestibulum auctor dapibus neque&amp;lt;/h2&amp;gt;&amp;lt;/summary&amp;gt;
	  &amp;lt;p&amp;gt;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum.sis luctus, metus&amp;lt;/p&amp;gt;
	&amp;lt;/details&amp;gt;
	&amp;lt;details&amp;gt;
	  &amp;lt;summary&amp;gt;&amp;lt;h2&amp;gt;Vestibulum auctor dapibus neque&amp;lt;/h2&amp;gt;&amp;lt;/summary&amp;gt;
	  &amp;lt;p&amp;gt;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum.sis luctus, metus&amp;lt;/p&amp;gt;
	&amp;lt;/details&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;The CSS&lt;/h3&gt;
By default the browser adds a little arrow next to &amp;lt;summary&amp;gt;. I didn&apos;t want this so I&apos;ve turned it off:
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;details summary::-webkit-details-marker{display: none;}&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
The jQuery method is definitely the most cross-browser-friendly by far, but I think the HTML5 way may because used more and more as the browsers progress.
Regardless of the CSS3 methods&apos; cross-browser issues, it doesn&apos;t really work well enough for us to use in production without the added bit of javascript so I think it&apos;s best to use one of the other two methods.</content:encoded></item><item><title><![CDATA[jQuery if / else statements]]></title><description><![CDATA[There is no such thing as a jQuery if / else statement. Shocking, isn't it? You might be thinking something like: "There must be! In fact, I…]]></description><link>https://css-plus.com/2011/07/jquery-if-else-statements</link><guid isPermaLink="false">https://css-plus.com/2011/07/jquery-if-else-statements</guid><pubDate>Tue, 26 Jul 2011 00:00:00 GMT</pubDate><content:encoded>&lt;!-- todo --&gt;
&lt;!-- internal links --&gt;
&lt;div class=&quot;notice notice--warning&quot;&gt;This article is intentionally titled and optimised to help people who are googling for the wrong phrase. This is why &quot;jQuery if statement&quot; appaers often.&lt;/div&gt;
&lt;p&gt;There is &lt;strong&gt;no such thing as a jQuery if / else statement&lt;/strong&gt;. Shocking, isn&apos;t it? You might be thinking something like: &quot;&lt;em&gt;There must be! In fact, I&apos;m 99% sure there is!&lt;/em&gt;&quot;.&lt;/p&gt;
&lt;p&gt;It doesn&apos;t exist. This is because &lt;em&gt;jQuery is JavaScript&lt;/em&gt;. What you&apos;re looking for is a &lt;em&gt;JavaScript if/else statement&lt;/em&gt; otherwise known as a &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else&quot;&gt;JavaScript conditional statement&lt;/a&gt;.&lt;/p&gt;
&lt;!--more--&gt;
&lt;h2&gt;Why I decided to write about jQuery if&lt;/h2&gt;
&lt;p&gt;This article exists because when I started out with jQuery, I looked &lt;em&gt;everywhere&lt;/em&gt; for a &apos;&lt;strong&gt;jQuery if / else statement&lt;/strong&gt;&apos;. It blew my mind that something as important as an if statement didn&apos;t exist on the web. It took me a while to realize that I couldn&apos;t find it because I was looking in the wrong place. It was because of this &lt;del&gt;giant journey&lt;/del&gt; &lt;ins&gt;problem&lt;/ins&gt; I decided to write an article for anyone following a similar path.&lt;/p&gt;
&lt;h2&gt;looking for useful jQuery tutorials?&lt;/h2&gt;
&lt;p&gt;Before I go on, if you&apos;re looking for some pretty useful jQuery tutorials, have a look at&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://css-plus.com/2010/03/fading-navigation-menu/&quot;&gt;How to create a jQuery Fading Navigation Menu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://css-plus.com/2010/04/how-to-create-a-fading-border-gallery-with-opacity-focus/&quot;&gt;How to create a jQuery Fading Border gallery with Opacity Focus&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://css-plus.com/2010/09/create-your-own-jquery-image-slider/&quot;&gt;How to create your own jQuery image slider&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What is jQuery?&lt;/h2&gt;
&lt;p&gt;jQuery is a one of many javascript libraries. Very simply, these libraries are shortcuts created by &lt;a href=&quot;https://johnresig.com/&quot;&gt;people with crazy javascript skills&lt;/a&gt; for people like you and I. You could look at these libraries as one giant javascript plugin which make writing javascript 100 times more simple.&lt;/p&gt;
&lt;p&gt;jQuery syntax &lt;em&gt;is&lt;/em&gt; javascript, and therefore a lot of the things you do in jQuery are pretty much the same in plain ol&apos; javascript. &apos;&lt;strong&gt;jQuery if&lt;/strong&gt; statements&apos; are written the same way as javascript if statements, since it IS javascript.&lt;/p&gt;
&lt;h2&gt;The basic syntax&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;condition&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// code to be executed if condition is true&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// code to be executed if condition is false&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The JavaScript (jQuery) if / else statement is almost identical to the PHP if / else statement.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;php&quot;&gt;&lt;pre class=&quot;language-php&quot;&gt;&lt;code class=&quot;language-php&quot;&gt;&lt;span class=&quot;token variable&quot;&gt;$a&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token variable&quot;&gt;$b&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$a&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;token keyword&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string double-quoted-string&quot;&gt;&quot;&amp;lt;p&gt;A is larger than B&amp;lt;/p&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;elseif&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$a&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$b&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;token keyword&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string double-quoted-string&quot;&gt;&quot;&amp;lt;p&gt;A is equal to B&amp;lt;/p&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;token keyword&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string double-quoted-string&quot;&gt;&quot;&amp;lt;p&gt;B is larger than A&amp;lt;/p&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And the JavaScript (jQuery) if / else version is:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; a &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    b &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;a &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; b&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;body&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&amp;lt;p&gt;A is larger than B&amp;lt;/p&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;a &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; b&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;body&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&amp;lt;p&gt;A is equal to B&amp;lt;/p&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;body&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&amp;lt;p&gt;B is larger than A&amp;lt;/p&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note: The jQuery function html() is not equal to echo.&lt;/p&gt;
&lt;h2&gt;Explanation of another example if statement&lt;/h2&gt;
&lt;h3&gt;HTML&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;example&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;jQuery/javascript&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; n &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#example div&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;length&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;n &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;body&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;background&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;green&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;body&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;background&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;orange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Very basically the above is saying: Count the amount of div&apos;s within the ID #example, and if it is less than 2, change the body&apos;s background colour to green, otherwise change the background colour to orange.&lt;/p&gt;
&lt;p&gt;What do you think the outcome would be?&lt;/p&gt;
&lt;p&gt;If you guessed orange... Then you would be right.&lt;/p&gt;
&lt;h2&gt;Javascript shorthand conditional statement&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; n &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#example div&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;length&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;body&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;background&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; n &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;green&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;orange&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now that is pretty handy! Creating a javascript if statement couldn&apos;t be more simple.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;What is a &apos;jQuery if statement&apos;? It is a &apos;JavaScript conditional statement&apos; that happens to contain some jQuery.&lt;/p&gt;
&lt;!-- consider bringing comments in, they help strengthen the reason for the article --&gt;</content:encoded></item><item><title><![CDATA[Behold the CSS Lightsaber]]></title><description><![CDATA[Note: Check out the demo before reading. I've been working on CSS lightsabers lately. I remember seeing one a while back and liking the…]]></description><link>https://css-plus.com/2011/07/behold-the-css-lightsaber</link><guid isPermaLink="false">https://css-plus.com/2011/07/behold-the-css-lightsaber</guid><pubDate>Fri, 22 Jul 2011 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Note: &lt;a href=&quot;http://css-plus.com/examples/2011/06/css-lightsabers/&quot;&gt;Check out the demo&lt;/a&gt; before reading. I&apos;ve been working on &lt;strong&gt;CSS lightsabers&lt;/strong&gt; lately. I remember seeing &lt;a href=&quot;http://www.thedesigngnome.com/2010/06/how-to-build-a-lightsaber-with-css/&quot;&gt;one&lt;/a&gt; a while back and liking the concept, however I thought it could be greatly improved. I&apos;ve also been itching to create &lt;strong&gt;animation out of CSS transitions&lt;/strong&gt;. By &quot;animation&quot; I mean one event followed by another event. Transitions can mimic full blown animation by transitioning multiple elements at the same time with different delays. This gives the effect of an element being animated. Very simply they all occur simultaneously, but the initial delay make the events appear to follow each other.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;The sabers were both very carefully crafted with CSS alone. With Yoda&apos;s saber I focused on having different options. &lt;em&gt;Switch on&lt;/em&gt;, &lt;em&gt;increase power&lt;/em&gt; and &lt;em&gt;increase length&lt;/em&gt;. It was a bit of a work around to get the options to work with each other since only one transition can occur on an element at any given time. This would mean that in order to keep the Saber on, decrease power and decrease length is == to power up.&lt;/p&gt;
&lt;p&gt;I&apos;m pretty sure people will mention that some of this could be done with the CSS keyframe animations. Yes, it can and should, however, I started this a couple of weeks back (Firefox5 was only released yesterday with support for the CSS property) and I don&apos;t really like working in Webkit.&lt;/p&gt;
&lt;h2&gt;Firefox loves lightsabers&lt;/h2&gt;
This demo looks best in Firefox by far. Everything is rendered absolutely perfectly. In other browsers? Not so much.
&lt;h3&gt;Chrome&lt;/h3&gt;
The demo doesn&apos;t work as it should in Chrome and there were two main problems with this demo. The &lt;code&gt;transition&lt;/code&gt; can be applied to pseudo elements. I started of animating pseudo elements all over the place, but I stopped because I wanted Webkit to at least partially support the demo. Also, Webkit doesn&apos;t seem to handle transitions very well yet. Have a look yourself. Go to the demo: Click on &quot;Higher&quot;, then on &quot;Longer&quot;. It refuses to do the transition. It seems like Webkit has a problem when going from one transition into another. In order to get it to work you have to use a transition, clear it and then fire off another transition. In comparison to Firefox, the shadows look a bit... Hard.
&lt;h3&gt;Opera&lt;/h3&gt;
Opera has a different set of issues. It animates (along with a few rendering bugs here and there) from transition to transition, however, a transition on the &lt;code&gt;box-shadow&lt;/code&gt; property doesn&apos;t seem to take.
&lt;h3&gt;IE10&lt;/h3&gt;
I haven&apos;t tested this yet. If you have IE10 and you test it, let me know what the problems were.
&lt;h2&gt;That&apos;s about it&lt;/h2&gt;
This took me a fair amount of time to complete and iron out the major bugs. Let me know if you have any questions and what you think.
&lt;!-- DEMO css-lightsabers --&gt;</content:encoded></item><item><title><![CDATA[CSS-Plus V2]]></title><description><![CDATA[If you haven't noticed the new design, you're either new to CSS-Plus or you have hit ctrl / cmd + r in a while. I've been talking about a…]]></description><link>https://css-plus.com/2011/06/css-plus-v2</link><guid isPermaLink="false">https://css-plus.com/2011/06/css-plus-v2</guid><pubDate>Fri, 17 Jun 2011 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If you haven&apos;t noticed the new design, you&apos;re either new to CSS-Plus or you have hit &lt;kbd&gt;ctrl / cmd + r&lt;/kbd&gt; in a while. I&apos;ve been talking about a redesign for longer than I&apos;d like but it&apos;s finally here, however it&apos;s not 100% complete yet. You may notice that things look a little funky here and there, but don&apos;t worry, I&apos;m working on it! It should be complete within this week.&lt;/p&gt;
&lt;!--more--&gt;
&lt;h2&gt;What&apos;s new?&lt;/h2&gt;
In general the font is larger, the headings are larger, the website is fluid (Or will be once I&apos;m done). My main objective was the make the the website easier to read, easier to navigate and more enjoyable to be on.
&lt;h3&gt;Colour palette&lt;/h3&gt;
I&apos;ve decided to go largely with the blue and pink. The colour palette consists of 5 colours: Orange, pink, light-blue, navy blue and grey. I&apos;ve decided to go with a very light template compared to the previous one. I feel it&apos;s much easier to read and more enjoyable to be on a lighter website. Darker colour palettes can work, but I don&apos;t feel they really work on blogs.
&lt;h3&gt;The logo&lt;/h3&gt;
&lt;img src=&quot;http://css-plus.com/wp-content/uploads/2011/06/plus-logo.png&quot; alt=&quot;CSS-Plus Logo&quot; title=&quot;plus-logo&quot; width=&quot;59&quot; height=&quot;48&quot; class=&quot;alignright size-full wp-image-1032&quot;&gt;After messing around with many types of logos, I noticed that the &apos;P&apos; in CSS-Plus could contain a plus symbol if I were to extend it a bit. I think it looks pretty cool. Other than that, the font used was &apos;&lt;a href=&quot;http://www.google.com/webfonts/family?family=Cantarell&amp;amp;subset=latin&quot;&gt;Cantarell&lt;/a&gt;&apos;.
&lt;h3&gt;Where did the tags go?&lt;/h3&gt;
The tags are still there, I&apos;ve just removed all links to them. Ultimately I&apos;m going to remove them completely because I don&apos;t really think they serve a real purpose. The analytics agreed with me.
&lt;h3&gt;Navigation and Sidebar&lt;/h3&gt;
I&apos;ve realized that it&apos;s been a bit tough to navigate the site easily.
&lt;p&gt;The sidebar now includes most popular articles, the latest articles and my latest plugins — I plan on making a handful of very useful jQuery plugins.&lt;/p&gt;
&lt;h3&gt;Search here...&lt;/h3&gt;
I&apos;ve always had a search bar but it was barely used. Also, the results page was pretty nasty... Perhaps that&apos;s the reason it wasn&apos;t used all that much? Anyway, I&apos;ve implemented the new GSE code and the results are much easier on the eye.
&lt;h3&gt;Article Thumbnails&lt;/h3&gt;
I&apos;ve started using the Wordpress thumbnail feature. I think it makes everything much more interesting to look at. At largest they are 180x180 images with a border, drop shadow and inner shadow. The more CSS I used, the more control I have over everything.
&lt;h3&gt;Pretty comments&lt;/h3&gt;
I quite like the new comments. I&apos;ve made them much more orderly, easier and more enjoyable to read.
&lt;h3&gt;The footer&lt;/h3&gt;
The footer is largely the same. I&apos;ve replaced the latest tweet area with my delicious links. I think they are much more useful than what I&apos;ve said last on twitter.
&lt;h3&gt;Social&lt;/h3&gt;
The latest additions to the social family has been the Google +1 button and a link to my Github account. Why +1? Because I think Google is absolutely awesome.
&lt;h2&gt;Images and javasript has been avoided&lt;/h2&gt;
I haven&apos;t avoided images as &lt;em&gt;much&lt;/em&gt; as possible, but I have tended towards avoiding them. They aren&apos;t necessary (Excluding fallback images) and it&apos;s fun making everything as semantic as possible. As for javascript, it&apos;s overkill for something that CSS can easily and semantically do, such as the hover effect in the footer.
&lt;h2&gt;Suggestions?&lt;/h2&gt;
Let me know if you have any suggestions.</content:encoded></item><item><title><![CDATA[Prevent :last-child from slowing you down]]></title><description><![CDATA[:first-child is a CSS selector that has been around since the CSS 2.1 spec. It is extremely useful and can be used effectively in various…]]></description><link>https://css-plus.com/2011/05/prevent-last-child-from-slowing-you-down</link><guid isPermaLink="false">https://css-plus.com/2011/05/prevent-last-child-from-slowing-you-down</guid><pubDate>Sun, 29 May 2011 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;code&gt;:first-child&lt;/code&gt; is a &lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; selector that has been around since the &lt;a href=&quot;http://www.w3.org/TR/CSS2/selector.html#pattern-matching&quot;&gt;&lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; 2.1&lt;/a&gt; &lt;abbr title=&quot;specification&quot;&gt;spec&lt;/abbr&gt;. It is extremely useful and can be used effectively in various ways.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;:last-child&lt;/code&gt; has finally made an appearance in &lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; 3. One would think that selectors such as first and last child are pretty much the same and would be implemented at the same time. This is not the case and they have pretty big performance differences.&lt;/p&gt;
&lt;!--more--&gt;
&lt;h2&gt;Why isn&apos;t :last-child included within CSS2?&lt;/h2&gt;
Jonathan Snook has an extremely informative article called &lt;a href=&quot;http://snook.ca/archives/html_and_css/css-parent-selectors&quot;&gt;Why we don&apos;t have a parent selector&lt;/a&gt;. It is an interesting &amp;amp; in depth article that covers why &lt;code&gt;:last-child&lt;/code&gt; is is so difficult for the browser to render and the article also has examples of &lt;code&gt;:first-child&lt;/code&gt; &lt;abbr title=&quot;Versus&quot;&gt;vs&lt;/abbr&gt; &lt;code&gt;:last-child&lt;/code&gt;.
&lt;p&gt;Simply put, &lt;code&gt;:last-child&lt;/code&gt; only functions correctly once the &lt;em&gt;entire page has loaded&lt;/em&gt;. The way &lt;code&gt;:last-child&lt;/code&gt; is rendered while the page is busy loading is executed differently throughout the different browsers.&lt;/p&gt;
&lt;h2&gt;Never use :last-child&lt;/h2&gt;
I feel that &lt;code&gt;last-child&lt;/code&gt; is not necessary in most cases. I say most cases to cover myself but I haven&apos;t run into a situation where it&apos;s a necessity. The only times I find I need first/last-child is when I&apos;m styling some sort of list.
&lt;p&gt;A typical example would be: &lt;code&gt;padding-right&lt;/code&gt; and/or &lt;code&gt;border-right&lt;/code&gt; applied to a navigation&apos;s list items.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;#nav li{border-right: 1px solid black; padding-right: 20px;}&lt;/code&gt;&lt;/pre&gt;
&lt;img class=&quot;aligncenter size-full wp-image-831&quot; title=&quot;border-right&quot; src=&quot;http://css-plus.com/wp-content/uploads/2011/03/border-right.png&quot; alt=&quot;&quot; width=&quot;400&quot; height=&quot;77&quot;&gt;
The padding and border isn&apos;t ideal on the last &amp;lt;li&amp;gt; element. This is what we want:
&lt;img class=&quot;aligncenter size-full wp-image-834&quot; title=&quot;nav&quot; src=&quot;http://css-plus.com/wp-content/uploads/2011/03/nav.png&quot; alt=&quot;&quot; width=&quot;400&quot; height=&quot;77&quot;&gt;
It&apos;s pretty simple to solve with :last-child
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;#nav li:last-child{border-right: 0; padding-right: 0;}&lt;/code&gt;&lt;/pre&gt;
This, however, won&apos;t even work on &lt;abbr title=&quot;Less Than or Equal to&quot;&gt;LTE&lt;/abbr&gt; &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;8.
&lt;h2&gt;Use :first-child instead&lt;/h2&gt;
&lt;code&gt;:first-child&lt;/code&gt; is contained within the CSS2.1 spec and therefore is supported within &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;8 and has buggy support within &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;7. It would be a &lt;em&gt;FAR&lt;/em&gt; better idea to make use of this.
&lt;p&gt;Swap the properties around — Instead of border/padding &lt;em&gt;right&lt;/em&gt;, set it to border/padding &lt;em&gt;left&lt;/em&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;#nav li{border-left: 1px solid black; padding-left: 20px;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The menu example would look something like this:
&lt;img class=&quot;aligncenter size-full wp-image-832&quot; title=&quot;border-left&quot; src=&quot;http://css-plus.com/wp-content/uploads/2011/03/border-left.png&quot; alt=&quot;&quot; width=&quot;400&quot; height=&quot;77&quot;&gt;
You can solve this problem very easily without &lt;code&gt;:last-child&lt;/code&gt; &lt;em&gt;and&lt;/em&gt; have it supported by &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;7(buggy) and 8.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;#nav li:first-child{border-left: 0; padding-left: 0;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&apos;s very easy to convert your &lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; into very efficient and cross browser friendly &lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; — All you need to do is &lt;em&gt;think about what it is you are trying to doing&lt;/em&gt; and imagine how else it could be achieved.&lt;/p&gt;
&lt;h2&gt;I wish it worked properly in &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;7&lt;/h2&gt;
What is the deal with &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;7 and &lt;code&gt;:first-child&lt;/code&gt;? Very basically, IE7 will see a comment as the first child. In &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;7 &lt;code&gt;li:first-child&lt;/code&gt; would not work on the following html:
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;&amp;lt;ul&amp;gt;
	&amp;lt;!-- This is a comment --&amp;gt;
	&amp;lt;li&amp;gt;One&amp;lt;/li&amp;gt;
	&amp;lt;li&amp;gt;One&amp;lt;/li&amp;gt;
	&amp;lt;li&amp;gt;One&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;
Now that we&apos;ve established that things can be done more efficiently and in a cross-browser friendly fashion without too much difficulty, would it be possible to make &lt;code&gt;:first-child&lt;/code&gt; function properly within &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;7 even if there are html comments throughout the html?
&lt;p&gt;Your first thought might be:&lt;/p&gt;
&lt;blockquote&gt;No, it&apos;s the way IE7 renders HTML. Let&apos;s move on&lt;cite&gt;Your first thought&lt;/cite&gt;&lt;/blockquote&gt;
What selectors &lt;em&gt;do&lt;/em&gt; IE7 support that are more reliable and could solve this simple problem? &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;7 supports &lt;strong&gt;adjacent selectors&lt;/strong&gt;. I really love adjacent selectors and I think it is very under-rated. Chris Coyier has an article which explains &lt;a href=&quot;http://css-tricks.com/child-and-sibling-selectors/&quot;&gt;adjacent selectors&lt;/a&gt; and other selectors too.
&lt;p&gt;Basically, an adjacent selector selects the element that directly follows the targeted element. For example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;p + p{background: red}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This would select any paragraph element that has a preceding paragraph element. This would mean that the &lt;em&gt;first paragraph&lt;/em&gt; element &lt;em&gt;would not be selected&lt;/em&gt; because it does not contain any preceding paragraph element.&lt;/p&gt;
&lt;h2&gt;Pseudo-select via Non-selection&lt;/h2&gt;
By this I mean that you could add a left border to every list item except the first. This could create the illusion of &lt;code&gt;:first-child&lt;/code&gt;.
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;li + li{border-left: 1px solid black; padding-left: 20px}&lt;/code&gt;&lt;/pre&gt;
This probably isn&apos;t as efficient as &lt;code&gt;:first-child&lt;/code&gt;, but it does add to the cross-browser compatibility and it can be of great use in many cases.</content:encoded></item><item><title><![CDATA[PlusAnchor jQuery Plugin]]></title><description><![CDATA[PlusAnchor is a jQuery plugin I've just created. At the moment it solves a simple and specific problem: Anchor links cause the browser…]]></description><link>https://css-plus.com/2011/05/plusanchor-jquery-plugin</link><guid isPermaLink="false">https://css-plus.com/2011/05/plusanchor-jquery-plugin</guid><pubDate>Tue, 17 May 2011 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;PlusAnchor is a jQuery plugin I&apos;ve just created. At the moment it solves a simple and specific problem: Anchor links cause the browser scroll to the destination instead of merely jumping there.&lt;/p&gt;
&lt;!--more--&gt;
&lt;h2&gt;How does it work?&lt;/h2&gt;
It&apos;s very simple, all you need to do is link to the jQuery plugin and activate it by pasting this in your &amp;lt;head&amp;gt; section:
&lt;pre&gt;&lt;code&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.plusanchor.1.0.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
$(document).ready(function(){
	$(document).plusAnchor();
});
&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;That&apos;s it&lt;/h2&gt;
It&apos;s a set and forget type of plugin. I&apos;ve got a bunch of extra functionality I&apos;m thinking of building in, but nothing worth talking about yet.
If you have any suggestions, comments or if you find any problems let me know.
&lt;p&gt;&lt;a href=&quot;https://github.com/JamyGolden/PlusAnchor/&quot;&gt;Download&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[IE and rounded corners]]></title><description><![CDATA[Note: The original post was published March 19 2010. The original article's CSS3 emulator of choice was CurvyCorners When someone uses the…]]></description><link>https://css-plus.com/2011/05/ie-and-rounded-corners</link><guid isPermaLink="false">https://css-plus.com/2011/05/ie-and-rounded-corners</guid><pubDate>Mon, 16 May 2011 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: The original post was published March 19 2010. The original article&apos;s CSS3 emulator of choice was &lt;a href=&quot;http://www.curvycorners.net/&quot;&gt;CurvyCorners&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When someone uses the words &quot;rounded corners&quot; and &quot;&lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;&quot; in the same paragraph, rest assured a puppy has died somewhere.&lt;/p&gt;
&lt;p&gt;There are a few ways to achieve rounded corners in &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;, unfortunately none of them are pain free. I usually like to use rounded corners as progressive enhancement, so &lt;abbr title=&quot;Internet Explorer 8&quot;&gt;IE8&lt;/abbr&gt; and lower just have to deal with square corners. Luckily, &lt;abbr title=&quot;Internet Explorer 9&quot;&gt;IE9&lt;/abbr&gt; has been released and it supports the &lt;a href=&quot;http://www.css3.info/preview/rounded-border/&quot;&gt;&lt;code&gt;border-radius&lt;/code&gt;&lt;/a&gt; CSS property. &lt;a href=&quot;http://ie.microsoft.com/testdrive/info/downloads/default.html&quot;&gt;IE10 is already on the way&lt;/a&gt; and it should be released sometime at the end of this year. Go Microsoft.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;There are two methods I would use to round &lt;abbr title=&quot;Less than or equal to&quot;&gt;lte&lt;/abbr&gt;&lt;abbr title=&quot;Internet Explorer 8&quot;&gt;IE8&lt;/abbr&gt; corners.&lt;/p&gt;
&lt;h2&gt;CSS3 PIE&lt;/h2&gt;
&lt;a href=&quot;http://css3pie.com/&quot;&gt;CSS3 &lt;abbr title=&quot;Progressive Internet Explorer&quot;&gt;PIE&lt;/abbr&gt;&lt;/a&gt; stands for CSS3 Progressive Internet Explorer. It aims to emulate CSS3 properties such as &lt;code&gt;border-radius&lt;/code&gt;, &lt;code&gt;box-shadow&lt;/code&gt;, etc. within &lt;abbr title=&quot;Internet Explorer&quot;&gt;IE&lt;/abbr&gt;6, 7 and 8. It&apos;s currently at version 1.0 beta 4.
&lt;h3&gt;The Pro&apos;s&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Very simple once you get it working&lt;/li&gt;
&lt;li&gt;It rounds corners nicely, unlike other CSS3 emulators&lt;/li&gt;
&lt;li&gt;Extremely flexible - The &lt;code&gt;border-radius&lt;/code&gt;, &lt;code&gt;background&lt;/code&gt; and &lt;code&gt;border&lt;/code&gt; properties can be changed at will and the corners will round perfectly&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;The Con&apos;s&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I &lt;em&gt;always&lt;/em&gt; seem to run into problems while trying to get it to work&lt;/li&gt;
&lt;li&gt;There are random inconsistencies which annoy me - They are too weird to even explain properly, but I&apos;ll give it a try: The corners would only round if I target two different elements. If one was removed, the corners would be square for the other - This has only happened to me once. It&apos;s this kind of &quot;illogical&quot; inconsistency which frustrates me.&lt;/li&gt;
&lt;li&gt;Rounded objects have to have the &lt;code&gt;position: relative&lt;/code&gt; property and value attached to it&lt;/li&gt;
&lt;li&gt;I don&apos;t know what it&apos;s doing in the background&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;CSS3 PIE Conclusion&lt;/h3&gt;
You can count on CSS3 PIE to round something big and singular like the sidebar, but don&apos;t expect it to round something like 100&apos;s of little buttons. I always feel a tiny bit upset when I think of CSS3 PIE and I know there will be a bit of wrestling to get it to work, but it&apos;s definitely the best CSS3 emulating plugin out there. They are working on it constantly so my list of cons can only decrease.
&lt;h3&gt;CSS3 PIE Implementation Instructions&lt;/h3&gt;
Make sure you &lt;a href=&quot;http://css3pie.com/documentation/getting-started/&quot;&gt;read the instructions&lt;/a&gt; very well.
&lt;h2&gt;My Rock Solid Method&lt;/h2&gt;
I use this method as a last resort. This means, the client is complaining about the square corners in IE and CSS3 PIE has failed me.
&lt;p&gt;This method is pretty &lt;strong&gt;rock solid&lt;/strong&gt;. Very basically I place little images in each corner to give the container the effect of rounded corners. In my opinion this is the &lt;em&gt;best&lt;/em&gt; of the &lt;em&gt;old methods&lt;/em&gt; and you can use technologies such as javascript to make it relatively painless. I&apos;ve always found this method to be pretty limiting since the rounded corner images only &quot;work&quot; on containers of the same colour. While daydreaming one day, I realized I could invert the way I do this. By &apos;this&apos; I mean create a transparent .png that &apos;contains&apos; the outside of the element. Let me show you what I mean. This is the what a general image could look like this:&lt;img src=&quot;http://css-plus.com/wp-content/uploads/2011/05/pattern1.gif&quot; alt=&quot;&quot; title=&quot;pattern1&quot; width=&quot;70&quot; height=&quot;70&quot; class=&quot;aligncenter size-full wp-image-902&quot;&gt;As you can see, that would limit you to a red background. Very specific. Imagine the same thing, but without the red. It would create the exact same effect, but it would work on a background of any colour:&lt;img src=&quot;http://css-plus.com/wp-content/uploads/2011/05/transparent-inside.gif&quot; alt=&quot;&quot; title=&quot;transparent-inside&quot; width=&quot;70&quot; height=&quot;70&quot; class=&quot;aligncenter size-full wp-image-914&quot;&gt;The only downside with this is you have to make use of a transparent .png file, so a pngfix has to be used for IE6. (I&apos;ve stopped supporting IE6, so this doesn&apos;t effect me).&lt;/p&gt;
&lt;h3&gt;The Pro&apos;s&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Pretty rock solid&lt;/li&gt;
&lt;li&gt;Easy to fix problems since it&apos;s easy to understand exactly what is going on&lt;/li&gt;
&lt;li&gt;Images are only loaded for IE6, 7 and 8&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;The Con&apos;s&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Not very flexible - New images must be created for different border-radii and to incorporate borders.&lt;/li&gt;
&lt;li&gt;Requires the .png fix plugin for IE6&lt;/li&gt;
&lt;li&gt;Uses images&lt;/li&gt;
&lt;li&gt;Relies on javascript&lt;/li&gt;
&lt;li&gt;Rounded objects have to have the &lt;code&gt;position: relative&lt;/code&gt; property and value attached to it&lt;/li&gt;
&lt;li&gt;New image required for different sized border-radius&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Rock Solid Method Conclusion&lt;/h3&gt;
Images are used with this method, therefore it becomes pretty limiting. It is, however, very reliable which can end up saving you time and a lot of potential headaches.
&lt;h3&gt;Rock Solid Method Implementation Instructions&lt;/h3&gt;
The two most notable things my &lt;abbr title=&quot;Rock Solid Method&quot;&gt;RSM&lt;/abbr&gt; requires is javascript and a sprite.
&lt;p&gt;Firstly let&apos;s create the sprite.&lt;img src=&quot;http://css-plus.com/wp-content/uploads/2011/05/sprite.png&quot; alt=&quot;&quot; title=&quot;ie-rounded-corner-sprite&quot; width=&quot;70&quot; height=&quot;70&quot; class=&quot;aligncenter size-full wp-image-918&quot;&gt;Wow, that was quick! Wasn&apos;t it?&lt;/p&gt;
&lt;h4&gt;Next up is the HTML&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;div class=&quot;rounded&quot;&amp;gt;
	&amp;lt;div class=&quot;tl&quot;&amp;gt;&amp;lt;/div&amp;gt;
	&amp;lt;div class=&quot;tr&quot;&amp;gt;&amp;lt;/div&amp;gt;
	&amp;lt;div class=&quot;bl&quot;&amp;gt;&amp;lt;/div&amp;gt;
	&amp;lt;div class=&quot;br&quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;The CSS&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;.rounded{position: relative; -moz-border-radius: 30px; -webkit-border-radius: 30px; border-radius: 30px; }
.tl, .tr, .bl, .br{background-color: transparent; background-image: url(images/rounded-sprite.png); background-repeat: no-repeat; position: absolute;}
.tl, .tr{top: 0;}
.bl, .br{bottom: 0;}
.tl, .bl{left: 0;}
.tr, .br{right: 0;}
.tl{background-position: 0 0;}
.tr{background-position: -10px 0;}
.bl{background-position: 0 -10px;}
.br{background-position: -10px -10px;}&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;And lastly, the jQuery/Javascript&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;!--[if lt IE 9]&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
$(document).ready(function(){
	$(&apos;.rounded&apos;).prepend(&apos;&amp;lt;div class=&quot;tl&quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&quot;tr&quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&quot;bl&quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class=&quot;br&quot;&amp;gt;&amp;lt;/div&amp;gt;&apos;);
});
&amp;lt;/script&amp;gt;
&amp;lt;![endif]--&amp;gt;&lt;/code&gt;&lt;/pre&gt;The javascript automates this process to a certain extent. It will only load in IE browsers less than IE9 due to the HTML conditional statement. This javascript will pick up any class of &lt;code&gt;.rounded&lt;/code&gt; and prepend the HTML for us. Unfortunately, we are still limited to the border-radius size and corner colour.
&lt;p&gt;And that&apos;s it! I haven&apos;t used this with more than one border-radius size or background color, but you can just add classes for that, for example: &lt;code&gt;.rounded-10px-orange{}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Good luck ;)&lt;/p&gt;</content:encoded></item><item><title><![CDATA[May is Maintenance Month 2011]]></title><description><![CDATA[Last year Chris Coyier posted an article titled "May is Maintenance Month". Chris' idea was to rewrite older articles to keep the resource…]]></description><link>https://css-plus.com/2011/05/may-is-maintenance-month-2011</link><guid isPermaLink="false">https://css-plus.com/2011/05/may-is-maintenance-month-2011</guid><pubDate>Tue, 03 May 2011 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Last year Chris Coyier posted an article titled &quot;&lt;a href=&quot;http://css-tricks.com/may-is-maintenance-month/&quot;&gt;May is Maintenance Month&lt;/a&gt;&quot;. Chris&apos; idea was to rewrite older articles to keep the resource (his website) up to date. I didn&apos;t join him in doing so last year — mostly because css-plus was still very new at that point. This year, however, I am supporting the fight against old/outdated articles. I&apos;ll mention that the article was rewritten and also refer to the original date.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Create a lightbox with CSS3]]></title><description><![CDATA[The days of using javascript lightboxes are over! Just kidding,javascript lightboxes remain a much more efficient and cross-browser friendly…]]></description><link>https://css-plus.com/2011/02/create-a-lightbox-with-css3</link><guid isPermaLink="false">https://css-plus.com/2011/02/create-a-lightbox-with-css3</guid><pubDate>Wed, 23 Feb 2011 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The days of using javascript lightboxes are over!&lt;/p&gt;
&lt;p&gt;Just kidding,&lt;strong&gt;javascript lightboxes&lt;/strong&gt; remain a much more efficient and cross-browser friendly way of doing achieving the lightbox effect. This &lt;strong&gt;CSS3 lightbox&lt;/strong&gt; tutorial is for demonstration purposes only. I&apos;m doing this because it&apos;s interesting to see how far you can push &lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; and you end up learning quite a lot. I do at least.&lt;/p&gt;
&lt;!--more--&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;p&gt;The &lt;abbr title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/abbr&gt; isn&apos;t very semantic at all.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;page-wrap&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;lightbox&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;img1&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/beatles.gif&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;920&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;close&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;img2&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/brand-new.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;520&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;close&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;img3&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/the-killers.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;920&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;close&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;ul&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;gallery&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;clearfix&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#img1&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/beatles.gif&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;The Beatles&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;200&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;The Beatles&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;clearfix&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#img2&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/brand-new.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Brand New&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;200&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Brand New&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;clearfix&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#img3&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/the-killers.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;The Killers&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;200&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;The Killers&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you can see, there is quite a lot of markup, some of it even looks — and is — unnecessary, such as &lt;code class=&quot;language-text&quot;&gt;&amp;lt;a class=&quot;close&quot; href=&quot;#&quot;&gt;&amp;lt;/a&gt;&lt;/code&gt; which appears as many times as there are lightbox images.
There are obviously no &quot;for each&quot;, &quot;append&quot; or &quot;prepend&quot; functions in &lt;abbr title=&quot;Hypertext Markup Language&quot;&gt;HTML&lt;/abbr&gt; or &lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; so all of this is done manually. Each gallery image-thumbnail has a corresponding lightbox image. Each lightbox image contains a close button. I&apos;ve also set a width to the gallery images, this forces a width but allows for a dynamic height while keeping the image in proportion.&lt;/p&gt;
&lt;p&gt;The &lt;code class=&quot;language-text&quot;&gt;&amp;lt;span&gt;&lt;/code&gt; elements are going to be used as a caption.&lt;/p&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#page-wrap&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; relative&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 980px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#gallery&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; table&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#gallery li&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px 20px 0 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; relative&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#gallery span&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0.7&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10% 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 100%&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; center&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-transition&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; opacity 0.6s ease-in&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-o-transition&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; opacity 0.6s ease-in&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-transition&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; opacity 0.6s ease-in&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#gallery li:hover span&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#gallery a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 5px solid &lt;span class=&quot;token function&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0.1&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; relative&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-transition&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; border 0.6s ease-out&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-transition&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; border 0.6s ease-out&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;transition&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; border 0.6s ease-out&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#gallery a:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 5px solid &lt;span class=&quot;token function&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;39&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 25&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 1&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 5px solid &lt;span class=&quot;token function&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0.5&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#gallery a:focus&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;-2deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;-2deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;-2deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#gallery img&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#lightbox div&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #fff&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 30px solid #fff&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 6%&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;z-index&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0 40px &lt;span class=&quot;token function&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0.4&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-transition&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; all 0.3s ease-out&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-transition&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; all 0.3s ease-out&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;transition&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; all 0.3s ease-out&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#lightbox div:target&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;z-index&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#lightbox img&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#lightbox #img2&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 15%&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#lightbox a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/close.png&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; no-repeat left top&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 28px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 30px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -42px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -42px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Al right, time to break this thing down.
&lt;code class=&quot;language-text&quot;&gt;#gallery {display: table; margin: 0 auto}&lt;/code&gt; - This centres something that has a dynamic width. Yes that&apos;s right folks, if you add another item it will still be centred. Very awesome, simple and handy.&lt;/p&gt;
&lt;p&gt;I&apos;ve set the transition property on &lt;code class=&quot;language-text&quot;&gt;#lightbox div&lt;/code&gt; to &apos;all&apos;. Why not just do this for &lt;code class=&quot;language-text&quot;&gt;opacity&lt;/code&gt;? Because the &lt;code class=&quot;language-text&quot;&gt;z-index&lt;/code&gt; also needs to be animated. If transition isn&apos;t applied to &lt;code class=&quot;language-text&quot;&gt;z-index&lt;/code&gt;, it fades away after immediately falling beneath a couple of elements. I had no idea you could apply a transition to &lt;code class=&quot;language-text&quot;&gt;z-index&lt;/code&gt; before this. After tinkering for a while I finally gave it a try and it works perfectly in Firefox 4 and Webkit.&lt;/p&gt;
&lt;h3&gt;What is &lt;code class=&quot;language-text&quot;&gt;:target&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The pseudo class that is responsible for this whole experiment is `:target&lt;/code&gt;. Target is quite a simple concept, and it can really broaden your ideas as to what &lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; can actually do.&lt;/p&gt;
&lt;p&gt;Let&apos;s say you have a url: [&lt;a href=&quot;http://css-plus.com/&quot;&gt;http://css-plus.com/&lt;/a&gt;]
Whatever &lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; properties you apply to:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#footer:target&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;/* Apply properties here */&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Will affect &lt;code class=&quot;language-text&quot;&gt;#footer&lt;/code&gt; when the url changes to this: [&lt;a href=&quot;http://css-plus.com/#footer&quot;&gt;http://css-plus.com/#footer&lt;/a&gt;]&lt;/p&gt;
&lt;p&gt;Therefore, when you click the &quot;back&quot; button on your browser after clicking around for a while in the demo&lt;/p&gt;
&lt;h2&gt;How does this work in almost-plain-English?&lt;/h2&gt;
&lt;p&gt;You click an anchor link with a hash value equal to that of an ID. Once this happens, the &lt;code class=&quot;language-text&quot;&gt;:target&lt;/code&gt; pseudo-class kicks in and the properties it contains take effect. The transition property on the ID then takes effect&lt;/p&gt;
&lt;p&gt;The close button isn&apos;t really a &quot;close&quot; button. It&apos;s an anchor link that contains a different hash value to the value in the in the URL. Once this &quot;close&quot; button is clicked, the previously &lt;code class=&quot;language-text&quot;&gt;:target&lt;/code&gt;ed id is not targeted any more. Therefore it loses the &lt;code class=&quot;language-text&quot;&gt;z-index&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;opacity&lt;/code&gt; properties that were applied to it. Once this happens the transition property takes affect again and this creates the &quot;fade out&quot; effect.&lt;/p&gt;
&lt;h2&gt;Problems I ran into&lt;/h2&gt;
&lt;p&gt;I wasn&apos;t able to recreate the transparent black overlay that normally accompanies a lightbox. - I&apos;m sure there is a way of doing this, I just haven&apos;t figured it out yet. If you know of a way let me know and I&apos;ll update this.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;This was a fun experiment which shows you that there are many things that can be done with CSS.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Fancy testimonials page with CSS3]]></title><description><![CDATA[All too often images are given borders, drop-shadows, rotated slightly, etc via photoshop or some image editing program. This is not only…]]></description><link>https://css-plus.com/2011/02/fancy-testimonials-page-with-css3</link><guid isPermaLink="false">https://css-plus.com/2011/02/fancy-testimonials-page-with-css3</guid><pubDate>Thu, 03 Feb 2011 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;All too often images are given borders, drop-shadows, rotated slightly, etc via photoshop or some image editing program. This is not only undesirable since CSS should be taking care of the layout, but it is very restricting. A single change in the image would force you to change all the images individually. CSS cascade, which is what makes them so awesome.&lt;/p&gt;
&lt;p&gt;I&apos;ve been avoiding things like CSS3 gradients, transitions but most of all selectors. I use CSS3 as progressive enhancement and I feel selectors cross over from progressive enhancement to complete layout alterations. This obviously isn&apos;t the case if the selectors are used in the right way.&lt;/p&gt;
&lt;h2&gt;What is &quot;the right way?&quot;&lt;/h2&gt;
&lt;p&gt;I&apos;m very glad you asked. Simply put, &quot;&lt;em&gt;the right way&lt;/em&gt;&quot; degrades gracefully. An IE6 user shouldn&apos;t notice that they are missing out on anything. It looks right for every user regardless of the browser. I think designers probably have the biggest problem with this concept, &quot;IT MUST LIEK LOOK THE SAME EVERYWHERE LOLZ&quot;. Yes, this example-designer is a troll who types in caps. More to the point, designs look different via different mediums, everything plays a role. A piece of paper is always the same resolution, font-size, font-family etc. A webpage can be viewed VERY differently on different computers/browsers. Differences can include font-size, browser width/height, possible font-type and even language.&lt;/p&gt;
&lt;p&gt;Have you ever seen that &quot;Translate&quot; link next to a Google search result? This causes words become different lengths &amp;#x26; wraps these words in &lt;code class=&quot;language-text&quot;&gt;&amp;amp;lt;span&amp;amp;gt;&lt;/code&gt; tags. This can have a &lt;em&gt;major&lt;/em&gt; impact on your websites and it&apos;s important to take note of this if you are targeting foreign traffic. I didn&apos;t take this into account when I developed the current CSS-Plus theme.&lt;/p&gt;
&lt;p&gt;There are many things that one needs to take into account, not just lte IE 7. Keep this in mind when developing anything.&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;p&gt;The whole point of doing this was to keep the HTML as clean and standardized as possible.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;ul id=&quot;testimonials&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;img src=&quot;images/image1.jpg&quot; alt=&quot;&quot; /&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;h2&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Jeffrey Rose&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/h2&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;p&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
				Lorem ipsum...
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/p&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;img src=&quot;images/image2.jpg&quot; alt=&quot;&quot; /&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;h2&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Fred Tigerlily&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/h2&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;p&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
				Lorem ipsum...
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/p&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;img src=&quot;images/image3.jpg&quot; alt=&quot;&quot; /&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;h2&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Craig Dandelion&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/h2&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;p&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
				Lorem ipsum...
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/p&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;img src=&quot;images/image4.jpg&quot; alt=&quot;&quot; /&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;h2&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Jordan Lilly&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/h2&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;p&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
				Lorem ipsum...
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/p&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/div&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/ul&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let me explain the HTML. Each testimonial is contained within a separate list item.
Each list item includes an image, an h2, a div, and paragraph tags within the div. I think everything is quite straight forward except the rogue div. It seems a bit unnecessary doesn&apos;t it? Well, one of the coolest CSS tricks I know is to have 2 perfect columns while only setting the width of 1 column. To do this you float each columns left and right, and set the dynamic columns overflow to hidden. This will force text to stay in the column instead of wrapping around objects. This will be clear when you see the example.&lt;/p&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;p&gt;I&apos;d never used this much CSS3 features on a production site before this.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;#testimonials{
	width: 500px;
	margin: 0 auto;
}
#testimonials h2 {
	color:#ccc;
	font:26px Georgia, serif;
	text-shadow:-1px -1px 0 rgba(255,255,255,0.25);
}
#testimonials li {
	border-top:3px solid rgba(0,0,0,0.2);
	clear:both;
	padding:40px 0;
}
#testimonials li img {
	border:5px solid transparent;
	float:left;
	-moz-box-shadow:0 0 10px #333;
	-webkit-box-shadow:0 0 10px #333;
	box-shadow:0 0 10px #333;
	-moz-transform:rotate(-5deg);
	-o-transform:rotate(-5deg);
	-webkit-transform:rotate(-5deg);
	transform:rotate(-5deg);
	margin:0 20px 0 0;
}
#testimonials li:nth-child(2n) img {
	float:right;
	-moz-transform:rotate(5deg);
	-o-transform:rotate(5deg);
	-webkit-transform:rotate(5deg);
	transform:rotate(5deg);
	margin:0 0 0 20px;
}
#testimonials p {
	padding:0 0 20px;
}
#testimonials li:first-child {
	border:none;
}
#testimonials div {
	overflow:hidden;
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Take note of the following CSS features:&lt;/p&gt;
&lt;h3&gt;overflow: hidden&lt;/h3&gt;
&lt;p&gt;This is applied to the dynamic column I was referring to earlier.&lt;/p&gt;
&lt;h3&gt;rgba()&lt;/h3&gt;
&lt;p&gt;This is very awesome and can be used in many areas to get cool effects&lt;/p&gt;
&lt;h3&gt;nth-child(2n)&lt;/h3&gt;
&lt;p&gt;This is the life saver. We should all take a moment of silence to thank the nth-child inventor...&lt;/p&gt;
&lt;p&gt;If we had created images that included the all off these effects (drop shadow, rotate, border, etc) and we wanted to remove the second testimonial, it would mess everything up. It would be&lt;/p&gt;
&lt;p&gt;Image align left
-Missing-
Image align left
Image align right&lt;/p&gt;
&lt;p&gt;look at that! We would have to either have to replace the deleted testimonial with another one or manually go and change each image, and change the floats accordingly. Nth-child is a lifesaver.&lt;/p&gt;
&lt;h2&gt;Compatibility&lt;/h2&gt;
&lt;p&gt;Again, I think it degrades very well, however you could add support for a few of those CSS3 features to IE6,7 and 8 with &lt;a href=&quot;http://css3pie.com/&quot;&gt;CSS3 PIE&lt;/a&gt; and &lt;a href=&quot;http://selectivizr.com/&quot;&gt;selectivizr&lt;/a&gt;. CSS3 PIE adds support for a few CSS3 properties, such as box-shadow and Selectivizr adds support for CSS3 selectors - Which is really awesome.
These libraries work well together (selectivizr requires jQuery or some other big javascript library such as MooTools) and are very easy to implement, just paste the following code in the header.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/script&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;script type=&quot;text/javascript&quot; src=&quot;js/selectivizr.js&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/script&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;script type=&quot;text/javascript&quot; src=&quot;js/PIE.js&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/script&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;style type=&quot;text/css&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	#testimonials li img{behavior: url(js/PIE.htc);}
&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/style&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note 1: Make sure the file paths are correct.
Note 2: Selectivizr doesn&apos;t work without apache running. So make sure you&apos;re running it through localhost or on the web. I spent two hours learning this the hard way.
Note 3: CSS3 pie is very finicky. One tiny change can stop it from working (at least in my experience). I also attached the PIE.htc via an internal stylesheet because I usually get problems otherwise.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Start using this as soon as possible. Aesthetically pleasing, easy to maintain and graceful degradation.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[PlusSlider 1.0]]></title><description><![CDATA[I've been working on PlusSlider and I've finally finished Version 1 as promised. The two features I'm most proud of: The ability to swap…]]></description><link>https://css-plus.com/2011/01/plusslider-version-1</link><guid isPermaLink="false">https://css-plus.com/2011/01/plusslider-version-1</guid><pubDate>Mon, 10 Jan 2011 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;ve been working on PlusSlider and I&apos;ve finally finished Version 1 as promised.&lt;/p&gt;
&lt;p&gt;The two features I&apos;m most proud of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The ability to swap between &lt;em&gt;fading&lt;/em&gt; &amp;#x26; &lt;em&gt;sliding&lt;/em&gt; seamlessly&lt;/li&gt;
&lt;li&gt;Extremely easy to use&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Compatibility&lt;/h2&gt;
&lt;p&gt;I&apos;ve tested PlusSlider 1.0 on IE7+, Chrome 8, Firefox 3.6, Safari 5, Opera 10.63 and it works perfectly.&lt;/p&gt;
&lt;p&gt;If you find any problems or would like new features, let me know and I&apos;ll work on it.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/examples/plugins/PlusSlider/&quot;&gt;Demo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/JamyGolden/PlusSlider/&quot;&gt;Download&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[See you in early January]]></title><description><![CDATA[I think the title says it all, I'm taking a short and much needed break, but first a quick recap... P.S. You can still catch my one liners…]]></description><link>https://css-plus.com/2010/12/see-you-in-early-january</link><guid isPermaLink="false">https://css-plus.com/2010/12/see-you-in-early-january</guid><pubDate>Thu, 23 Dec 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I think the title says it all, I&apos;m taking a short and much needed break, but first a quick recap...&lt;/p&gt;
&lt;!--more--&gt;
&lt;h2&gt;This year (2010)&lt;/h2&gt;
For me, this year has been eventful to say the least. I&apos;ve learnt so much in many different areas.
I&apos;ve launched CSS-Plus, which has taught me and given me a lot, and I started working for a company called &lt;a href=&quot;http://www.clayant.co.za/&quot;&gt;ClayAnt Creative&lt;/a&gt;.
&lt;h2&gt;Next year (2011)&lt;/h2&gt;
I think next is full of awesome things to come. I&apos;m going to release &lt;a href=&quot;http://css-plus.com/2010/11/plusslider/&quot;&gt;PlusSlider&lt;/a&gt; Version 1 in early January.
The new CSS-Plus theme should be done in early 2011.
I&apos;ve also got a few useful jQuery plugins in the pipelines which will make my life, and hopefully yours too, easier.
&lt;h2&gt;Have a merry Christmas&lt;/h2&gt;
And a very decent new years eve.
&lt;p&gt;P.S. You can still catch my one liners on &lt;a href=&quot;http://www.twitter.com/jamygolden&quot;&gt;twitter&lt;/a&gt;.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to Create a Fancy CSS3 Menu]]></title><description><![CDATA[It's good to know and keep up with the latest CSS tricks, especially with all the latest browsers on the verge of coming out. In this…]]></description><link>https://css-plus.com/2010/12/how-to-create-a-fancy-css3-menu</link><guid isPermaLink="false">https://css-plus.com/2010/12/how-to-create-a-fancy-css3-menu</guid><pubDate>Thu, 09 Dec 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;It&apos;s good to know and keep up with the latest &lt;em&gt;&lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; tricks&lt;/em&gt;, especially with all the &lt;a href=&quot;https://wiki.mozilla.org/Releases&quot;&gt;latest&lt;/a&gt; &lt;a href=&quot;http://ie.microsoft.com/testdrive/&quot;&gt;browsers&lt;/a&gt; on the verge of coming out.&lt;/p&gt;
&lt;p&gt;In this tutorial, I&apos;m going to create a navigation menu that relies &lt;em&gt;heavily&lt;/em&gt; on &lt;abbr title=&quot;Cascading Style Sheet 3&quot;&gt;CSS3&lt;/abbr&gt;. The purpose for this is to learn about &lt;abbr title=&quot;Cascading Style Sheet 3&quot;&gt;CSS3&lt;/abbr&gt; Properties you might not have already known, see them in use and perhaps get you to dream about the things developers will be able to do without relying on other technologies such as javascript.&lt;/p&gt;
&lt;p&gt;If you&apos;re not sure how to create a &lt;a href=&quot;http://css-plus.com/2010/03/how-to-create-a-simple-horizontal-navigation-menu-from-scratch/&quot;&gt;standard navigation menu&lt;/a&gt;, have a look at &lt;a href=&quot;http://css-plus.com/2010/03/fading-navigation-menu/&quot;&gt;these&lt;/a&gt; &lt;a href=&quot;http://css-plus.com/2010/06/how-to-make-a-jquery-drop-down-menu-with-a-css-fall-back/&quot;&gt;tutorials&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;CSS3 Properties to keep your eyes on&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Gradients&lt;/li&gt;
&lt;li&gt;Border-Radius&lt;/li&gt;
&lt;li&gt;Text-Shadow&lt;/li&gt;
&lt;li&gt;Transition&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;The Standard HTML&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;ul id=&quot;menu&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;a href=&quot;#&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Home&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/a&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li class=&quot;freebies&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;a href=&quot;#&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Freebies&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/a&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;ul&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;a href=&quot;#&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Accordions&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/a&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;a href=&quot;#&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Menus&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/a&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;a href=&quot;#&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Sliders&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/a&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;a href=&quot;#&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Zoomers&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/a&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/ul&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li class=&quot;tutorials&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;a href=&quot;#&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Tutorials&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/a&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;ul&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;a href=&quot;#&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;CSS&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/a&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;a href=&quot;#&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;HTML&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/a&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
			&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;a href=&quot;#&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Javascript&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/a&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
		&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/ul&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;a href=&quot;#&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;About&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/a&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
	&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;a href=&quot;#&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Contact&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/a&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/li&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;
&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/ul&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;The CSS&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#menu&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;token comment&quot;&gt;/* fallback color */&lt;/span&gt;
		&lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #f1f1f1&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
		
	&lt;span class=&quot;token comment&quot;&gt;/* Gradient support for IE9 and Opera */&lt;/span&gt;
		&lt;span class=&quot;token property&quot;&gt;background-image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/svg-gradient.svg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
		
	&lt;span class=&quot;token comment&quot;&gt;/* Mozilla Gradient Support */&lt;/span&gt;
		&lt;span class=&quot;token property&quot;&gt;background-image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;-moz-linear-gradient&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;100% 100% 90deg&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
			#ccc&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; #f1f1f1&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
							
	&lt;span class=&quot;token comment&quot;&gt;/* Webkit Gradient Support */&lt;/span&gt;
		&lt;span class=&quot;token property&quot;&gt;background-image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;-webkit-gradient&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;linear&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0% 0%&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0% 100%&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 
			&lt;span class=&quot;token function&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;#f1f1f1&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;#ccc&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
							
	&lt;span class=&quot;token comment&quot;&gt;/* Rounded Corners */&lt;/span&gt;
		&lt;span class=&quot;token property&quot;&gt;-moz-border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
		&lt;span class=&quot;token property&quot;&gt;-webkit-border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
		&lt;span class=&quot;token property&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
		
	&lt;span class=&quot;token comment&quot;&gt;/* Box Shadow */&lt;/span&gt;
		&lt;span class=&quot;token property&quot;&gt;-moz-box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0 5px #5C5C5C&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
		&lt;span class=&quot;token property&quot;&gt;-webkit-box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0 5px #5C5C5C&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
		&lt;span class=&quot;token property&quot;&gt;box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0 5px #5C5C5C&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
		
	&lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 30px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
	&lt;span class=&quot;token property&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 18px Georgia&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; serif&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
	&lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
	&lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 640px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#menu li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
	&lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 23px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
	&lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; relative&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
	&lt;span class=&quot;token property&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 30px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

#menu &amp;amp;gt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token selector&quot;&gt;li ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; hidden&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 30px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token property&quot;&gt;-moz-transition-property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; height&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-transition-duration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0.2s&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-transition-timing-function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; linear&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; ease-in&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token property&quot;&gt;-webkit-transition-property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; height&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-transition-duration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0.2s&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-transition-timing-function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; linear&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; ease-in&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token property&quot;&gt;transition-property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; height&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;transition-duration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0.2s&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;transition-timing-function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; linear&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; ease-in&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

#menu &amp;amp;gt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; li &amp;amp;gt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token selector&quot;&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #cdcdcd&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;-moz-border-radius-bottomleft&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;-moz-border-radius-bottomright&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;-webkit-border-bottom-left-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;-webkit-border-bottom-right-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;border-bottom-left-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;border-bottom-right-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#menu li li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 4px 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 14px Arial&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Helvetica&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Verdana&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; san-serif&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;text-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
#menu &amp;amp;gt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token selector&quot;&gt;li.freebies:hover ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 100px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
#menu &amp;amp;gt&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token selector&quot;&gt;li.tutorials:hover ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 75px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token selector&quot;&gt;#menu a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #333&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1px 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;text-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1px 1px 2px #999&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#menu a:hover&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #d6d6d6&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;-moz-border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;-webkit-border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token property&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;The Transition property&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;transition-property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; height&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;token property&quot;&gt;transition-duration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0.2s&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;token property&quot;&gt;transition-timing-function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; linear&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; ease-in&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&amp;lt;/code&gt;&amp;lt;/pre&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;transition-property&lt;/code&gt;: height – The property transition should affect
&lt;code class=&quot;language-text&quot;&gt;transition-duration&lt;/code&gt;: 0.2s; – The durtion;
&lt;code class=&quot;language-text&quot;&gt;transition-timing-function&lt;/code&gt;: linear, ease-in; – This is&lt;/p&gt;
&lt;p&gt;Read more about this at &lt;a href=&quot;http://www.onextrapixel.com/2010/11/17/a-comprehensive-guide-to-css-3-transitions/&quot;&gt;Onextrapixel&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;What&apos;s up with the .svg file?&lt;/h3&gt;
&lt;p&gt;This is used to achieve a scalable vector within IE9 and Opera.&lt;/p&gt;
&lt;p&gt;Yes, I know it is possible to create a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms532997(VS.85,loband).aspx&quot;&gt;CSS gradient within IE&lt;/a&gt; without the help of weird file-type, but I&apos;ve stuck to the .&lt;abbr title=&quot;Scalable Vector Graphic&quot;&gt;svg&lt;/abbr&gt; file as this is future proofs the menu. Visit &lt;a href=&quot;http://css3wizardry.com/2010/10/29/css-gradients-for-ie9/&quot;&gt;CSS3 Wizardry&lt;/a&gt; to find out more about this.&lt;/p&gt;
&lt;h3&gt;These gradients are confusing!&lt;/h3&gt;
&lt;p&gt;If you&apos;re still finding the gradients a bit overwhelming, have a look at Chris Coyier&apos;s article: &lt;a href=&quot;http://css-tricks.com/css3-gradients/&quot;&gt;Speed up with CSS3 gradients&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;What are the downsides to using this?&lt;/h2&gt;
&lt;p&gt;There are two major ones I can see.&lt;/p&gt;
&lt;h3&gt;Browser Compatiblity&lt;/h3&gt;
&lt;p&gt;It does not work in IE6, it&apos;s a bit funky in IE7 and it works in IE8, but without all the &lt;abbr title=&quot;Cascading Style Sheet 3&quot;&gt;CSS3&lt;/abbr&gt; which makes it look a bit bland.&lt;/p&gt;
&lt;p&gt;Luckily if a browser doesn&apos;t support the transition property it will still work and look good, except for the sliding hover effect.&lt;/p&gt;
&lt;h3&gt;Dynamic Menus&lt;/h3&gt;
&lt;p&gt;You might have noticed that I&apos;ve given both sub menus a fixed width. This means that if I add another item, it won&apos;t dynamically grow. I&apos;ve been trying to find a work around for this (without javascript) but I haven&apos;t found a solution as of yet. If you manage to find one, let me know and I&apos;ll add it.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;It wasn&apos;t too long ago when I wouldn&apos;t even consider using border radius, and now I would most probably add a few &lt;abbr title=&quot;Cascading Style Sheet 3&quot;&gt;CSS3&lt;/abbr&gt; transitions here-and-there for the &lt;em&gt;&apos;cool kids&apos;&lt;/em&gt; who have the latest browsers.
As you would have noticed, throughout this article I&apos;ve linked to a few articles that go into more depth about the these properties.&lt;/p&gt;
&lt;p&gt;I hope you&apos;ve learnt something from this brief tutorial.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Create a scrolling anchor link with jQuery]]></title><description><![CDATA[I've been meaning to do this tutorial for a while now and it seems as if I'm finally getting around to it! Very simply put, this will…]]></description><link>https://css-plus.com/2010/11/create-a-scrolling-anchor-link-with-jquery</link><guid isPermaLink="false">https://css-plus.com/2010/11/create-a-scrolling-anchor-link-with-jquery</guid><pubDate>Tue, 30 Nov 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;ve been meaning to do this tutorial for a while now and it seems as if I&apos;m finally getting around to it!&lt;/p&gt;
&lt;p&gt;Very simply put, this will function like a normal &lt;em&gt;internal anchor link&lt;/em&gt; or &lt;em&gt;named anchor link&lt;/em&gt;, but will scroll to the specified destination instead of merely jumping there. It&apos;s a really easy-to-implement and awesome thing to add to almost any website.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;I&apos;m going to jump right into it.&lt;/p&gt;
&lt;h2&gt;The &lt;abbr title=&quot;HyperText Markup Language&quot;&gt;HTML&lt;/abbr&gt;&lt;/h2&gt;
All that is needed for this example is an element to click, and an element to scroll to.
&lt;pre&gt;&lt;code&gt;&amp;lt;a id=&quot;scroll&quot;&amp;gt;Click here to scroll&amp;lt;/a&amp;gt;
&amp;lt;img src=&quot;images/cat.png&quot; alt=&quot;cat&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
I&apos;ve decided to scroll to an image of a random cat, however I think this would be most useful for something like a &lt;em&gt;table of contents&lt;/em&gt;.
&lt;h2&gt;The jQuery/Javascript&lt;/h2&gt;
We will be using the &lt;a href=&quot;http://api.jquery.com/click/&quot;&gt;click() event&lt;/a&gt;, &lt;a href=&quot;http://api.jquery.com/animate/&quot;&gt;animate effect&lt;/a&gt;, &lt;a href=&quot;http://api.jquery.com/scrollTop/&quot;&gt;scrollTop() manipulation&lt;/a&gt; and &lt;a href=&quot;http://api.jquery.com/offset/&quot;&gt;offset manipulation&lt;/a&gt;.
&lt;pre&gt;&lt;code&gt;// When the Document Object Model is ready
jQuery(document).ready(function(){
	// &apos;catTopPosition&apos; is the amount of pixels #cat
	// is from the top of the document
	var catTopPosition = jQuery(&apos;#cat&apos;).offset().top;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;// When #scroll is clicked
jQuery(&apos;#scroll&apos;).click(function(){
	// Scroll down to &apos;catTopPosition&apos;
	jQuery(&apos;html, body&apos;).animate({scrollTop:catTopPosition}, &apos;slow&apos;);
	// Stop the link from acting like a normal anchor link
	return false;
});&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;});&lt;/code&gt;&lt;/pre&gt;
Fairly simple and straight forward jQuery.
Note: &lt;code&gt;jQuery(&apos;html, body&apos;)&lt;/code&gt; is necessary for cross-browser compatibility.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[PlusSlider Beta]]></title><description><![CDATA[I've been creating and working with sliders a lot lately and there have been a few things that have bugged me about them, the main ones are…]]></description><link>https://css-plus.com/2010/11/plusslider-beta</link><guid isPermaLink="false">https://css-plus.com/2010/11/plusslider-beta</guid><pubDate>Thu, 18 Nov 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;ve &lt;a href=&quot;http://css-plus.com/2010/09/create-your-own-jquery-image-slider/&quot;&gt;been&lt;/a&gt; &lt;a href=&quot;http://css-plus.com/2010/07/create-an-infinite-polaroid-image-viewer-with-jquery/&quot;&gt;creating&lt;/a&gt; and working with sliders a lot lately and there have been a few things that have bugged me about them, the main ones are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Image-only sliders&lt;/li&gt;
&lt;li&gt;Sliders (Carousels) &lt;em&gt;fade&lt;/em&gt;, but don&apos;t &lt;em&gt;slide&lt;/em&gt; or vice-versa&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://validator.w3.org/&quot;&gt;Invalid&lt;/a&gt; and complicated markup&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;http://css-plus.com/wp-content/uploads/2010/11/plus-slider.jpg&quot; alt=&quot;image&quot;&gt;&lt;/p&gt;
&lt;p&gt;I know there are way too many content/image sliders out there, but—Ironically—I haven&apos;t managed to find one that can fade &lt;em&gt;and&lt;/em&gt; slide. You might be thinking to yourself: &lt;em&gt;This can&apos;t fade and slide either&lt;/em&gt;.
You are 100% correct. However, this is the Beta release. I am releasing a Beta so that I can receive feedback and work on useful things I may have overlooked, while implementing the &apos;slide&apos; functionality.&lt;/p&gt;
&lt;p&gt;So, feel free to give feedback!&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to horizontally centre anything with CSS]]></title><description><![CDATA[There two kinds of display elements we work with most of the time, and they are inline-level elements and block-level elements. By default…]]></description><link>https://css-plus.com/2010/11/how-to-horizontally-centre-anything-with-css</link><guid isPermaLink="false">https://css-plus.com/2010/11/how-to-horizontally-centre-anything-with-css</guid><pubDate>Tue, 09 Nov 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;There two kinds of display elements we work with most of the time, and they are inline-level elements and block-level elements. By default, elements such as &lt;code&gt;&amp;#x3C;span&gt;&lt;/code&gt; and &lt;code&gt;&amp;#x3C;a&gt;&lt;/code&gt; are examples of inline elements whereas &lt;code&gt;&amp;#x3C;h1&gt;&lt;/code&gt;, &lt;code&gt;&amp;#x3C;h2&gt;&lt;/code&gt;, &lt;code&gt;&amp;#x3C;p&gt;&lt;/code&gt; and &lt;code&gt;&amp;#x3C;div&gt;&lt;/code&gt; are examples of block elements. These elements are not forced to stay inline or block. The browser applies basic styling to elements and it is this that gives the elements their &lt;em&gt;seemingly&lt;/em&gt; engrained properties.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;Just like the browser styles these elements, we can style them too and over-ride the browsers styling.&lt;/p&gt;
&lt;p&gt;It&apos;s important to understand the &lt;a href=&quot;http://hiox.org/6576-block-vs-inline-level-elements.php&quot;&gt;difference&lt;/a&gt; between &lt;strong&gt;inline-level&lt;/strong&gt; elements and &lt;strong&gt;block-level&lt;/strong&gt; elements, because different methods are used to centre these different level elements.&lt;/p&gt;
&lt;h2&gt;Centring text, single and multiple inline-level element&lt;/h2&gt;
These are definitely the most straight-forward thing to centre with &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt;.
&lt;h3&gt;The &lt;abbr title=&quot;HyperText Markup Language&quot;&gt;HTML&lt;/abbr&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;center&quot;&amp;gt;
	This is some text that will be centred
&amp;lt;/div&amp;gt;
&amp;lt;div class=&quot;center&quot;&amp;gt;
	This is some text as well as a &amp;lt;span&amp;gt;few&amp;lt;/span&amp;gt; &amp;lt;span&amp;gt;inline-level elements&amp;lt;/span&amp;gt;.
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;The &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;.center{text-align: center;}&lt;/code&gt;&lt;/pre&gt;
All of the text will be centre aligned. You can have a look at the &lt;a href=&quot;#&quot;&gt;demo&lt;/a&gt;.
&lt;h3&gt;Centring a block-level element&lt;/h3&gt;
This is slightly more confusing than &lt;code&gt;text-align: center&lt;/code&gt;.
&lt;p&gt;In order to centre a block-level element, the element must have a &lt;em&gt;fixed&lt;/em&gt; width and the left and right margin must be set to &lt;code&gt;auto&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;The HTML&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;block&quot;&amp;gt;Example Block&amp;lt;div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;The &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;.block{margin: 0 auto; width: 100px;}&lt;/code&gt;&lt;/pre&gt;
This will &lt;a href=&quot;#&quot;&gt;centre&lt;/a&gt; the 100px wide block.
&lt;p&gt;That&apos;s it for the single block-level element. Not too confusing, but definitely more complicated than the &lt;code&gt;text-align: center&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Centring multiple block-level elements&lt;/h2&gt;
This isn&apos;t much trickier than centring a single block-level element.
&lt;p&gt;We will need to wrap the elements we want to centre in a container block-level element and centre the container/parent. Technically, we still centring a single block-level element.&lt;/p&gt;
&lt;h3&gt;The HTML&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;container&quot;&amp;gt;
	&amp;lt;div class=&quot;block&quot;&amp;gt;
	&amp;lt;div class=&quot;block&quot;&amp;gt;
	&amp;lt;div class=&quot;block&quot;&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;The &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;.container{margin: 0 auto; width: 360px;}
.block{background: #333; float: left; height: 100px; margin: 0 10px; width: 100px;}&lt;/code&gt;&lt;/pre&gt;
As you can see, all 3 &lt;code&gt;.block&lt;/code&gt;s fit perfectly in the container. The outer-width (width, margin and padding) of each block is 120px.
120px * 3 = 360px
&lt;p&gt;That&apos;s awesome, we have successfully centred multiple block-level elements. That&apos;s it... Right?&lt;/p&gt;
&lt;p&gt;Nope, there is still more.&lt;/p&gt;
&lt;h2&gt;How do I centre a dynamic amount of block level elements?&lt;/h2&gt;
This is a tricky question, at least if you don&apos;t know the solution.
&lt;p&gt;What if a user has &lt;abbr title=&quot;Content Management System&quot;&gt;CMS&lt;/abbr&gt; control and adds &lt;em&gt;another&lt;/em&gt; &lt;code&gt;.block&lt;/code&gt; to that container div?
Answer: The block will appear &lt;em&gt;below&lt;/em&gt; the first block because the container has a set width of 360px.&lt;/p&gt;
&lt;p&gt;We could fix that by adding another 120px to the container&apos;s width, but there will probably still be future problems if the amount of &lt;code&gt;.block&lt;/code&gt;s change.&lt;/p&gt;
&lt;h2&gt;2 solutions&lt;/h2&gt;
The one solution is so simple it&apos;s almost funny:
Remove the width of the container and change the display to &apos;table&apos;.
For example:
&lt;pre&gt;&lt;code&gt;.container{display: table; margin: 0 auto;}&lt;/code&gt;&lt;/pre&gt;
Magic!, all solved. Now we can upload and implement, right?
&lt;p&gt;Almost, but we have a problem... or two: IE6 and IE7. Those two browser don&apos;t support &lt;abbr title=&quot;Cascading Style Sheets 2.1&quot;&gt;CSS 2.1&lt;/abbr&gt; properly, and &lt;code&gt;display: table&lt;/code&gt; is one of the properties they don&apos;t support.&lt;/p&gt;
&lt;p&gt;If you insist on getting it to work within IE6 and 7, here is a jQuery solution.&lt;/p&gt;
&lt;h3&gt;The jQuery&lt;/h3&gt;
I was faced with this problem before and I used jQuery to calculate the total width of the container&apos;s children, and set that as the container&apos;s width, therefore, if set to &lt;code&gt;margin: 0 auto&lt;/code&gt;, it would always be centred. The only downside to this is each child-element has to have the the same width and margin.
&lt;pre&gt;&lt;code&gt;jQuery(document).ready(function($){
	var	totalWidth = $(&apos;.container&apos;).outerWidth(),
		totalChildren = $(&apos;.container&apos;).children().size(),
		containerWidth = totalWidth * totalChildren;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;text&quot;&gt;&lt;pre class=&quot;language-text&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;$(&apos;.container&apos;).width(containerWidth);&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;});&lt;/code&gt;&lt;/pre&gt;
And that&apos;s it.&lt;/p&gt;
&lt;p&gt;Hopefully this article solves some of your problems.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[4 Useful jQuery selectors]]></title><description><![CDATA[I've created quite a few jQuery components before, and I continue to do so every day. This forces me to find best practices and short-cuts…]]></description><link>https://css-plus.com/2010/10/4-useful-jquery-selectors</link><guid isPermaLink="false">https://css-plus.com/2010/10/4-useful-jquery-selectors</guid><pubDate>Thu, 28 Oct 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;ve created quite a few jQuery components before, and I continue to do so every day. This forces me to find best practices and short-cuts to cut down development time, keep things simple and cross browser compatible.
This article is going to be about a bunch of &lt;a href=&quot;http://api.jquery.com/category/selectors/&quot;&gt;jQuery selectors&lt;/a&gt; that I find useful and use on a daily basis because, they simply work well for me.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;One of my favourite things about &lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; are the selectors. I get an extremely warm and tingly feeling when I can make an amazing website with a very small and compact &lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; file. Using the correct selector when it is appropriate can cut your &lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; file size in half.&lt;/p&gt;
&lt;p&gt;At the moment, we can&apos;t use &lt;abbr title=&quot;Cascading Style Sheet 3&quot;&gt;CSS3&lt;/abbr&gt; selectors or properties guilt free yet (For obvious reasons). This is where jQuery selectors come in and save the day.&lt;/p&gt;
&lt;p&gt;Not only does jQuery allow you to use &lt;a href=&quot;http://ejohn.org/apps/selectortest/&quot;&gt;most CSS3 selectors&lt;/a&gt;, but there are a bunch of extra very awesome and unique jQuery selectors.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;http://api.jquery.com/animated-selector/&quot;&gt;:animated&lt;/a&gt;&lt;/h2&gt;
&lt;code&gt;:animated&lt;/code&gt; selects all elements that are currently being animated.
This might not sound too useful, but it really is.
&lt;p&gt;I use it almost every time I use an animation on hover with jQuery. Consider the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$(&apos;#nav li a&apos;).hover(function(){
	$(this).fadeTo(300, 1);
}, function(){
	$(this).fadeTo(300, 0.5);
});&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On hover, that will cause each &lt;code&gt;#nav li a&lt;/code&gt; to fade in completely on hover, and fade to 50% opacity on mouse-exit. If you quickly hover your mouse - on and off, on and off - multiple times, it will cause the animations to queue up. This is almost never an ideal situation. We want the animation to run once, something must be done about it!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://css-tricks.com/full-jquery-animations/&quot;&gt;Chris Coyier&lt;/a&gt; has an interesting article about this and as he mentions, &lt;a href=&quot;http://www.2meter3.de/code/hoverFlow/&quot;&gt;Ralf Stoltze&lt;/a&gt; seems to have the best solution.&lt;/p&gt;
&lt;p&gt;The quick solution I generally use is as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$(&apos;#nav li a&apos;).hover(function(){
	// If this is not animated
	if(!$(this).is(&apos;:animated&apos;)){
		$(this).fadeTo(300, 1);
	}
}, function(){
	$(this).fadeTo(300, 0.5);
});&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I find &lt;code&gt;:animated&lt;/code&gt; most useful when it comes to excluding animated elements.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;http://api.jquery.com/contains-selector/&quot;&gt;:contains&lt;/a&gt;&lt;/h2&gt;
This selector selects an element that contains specific text.
&lt;p&gt;I&apos;ve used this selector quite a few times in very similar situations. I generally use it to select specific &lt;abbr title=&quot;List Items&quot;&gt;&amp;#x3C;li&gt;s&lt;/abbr&gt; in a &lt;a href=&quot;http://css-plus.com/2010/03/fading-navigation-menu/&quot;&gt;navigation menu&lt;/a&gt;. This is normally useful when there is limited &lt;abbr title=&quot;HyperText Markup Language&quot;&gt;HTML&lt;/abbr&gt; control, such as within certain &lt;abbr title=&quot;Content Management System&quot;&gt;CMS&lt;/abbr&gt;s.&lt;/p&gt;
&lt;p&gt;Wordpress 3 has a new feature which allows users to add items to the navigation menu and easily move them around, this is a prefect situation for this jQuery selector.&lt;/p&gt;
&lt;p&gt;Consider the html:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;ul&amp;gt;
	&amp;lt;li&amp;gt;&amp;lt;a href=&quot;index.php&quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
	&amp;lt;li&amp;gt;&amp;lt;a href=&quot;about.php&quot;&amp;gt;About&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
	&amp;lt;li&amp;gt;&amp;lt;a href=&quot;contact.php&quot;&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Let&apos;s say we want to add a class of &lt;code&gt;.contact&lt;/code&gt; to the &lt;code&gt;&amp;#x3C;li&gt;&lt;/code&gt; that contains the text &apos;Contact&apos; in order to add a custom background.
We could use &lt;abbr title=&quot;Cascading Style Sheet 3&quot;&gt;CSS3&lt;/abbr&gt; but that isn&apos;t supported in IE6-8.
We could select the third item in the list or the last item using jQuery. This would work perfectly, but if the user changes the position of the list items, the wrong item will have the class of contact.&lt;/p&gt;
&lt;p&gt;I&apos;ve found that the easiest way to deal with this is to use the jQuery selector &lt;code&gt;:contains&lt;/code&gt;.
All we need to is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$(&apos;ul li:contains(&quot;Contact&quot;)&apos;).addClass(&apos;contact&apos;);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will select Contact no matter where it is situated.&lt;/p&gt;
&lt;p&gt;Note: This will select anything containing contact, even &apos;Mr Contact&apos; or &apos;Contact Me&apos;.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;http://api.jquery.com/visible-selector/&quot;&gt;:visible&lt;/a&gt; / &lt;a href=&quot;http://api.jquery.com/visible-selector/&quot;&gt;:hidden&lt;/a&gt;&lt;/h2&gt;
These jQuery selectors, are opposite, yet very similar.
&lt;code&gt;:visible&lt;/code&gt; selects all visible elements and &lt;code&gt;:hidden&lt;/code&gt; selects all hidden elements.
&lt;p&gt;I&apos;ve found myself selecting elements that are &lt;em&gt;not visible&lt;/em&gt; instead of looking for elements that are hidden.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$(&apos;li&apos;).not(&apos;:visible&apos;)
!$(&apos;li:visible&apos;)
$(&apos;li:hidden&apos;)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Each of those do the same thing, but as you can see, the third example is the most simple and semantic.&lt;/p&gt;
&lt;p&gt;I use &lt;code&gt;:visible&lt;/code&gt; very often. It is extremely easy, efficient and useful when creating an &lt;a href=&quot;http://css-plus.com/2010/07/create-an-infinite-polaroid-image-viewer-with-jquery/&quot;&gt;image viewer&lt;/a&gt; or something that only has one visible element at a time.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;http://api.jquery.com/has-selector/&quot;&gt;:has()&lt;/a&gt;&lt;/h2&gt;
Lastly we have the &lt;code&gt;:has&lt;/code&gt; jQuery selector. I find it extremely useful when fixing up other people&apos;s work for some reason.
&lt;p&gt;Borders are often used to style links in place of &lt;code&gt;text-decoration: underline&lt;/code&gt;. Often it looks slightly more stylish. I&apos;m currently using this border-method on &lt;a href=&quot;http://css-plus.com&quot;&gt;css-plus.com&lt;/a&gt;.
Unfortunately, this is a pretty common problem:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;a{border-bottom: 2px solid #000;}
a:hover{border-bottom: 2px solid #000;}&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;a href=&quot;#&quot;&amp;gt;Link&amp;lt;/a&amp;gt;
&amp;lt;a href=&quot;#&quot;&amp;gt;&amp;lt;img src=&quot;images/image.jpg&quot; alt=&quot;&quot; /&amp;gt;&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This method creates a border underneath the image because it is wrapped within an anchor link.
&lt;code&gt;:has&lt;/code&gt; can be used to solve this problem.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$(&apos;a:has(&quot;img&quot;)&apos;).addClass(&apos;image-link&apos;);&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;a.image-link{border: none;}
a.image-link:hover{border: none;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;:has&lt;/code&gt; is extremely useful, but since it requires javascript, I wouldn&apos;t base a websites styling on too much jquery &lt;code&gt;:has&lt;/code&gt;. Unfortunately, this will probably never be supported within &lt;abbr title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/abbr&gt;. Jonathan Snook has written a very &lt;a href=&quot;http://snook.ca/archives/html_and_css/css-parent-selectors&quot;&gt;interesting article&lt;/a&gt; regarding this topic.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
jQuery offers some very awesome selectors, some of which might be available via &lt;abbr title=&quot;Cascading Style Sheet&quot;&gt;CSS&lt;/abbr&gt; one day. However, as much as I feel like I am free to use them within a javascript component, I feel I am prevented from using them to help me create a layout because there are still people who have javascript disabled - for whatever reason - and the website should still look presentable without javascript.</content:encoded></item><item><title><![CDATA[Solid mobile HTML development]]></title><description><![CDATA[Before I even get started, the word "Solid" in the title implies that the HTML should work on pretty much all mobile phones. So no fancy…]]></description><link>https://css-plus.com/2010/10/solid-mobile-html-development</link><guid isPermaLink="false">https://css-plus.com/2010/10/solid-mobile-html-development</guid><pubDate>Mon, 11 Oct 2010 00:00:00 GMT</pubDate><content:encoded>&lt;!-- internal links --&gt;
&lt;p&gt;Before I even get started, the word &quot;Solid&quot; in the title implies that the HTML should work on pretty much all mobile phones. So no fancy smart-phone tricks, just a few good old wholesome HTML and CSS tips.&lt;/p&gt;
&lt;!--more--&gt;
&lt;h2&gt;Use an internal-stylesheet&lt;/h2&gt;
&lt;p&gt;This is very important. Some mobile browsers&apos; don&apos;t support external-stylesheets. So if you have created the mobile site with one stylesheet (Like I would), just remember to migrate the stylesheet onto each page as an internal-stylesheet. I find it easiest to open all the pages and do a find/replace throughout open documents. This saves a lot of copying/pasting work. If you&apos;re using windows and your editor doesn&apos;t support the &apos;find/replace throughout open documents&apos; option, have a look at &lt;a href=&quot;http://notepad-plus-plus.org/&quot;&gt;Notepad++&lt;/a&gt;. Dreamweaver also has this option.&lt;/p&gt;
&lt;h2&gt;Mobile Doctype and Charset&lt;/h2&gt;
&lt;p&gt;First of all, mobile devices have their own DOCTYPE.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token doctype&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;!&lt;/span&gt;&lt;span class=&quot;token doctype-tag&quot;&gt;DOCTYPE&lt;/span&gt; &lt;span class=&quot;token name&quot;&gt;html&lt;/span&gt; &lt;span class=&quot;token name&quot;&gt;PUBLIC&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;-//WAPFORUM//DTD XHTML Mobile 1.2//EN&quot;&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can declare the charset by either adding the following &lt;em&gt;before&lt;/em&gt; the DOCTYPE:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token prolog&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Or by adding the following within the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;head&gt;&lt;/code&gt; section:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;meta&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;http-equiv&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Content-Type&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/html; charset=utf-8&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Mobile devices are smarter than you think&lt;/h2&gt;
&lt;p&gt;I feel that developing for older mobile devices lies somewhere between developing for email-clients and relatively advanced browsers.
For example: The &lt;a href=&quot;http://css-plus.com/2010/08/basic-css-selectors-you-are-missing-out-on/&quot;&gt;child and attribute selectors&lt;/a&gt; are well supported, however the position property should be avoided.&lt;/p&gt;
&lt;p&gt;Here is an extremely useful website regarding &lt;a href=&quot;http://www.quirksmode.org/m/css.html&quot;&gt;mobile css properties and selector support&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Fluid width - &lt;code class=&quot;language-text&quot;&gt;140px&lt;/code&gt; to &lt;code class=&quot;language-text&quot;&gt;320px&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;There are different sized mobile screens, just like there are different sized monitors. Design and develop for a minimum width of about 140px. This is very tiny, but there are very old mobile screens that are actually this small and we should do everything we can to avoid users from having to scroll horizontally.&lt;/p&gt;
&lt;p&gt;I generally wrap everything within a #page-wrap div with a max-width limit to achieve this. The CSS would look something like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#page-wrap&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 320px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Pixels are your enemy&lt;/h2&gt;
&lt;p&gt;Pixels should be avoided as much as possible.
You might be wondering to yourself: &apos;What exactly does he mean?&apos;.
Well, everything should be as fluid as possible since the device&apos;s display will vary in resolution.&lt;/p&gt;
&lt;p&gt;Alternatively, if something is given a fixed width, it should not exceed the &apos;minimum&apos; width. (In this case, it&apos;s 140px)&lt;/p&gt;
&lt;h3&gt;Get your logo to remain constant&lt;/h3&gt;
&lt;p&gt;The only way to keep things &lt;em&gt;fair&lt;/em&gt; and &lt;em&gt;constant&lt;/em&gt;, is to work with ratio. I believe that applies to everything in life, including mobile devices.&lt;/p&gt;
&lt;p&gt;The following is an example of how logos could be displayed by mobile devices.
&lt;img class=&quot;alignnone size-full wp-image-477&quot; title=&quot;mobile-device-sizes&quot; src=&quot;http://css-plus.com/wp-content/uploads/2010/10/mobile-device-sizes.png&quot; alt=&quot;Mobile Devices Sizes&quot; width=&quot;421&quot; height=&quot;341&quot;&gt;
This is achieved by setting the width of the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;img&gt;&lt;/code&gt; element to 100% within the CSS.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#logo&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 100%&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will grow and shrink proportionally as required thanks to the #page-wrap div.&lt;/p&gt;
&lt;h3&gt;Font-size&lt;/h3&gt;
&lt;p&gt;Set the body&apos;s font size to &lt;em&gt;small&lt;/em&gt; &lt;em&gt;medium&lt;/em&gt; or &lt;em&gt;large&lt;/em&gt; and work with font-size percentages for the other elements.
For example:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; medium&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;h1&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 80%&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;h2&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 70%&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 60%&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Clearing floats&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.clear&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;clear&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; both&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;&amp;lt;br class=&quot;clear&quot; /&gt;&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;&amp;lt;div class=&quot;clear&quot;&gt;&amp;lt;/div&gt;&lt;/code&gt; is well supported, so use it as often as you would like.
It&apos;s helped me get out of a few sticky situations, especially when developing forms.&lt;/p&gt;
&lt;h2&gt;Relax when designing/styling&lt;/h2&gt;
&lt;p&gt;Keep in mind that there are elements that certain mobile devices won&apos;t allow you to style.
For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Form elements, such as &lt;code class=&quot;language-text&quot;&gt;&amp;lt;input /&gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code class=&quot;language-text&quot;&gt;:hover&lt;/code&gt; pseudo class.&lt;/li&gt;
&lt;li&gt;And sometimes even the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;a&gt;&lt;/code&gt; links.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Things to remember&lt;/h2&gt;
&lt;p&gt;Remember to add some form of CSS reset.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;/* Hard reset */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I hope you&apos;ve taken something useful from this article. If you have any questions or comments, feel free to leave a comment below.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[The Best of CSS-Plus]]></title><description><![CDATA[What is 'The Best of CSS-Plus'? It's the beginning of a possible series about some of my CSS tips and tricks. I wouldn't say I have many CSS…]]></description><link>https://css-plus.com/2010/09/best-of-css-plus</link><guid isPermaLink="false">https://css-plus.com/2010/09/best-of-css-plus</guid><pubDate>Thu, 30 Sep 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;What is &apos;The Best of CSS-Plus&apos;? It&apos;s the beginning of a possible series about some of my CSS tips and tricks.&lt;/p&gt;
&lt;p&gt;I wouldn&apos;t say I have many CSS tricks, but I do have a few practical cross-browser-compatible CSS methods I like to make use of.&lt;/p&gt;
&lt;p&gt;I find cross-browser compatibility CSS tips, by far, the most useful of all. What use is CSS when it&apos;s going to force you to create an extra (IE specific) stylesheet?&lt;/p&gt;
&lt;!--more--&gt;
&lt;h2&gt;The fight against padding&lt;/h2&gt;
&lt;p&gt;HTML emails have slightly changed the way I develop websites. It&apos;s made me very wary of padding, because it&apos;s not well supported across all email clients.
I try to avoid the &apos;padding&apos; property when possible... You may be thinking: &apos;Why? Browser&apos;s aren&apos;t email clients and padding is well supported&apos;. Well, Because the &lt;a href=&quot;http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug&quot;&gt;IE box model&lt;/a&gt; is different to the W3C box model. So &lt;strong&gt;yes&lt;/strong&gt;, padding is well supported by basically all popular browsers, but the W3C box model isn&apos;t, therefore, padding - As it should work - isn&apos;t supported by all browsers. The doctype does solve a lot of cross browser issues, however, I like to make my sites as rock-solid as possible.&lt;/p&gt;
&lt;p&gt;This is not to say I don&apos;t use padding - I use it all the time. I try to avoid it where I can though. This is generally while I&apos;m styling navigation menus, &lt;code class=&quot;language-text&quot;&gt;&amp;lt;h1&gt;&lt;/code&gt; tags, &lt;code class=&quot;language-text&quot;&gt;&amp;lt;h2&gt;&lt;/code&gt; tags, etc. Also, I try to substitute the &apos;margin&apos; property for &apos;padding&apos; when possible.&lt;/p&gt;
&lt;h2&gt;text-indent VS padding&lt;/h2&gt;
&lt;p&gt;Text indent isn&apos;t used very often, but it&apos;s extremely well supported. It&apos;s even &lt;a href=&quot;http://www.campaignmonitor.com/css/&quot;&gt;supported by almost every email client&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;I tend to think that using &apos;text-indent&apos; is a no-brainer when it comes to certain situations, such as the examples below.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 100px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/e5f062045bb8d4ab4f2b0921625dea72/7e516/menu-example.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 164%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAhCAYAAADZPosTAAAACXBIWXMAAAsTAAALEwEAmpwYAAADBklEQVR42u2WR0tkQRSF32J+2mzcuXTnRkERDCDiwoUgBhRFBTMoIrowBwwYNiYwRwRBbQP9us0J3MziDN+FEsd59rxhejkNpyvdunXrvjqnyovH47q+vtbt7a1ubm4M9FHST/1v4DEpGo3q9PRUkUhE5+fn5ujy8vKvnZlDIsFZc3OzysvL1dLSosbGRlVXV6u2tlaVlZVaXl7W/f29YrFYeIcLCwsaGBgwx01NTRodHVVbW5tKS0u1ubmpu7u78A4BOXx8fLRJROPalKTA2f0J3tnZmQBRnpycWOnqru1swsDb2NjQ+vq6tre3Dbu7u9rb2zPs7OxYe2trS9iFgTk8OjpSR0eH5a+zs1NjY2Pq7+/X3NycWltbNTQ0pIODA8slzhPBI6q1tTUVFxcrKytLeXl5ys7OVmFhoXJzc5WRkaHe3l4dHh5aBKEcrq6uanFxUbOzsxbZzMyMpqamND4+rpGRES0tLVk6QkVI/qgwgZwRCfnb39+3kq0yhl2oHF5cXBg7YIvv+6INYAp9lG6cI0Xd2QTBqPfw8GDeV1ZWdHV1ZY6ZyBahI+N8OGw44InOpcfBPT4+tsTzVfnS0K2qqspYUldXp5KSEvv6PT09dthZ8Eum8IfB5OSkBgcH1dfXp+7ubk1MTNhRamhoMKdQkQUJIBEFPbbz/PxsK4Onpye9vr4aXl5ebOzt7c3oyBj2zjYIRBj5DN/33+HaQXZB8P7//v0n6VsykfwI4/H492TCc4c4WfBisdgP3/ff4dqujEajgeP0U/8MHJqCQCnoRd0BKjlaOhu4jB20DHpZeBgipkgTQopccXshX1xQqDYCTB929HNlICJBIuGx0vDwsPLz85WZmam0tDQVFRUpJSXF7pT09HTl5OQYCgoKTMLQSe4eBNW9hX5RG+6M+fl5eymgg/X19bZATU2NKioqTM66urqUmpqq9vZ2TU9Pq6yszLb/W4SE7dTW5QogVUxwbfLG9rljqKOhQUJrAotTgMHH+kfQ554mrv2lYoeFu6gSPZZ+AnDIjubUw7JxAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;menu-example&quot;
        title=&quot;&quot;
        src=&quot;/static/e5f062045bb8d4ab4f2b0921625dea72/7e516/menu-example.png&quot;
        srcset=&quot;/static/e5f062045bb8d4ab4f2b0921625dea72/7e516/menu-example.png 100w&quot;
        sizes=&quot;(max-width: 100px) 100vw, 100px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I would, however, use left and right padding for a navigation menu like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/bcf6246af7cb1ddea496ac33a8582286/hotizontal-menu.gif&quot; alt=&quot;hotizontal-menu&quot;&gt;&lt;/p&gt;
&lt;p&gt;Not only is it beneficial to use text-indent for padding to solve browser problems, but it can actually simplify your life a whole lot more...&lt;/p&gt;
&lt;p&gt;If you have a set width of &lt;code class=&quot;language-text&quot;&gt;200px&lt;/code&gt; and then add a &lt;code class=&quot;language-text&quot;&gt;20px&lt;/code&gt; left padding, the total element size would be &lt;code class=&quot;language-text&quot;&gt;220px&lt;/code&gt;. It&apos;s possible to solve this problem by changing the width to &lt;code class=&quot;language-text&quot;&gt;180px&lt;/code&gt;, but I find this very annoying as the width has to be changed every time the padding is changed. Text-indent solves this absolutely wonderfully.&lt;/p&gt;
&lt;h2&gt;line-height VS padding&lt;/h2&gt;
&lt;p&gt;Line-height is simple way to centre a word or a line of text such as a heading. You can also be sure that it will display perfectly consistent across all browsers.&lt;/p&gt;
&lt;h2&gt;overflow: hidden&lt;/h2&gt;
&lt;p&gt;This is one of my favourite properties. How often do you have an image floated to the left or right with text wrapping around it? Here is an example:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/e0cda9297edf2983df3e2b0c50e9a4ee/overflow-none.gif&quot; alt=&quot;overflow-none&quot;&gt;&lt;/p&gt;
&lt;p&gt;There are many cases where this is not the desired effect. How do we fix this? Are extra divs necessary? Are properties such as &apos;width&apos; required?&lt;/p&gt;
&lt;p&gt;No.&lt;/p&gt;
&lt;p&gt;All you need to do is to add &apos;overflow: hidden;&apos; to the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt; element. - &lt;code class=&quot;language-text&quot;&gt;p {overflow: hidden;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/3f067cfaa9dc3fe41256295373ac8393/overflow-hidden.gif&quot; alt=&quot;overflow-hidden&quot;&gt;&lt;/p&gt;
&lt;p&gt;How ridiculously simple was that?&lt;/p&gt;
&lt;h2&gt;The Conclusion&lt;/h2&gt;
&lt;p&gt;It&apos;s absolutely OK to use padding and ignore everything I&apos;ve been ranting on about. I&apos;ve just found my methods work for me and I&apos;ve decided to share some of them.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Create a simple jQuery looped timer]]></title><description><![CDATA[Timers are useful things to have in your javascript toolbox of tricks. Common examples of looped timers are carousel plugins. These normally…]]></description><link>https://css-plus.com/2010/09/create-a-simple-jquery-looped-timer</link><guid isPermaLink="false">https://css-plus.com/2010/09/create-a-simple-jquery-looped-timer</guid><pubDate>Tue, 07 Sep 2010 00:00:00 GMT</pubDate><content:encoded>&lt;!-- TODO: internal link --&gt;
&lt;p&gt;Timers are useful things to have in your javascript toolbox of tricks. Common examples of looped timers are carousel plugins. These normally have a couple of options, and often one of them is to have the carousel window change every &lt;em&gt;--insert amount of seconds here--&lt;/em&gt; seconds. This is basically what we&apos;re going to go through during this tutorial.&lt;/p&gt;
&lt;p&gt;This timer isn&apos;t going to be doing anything crazy, it&apos;s merely going to rotate between &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt; tags every second. The rest is up to you and your imagination.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;I&apos;m going to keep this tutorial as simple as possible with regards to the HTML and CSS. This is the kind of thing I&apos;m going to include within the Snippets section once it goes live.&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;example&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;A&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;different&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;word&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;appears&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;every&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;one&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;second!&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you can see, this is absolute basic markup, nothing much to explain here.&lt;/p&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; white&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2px solid #333&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 100px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#example p&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #333&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; bold&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; center&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#example p:first-child&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The CSS is just styling the markup in a very basic manner.
&lt;code class=&quot;language-text&quot;&gt;#example p&lt;/code&gt; is set to &lt;code class=&quot;language-text&quot;&gt;display: none&lt;/code&gt; so that the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt; elements aren&apos;t visible until the javascript needs it. We&apos;ve added the &lt;code class=&quot;language-text&quot;&gt;:first-child&lt;/code&gt; pseudo class as a fallback in case the user&apos;s browser doesn&apos;t have javascript enabled. If javascript is disabled, the first &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt; element will be visible as opposed to nothing at all.&lt;/p&gt;
&lt;h2&gt;The jQuery/Javascript&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#example p:first&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;block&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    jQuery&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;fn&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function-variable function&quot;&gt;timer&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p:last-child&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;is&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;block&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p:first&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;block&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// timer function end&lt;/span&gt;

    window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;setInterval&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#example&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;timer&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Make sure the first &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt; element is visible&lt;/li&gt;
&lt;li&gt;Function &quot;timer&quot; is &lt;a href=&quot;/2010/save-time-define-a-function/&quot;&gt;defined&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;If the last-child &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt; element is NOT visible&lt;/li&gt;
&lt;li&gt;Target the visible &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt; element, set it&apos;s display to none and set the very next &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt; element&apos;s &lt;code class=&quot;language-text&quot;&gt;display&lt;/code&gt; to &lt;code class=&quot;language-text&quot;&gt;block&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Or else&lt;/li&gt;
&lt;li&gt;Target the visible &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Set it&apos;s &lt;code class=&quot;language-text&quot;&gt;display&lt;/code&gt; to &lt;code class=&quot;language-text&quot;&gt;none&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Target the first &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt; element set it&apos;s &lt;code class=&quot;language-text&quot;&gt;display&lt;/code&gt; to &lt;code class=&quot;language-text&quot;&gt;block&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Set the repeat interval of &lt;code class=&quot;language-text&quot;&gt;$(&quot;#example&quot;).timer()&lt;/code&gt;; to &lt;code class=&quot;language-text&quot;&gt;1000&lt;/code&gt; milliseconds (1 second)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you don&apos;t already know, I&apos;m slowly creating a jQuery carousel plugin and these little tutorials are things which I&apos;ve ended up needing to include in the plugin.&lt;/p&gt;
&lt;p&gt;If you have any questions or comments, feel free to leave them in the comment section below.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Tweaking CSS-Plus]]></title><description><![CDATA[You might notice that one or two things look a bit out of place – This is probably because they are! I’m going to be adding new features to…]]></description><link>https://css-plus.com/2010/08/tweaking-css-plus</link><guid isPermaLink="false">https://css-plus.com/2010/08/tweaking-css-plus</guid><pubDate>Sat, 28 Aug 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;You might notice that one or two things look a bit out of place – This is probably because they are!&lt;/p&gt;
&lt;p&gt;I’m going to be adding new features to the site, such as a Request page, where you can request tutorials, freebies or articles and a few other tweaks to make the site a bit easier to navigate and make it a bit more interesting in general.&lt;/p&gt;
&lt;p&gt;I am planning on completely redesigning CSS-Plus, but first I’m going to add the functionality that I would like to see on the next theme onto the current theme. This will let me know if it will work and/or if it is worth doing.&lt;/p&gt;
&lt;p&gt;If you have any comments or suggestions, feel free to leave a comment below.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Basic CSS Selectors you're missing out on]]></title><description><![CDATA[This article isn't about CSS selectors that you should be using and you don't know it yet... It's about CSS selectors you might not know…]]></description><link>https://css-plus.com/2010/08/basic-css-selectors-you-are-missing-out-on</link><guid isPermaLink="false">https://css-plus.com/2010/08/basic-css-selectors-you-are-missing-out-on</guid><pubDate>Thu, 19 Aug 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;This article isn&apos;t about CSS selectors that you should be using and you don&apos;t know it yet... It&apos;s about CSS selectors you might not know about because 1 or 2 popular browsers don&apos;t support them.&lt;/p&gt;
&lt;p&gt;Basic CSS selectors are extremely useful... Unfortunately they are not well supported cross-browser. When I say &quot;not well supported&quot;, I&apos;m not even referring to CSS3 selectors.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;CSS 2.1 is not properly supported by IE 6 or 7. Due to this issue, we are forced to stay away from these selectors almost as much as we &apos;avoid&apos; CSS3.&lt;/p&gt;
&lt;h2&gt;Properties we can&apos;t wait to use&lt;/h2&gt;
&lt;p&gt;There are entire basic properties we have to stay away from - &lt;em&gt;Such as &lt;code class=&quot;language-text&quot;&gt;outline&lt;/code&gt; which basically functions as a border to &lt;code class=&quot;language-text&quot;&gt;border&lt;/code&gt;&lt;/em&gt; - let alone values we can&apos;t rely on (I was planning on mentioning them, but there are just too many).
There is so much we could do with these properties and/or values.
As I&apos;ve noticed, a lot of us do use some of these &apos;unsupported&apos; properties - Such as CSS3 properties like &lt;code class=&quot;language-text&quot;&gt;box-shadow&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;border-radius&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;text-shadow&lt;/code&gt;, etc. but we use this as progressive enhancement.&lt;/p&gt;
&lt;h2&gt;Selectors we dream about&lt;/h2&gt;
&lt;p&gt;CSS selectors can&apos;t really be used as progressive enhancement. Selectors are not used without properties. Therefore the properties declared would also be considered as progressive enhancement whether or not they are supported by the browser.
For example:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;/* This #example-1 example is a common of progressive enhancement. The layout does not change */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#example-1&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 5px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* This selector affects the first &amp;lt;img&gt; sibling element that follows #example-2 */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#example-2 + img&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3px solid #fff&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 5px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In the example above, &lt;code class=&quot;language-text&quot;&gt;#example-1&lt;/code&gt; will progressively enhance the element, whereas &lt;code class=&quot;language-text&quot;&gt;#example-2&lt;/code&gt; has completely changed the layout.&lt;/p&gt;
&lt;p&gt;This is the reason unsupported CSS selectors have to be avoided more than CSS3 properties.
It&apos;s quite amusing how we&apos;ve had these powerful CSS selectors within grasp for years now, yet we use them less than we use the latest properties.&lt;/p&gt;
&lt;p&gt;This is not to say that you can&apos;t use selectors and common properties as progressive enhancement. For example:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;li:nth-child(2n)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; red&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Yes yes, I know this is not a pseudo-class, but it acts as a selector.
This will create the even/odd background effect which will only be seen on browsers that support this CSS3 selector. Unsupported selectors can be used as progressive enhancement, depending on the properties used within them.&lt;/p&gt;
&lt;h2&gt;Pseudo classes are boring&lt;/h2&gt;
&lt;p&gt;Pseudo classes are the new in thing, but I&apos;m really into the basic, unused &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors&quot;&gt;selectors&lt;/a&gt;, such as:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;/* Selects the first &amp;lt;ul&gt; sibling element to follow a &amp;lt;p&gt; element */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;p + ul&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; red&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* Selects elements that have both classes &apos;foo&apos; and &apos;bar&apos; such as &amp;lt;div class=&quot;foo bar&quot;&gt;&amp;lt;/div&gt; */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.foo.bar&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; red&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* Selects input elements that have the attribute &apos;type=&quot;submit&quot;&apos; */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;input[type=&quot;submit&quot;]&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; red&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* Selects &amp;lt;a&gt; links that are child elements of &amp;lt;li&gt; elements */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;li &gt; a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; red&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;IE6 doesn&apos;t support any of those, whereas IE7 support all except for &lt;code class=&quot;language-text&quot;&gt;p + ul&lt;/code&gt; - And because of this I&apos;ve started using them more and more often.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Save time - Define a function]]></title><description><![CDATA[Functions save you time - And if you didn't know that, you should probably get on the function band wagon. Functions are shortcuts. They…]]></description><link>https://css-plus.com/2010/08/save-time-define-a-function</link><guid isPermaLink="false">https://css-plus.com/2010/08/save-time-define-a-function</guid><pubDate>Wed, 11 Aug 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Functions save you time - And if you didn&apos;t know that, you should probably get on the function band wagon.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;Functions are shortcuts. They:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Save you time&lt;/li&gt;
&lt;li&gt;Save you the hassle of rewriting code you have already typed&lt;/li&gt;
&lt;li&gt;Make it easier to read the code&lt;/li&gt;
&lt;li&gt;Make it easier to manage and update the code&lt;/li&gt;
&lt;li&gt;Reduce errors and trouble-shooting&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is, however, a time waster to create a function for something when it is not needed. As developers, we should think ahead and decide when it would be appropriate to create our own jQuery functions.
Recently, I created a piece of javascript which I needed and found useful. I needed to use that same snippet with slight modifications.
I copied and pasted the code, which suddenly started filling up my screen, but I thought nothing of it... Until... I had to copy and paste it again. I decided that it was far from acceptable to do this so I turned it into a simple function which I now use in almost every project.&lt;/p&gt;
&lt;p&gt;We&apos;ll start off by going over HOW to define our own functions and then into creating a function that could benefit us in future.&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;form action=&quot;&quot;&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt; &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;fieldset&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt; &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;legend&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;Example Form&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/legend&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt; &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;input type=&quot;text&quot; /&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt; &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;input
type=&quot;submit&quot; value=&quot;Submit&quot;/&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt; &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/fieldset&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt; &lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;lt;&quot;&gt;&amp;amp;lt;&lt;/span&gt;/form&lt;span class=&quot;token entity named-entity&quot; title=&quot;&amp;gt;&quot;&gt;&amp;amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It&apos;s a pretty simple form. This HTML isn&apos;t very important right now, what is important is the javascript! - Because of this I&apos;m not going to style it and jump right into the javascript instead.&lt;/p&gt;
&lt;h2&gt;The jQuery/Javascript&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Declare function &apos;bgColor&apos;&lt;/span&gt;
jQuery&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;fn&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function-variable function&quot;&gt;bgColor&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;yourColor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;background&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; yourColor&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;// When the DOM is ready&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;input&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;bgColor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;green&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What we&apos;ve done is declare the function &lt;code class=&quot;language-text&quot;&gt;bgColor&lt;/code&gt;. You can obviously call it anything you want, but you should try and make sure your functions have a unique (to avoid conflicts) and descriptive name. I&apos;ve called it &lt;code class=&quot;language-text&quot;&gt;bgColor&lt;/code&gt; because, as you have guessed, it changes the background color of the targeted element.
&lt;code class=&quot;language-text&quot;&gt;jQuery.fn.bgColor = function(yourColor) {&lt;/code&gt; - If you haven&apos;t created a jQuery function before, this line is probably the most tricky.
What it is saying is:
The function &lt;code class=&quot;language-text&quot;&gt;bgColor&lt;/code&gt; is equal to whatever is within the function.
The variable &apos;yourColor&apos; is defined by the user by typing a value within the defined-function&apos;s brackets. In this case &lt;code class=&quot;language-text&quot;&gt;.bgColor(&quot;green&quot;)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Any value that would be a valid in this situation:
&lt;code class=&quot;language-text&quot;&gt;.css(&quot;background&quot;, yourColor);&lt;/code&gt;
would now be valid in this situation:
&lt;code class=&quot;language-text&quot;&gt;.bgColor(yourColor)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;But turning something already very short into something slightly shorter doesn&apos;t really help anyone too much. So let&apos;s put this newly learnt skill to use.&lt;/p&gt;
&lt;p&gt;I&apos;m not sure what you call this &quot;trick&quot;, but it&apos;s when there is text within an input-field, and it disappears when you focus on the field, and comes back when it loses focus if there is no value in the field.
Anyway, let&apos;s get started with the jQuery.&lt;/p&gt;
&lt;p&gt;Also, on a side note, it is important to use &lt;code class=&quot;language-text&quot;&gt;$(this)&lt;/code&gt; a lot because it will be affecting the element you choose, as opposed to a preset element.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Define the function - In this case, &quot;inputValue&quot;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;// We will use the variable &quot;value&quot; - Defined by the user - throughout the function&lt;/span&gt;
jQuery&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;fn&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function-variable function&quot;&gt;inputValue&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// Target this value and replace it with the variable &apos;value&apos; defined by the user&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;value&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;focus&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// If this value is equal to the variable&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; value&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// Remove the text&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// When the focus is lost&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;blur&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// If there is no value&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// Replace this with the variable&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;value&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// Else do nothing&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That&apos;s it, we have a defined variable. Now all we need to do is actually test it.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&apos;form input[type=&quot;text&quot;]&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;inputValue&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Example Value!&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And there you have it. A simple and useful function you will probably use over and over... I know I do.&lt;/p&gt;
&lt;p&gt;If you don&apos;t already create your own functions, I hope this inspires you to start!&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Create an infinite polaroid image viewer with jQuery]]></title><description><![CDATA[The name of the tutorial might be a bit confusing, so I'll start by clearing it up. Infinite - Refers to the fact that if you click the…]]></description><link>https://css-plus.com/2010/07/create-an-infinite-polaroid-image-viewer-with-jquery</link><guid isPermaLink="false">https://css-plus.com/2010/07/create-an-infinite-polaroid-image-viewer-with-jquery</guid><pubDate>Mon, 26 Jul 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The name of the tutorial might be a bit confusing, so I&apos;ll start by clearing it up.&lt;/p&gt;
&lt;p&gt;Infinite - Refers to the fact that if you click the &quot;next button&quot; on the last slide, it loops to the first image, and vice-versa with the &quot;previous button&quot;. (Achieved with jQuery javascript)
Polaroid - Refers to the look (achieved with CSS)
Image Viewer - I was going to use &quot;Carousel&quot;, however, this doesn&apos;t really slide... It fades. So &quot;Image Viewer&quot; found a place in the title. (Achieved with jQuery javascript)&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;I like image/content sliders, however, they are always so complicated: Divs within divs containing unordered lists, list items, anchor links and span tags.
This Infinite Polaroid Image Viewer works on a single div containing &lt;code class=&quot;language-text&quot;&gt;&amp;lt;img&gt;&lt;/code&gt; tags. The caption text is taken from &lt;code class=&quot;language-text&quot;&gt;&amp;lt;img&gt;&lt;/code&gt; alt tags. Also, this is designed to look decent without CSS3 and with javascript turned off.&lt;/p&gt;
&lt;p&gt;Let&apos;s get started.&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;p&gt;What exactly is needed besides the div#polaroid?
Yes, you guessed it, the controls and caption area. The caption area is not necessary without javascript (since this won&apos;t work at all without it) so it would be best to inject it using javascript. It is added in the HTML below, however we will remove it at a later stage to minimize the markup.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;polaroid&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;People at a bar&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/image-1.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Tree and Dam&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value css language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/image-2.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Puppy&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value css language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/image-3.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Clouds&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token special-attr&quot;&gt;&lt;span class=&quot;token attr-name&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token value css language-css&quot;&gt;&lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/image-4.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;polaroid-caption&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;prev&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;next&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;caption&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I don&apos;t think we could work with much less markup, and because of this, there really much to explain about the HTML. It&apos;s very straightforward:
We will be able to cycle through the images included within the #polaroid div.&lt;/p&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;p&gt;We&apos;re going to do the obvious styling with the CSS, including some CSS3 and a fall-back in case javascript is turned off.
We&apos;ve added some inline styling to the images in the HTML. This is done to make sure only one image is shown if the javascript is turned off.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#polaroid&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #ededed&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0 0 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 15px 15px 0 15px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 500px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#polaroid img&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 500px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 380px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#polaroid-caption&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #000&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #ededed&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 40px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0 0 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 30px 15px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 500px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* Caption and controls */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#polaroid-caption a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #000&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#polaroid-caption p.caption&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; bold&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; center&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#prev,
#next&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 24px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 14px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#prev&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/prev.jpg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; no-repeat left top&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#next&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/next.jpg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; no-repeat left top&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; right&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* css3 */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#polaroid&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-top-left-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-top-right-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-border-radius-topleft&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-border-radius-topright&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-border-top-left-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-border-top-right-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#polaroid-caption&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-bottom-left-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-bottom-right-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-border-radius-bottomleft&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-border-radius-bottomright&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-border-bottom-left-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-border-bottom-right-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;The jQuery Javascript&lt;/h3&gt;
&lt;p&gt;Alright, now it&apos;s time for the cool part javascript:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;after&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&apos;&amp;lt;div id=&quot;polaroid-caption&quot;&gt;&amp;lt;a id=&quot;prev&quot; href=&quot;#&quot;&gt;&amp;lt;/a&gt;&amp;lt;a id=&quot;next&quot; href=&quot;#&gt;&amp;lt;/a&gt;&amp;lt;p class=&quot;caption&quot;&gt;&amp;lt;/p&gt;&amp;lt;/div&gt;&apos;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p.caption&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;attr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;alt&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// Next controls&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#next&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:last&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;is&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeOut&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:first&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeIn&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p.caption&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;attr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;alt&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeOut&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeIn&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p.caption&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;attr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;alt&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// Previous controls&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#prev&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:first&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;is&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeOut&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:last&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeIn&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p.caption&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;attr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;alt&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeOut&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;prev&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeIn&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p.caption&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#polaroid img:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;attr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;alt&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What it&apos;s &quot;saying&quot; is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;firstly, make sure that &lt;code class=&quot;language-text&quot;&gt;p.caption&lt;/code&gt;&apos;s text is that of the visible image&apos;s alt attribute.&lt;/li&gt;
&lt;li&gt;When &quot;next&quot; is clicked, if the last image is visible, fade out this image and once that is done, fade in the first image and make sure that p.caption&apos;s text is that of the visible image&apos;s alt attribute.&lt;/li&gt;
&lt;li&gt;Else, if this is not the case, fade out the visible image and once this is done, fade in the next image and and make sure that p.caption&apos;s text is that of the visible image&apos;s alt attribute.&lt;/li&gt;
&lt;li&gt;Return false makes sure that the anchor link doesn&apos;t act as a normal link.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The &quot;previous&quot; controls work the same, but in reverse.&lt;/p&gt;
&lt;p&gt;Pretty cool, right?
I find it very simple, and the simplicity makes it very nice to work with.&lt;/p&gt;
&lt;p&gt;I hope you enjoyed the tutorial and if you have any questions or anything to say, feel free to leave a comment.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Forms, jQuery and CSS3]]></title><description><![CDATA[Everyone needs to create a form at one point or another and I've got a few rules I generally stick to when designing and developing forms in…]]></description><link>https://css-plus.com/2010/07/forms-jquery-and-css3</link><guid isPermaLink="false">https://css-plus.com/2010/07/forms-jquery-and-css3</guid><pubDate>Mon, 05 Jul 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Everyone needs to create a form at one point or another and I&apos;ve got a few rules I generally stick to when designing and developing forms in general.&lt;/p&gt;
&lt;p&gt;Before we get started on actually coding the form, let&apos;s recap on the dos and don&apos;ts of forms&lt;/p&gt;
&lt;h2&gt;It should be simple&lt;/h2&gt;
&lt;h3&gt;It can get complicated quite quickly&lt;/h3&gt;
&lt;p&gt;This could confuse you and/or the user. If the user gets confused, lost or overwhelmed, there is a high chance that he/she will close the page and you will have lost a potential customer/submitter.&lt;/p&gt;
&lt;h3&gt;Avoid overwhelming the user&lt;/h3&gt;
&lt;p&gt;Don&apos;t give the user unnecessary options, such as &quot;Fill this in if you have chose option B&quot;. Rather have an extra field fade in or pop-up if a certain option was chosen. Create a mini wizard if it is appropriate.&lt;/p&gt;
&lt;h3&gt;Validation syndrome&lt;/h3&gt;
&lt;p&gt;Don&apos;t add captchas, validate the names, surnames, telephone numbers and emails unless you are getting spammed with false information all the time. Validation is there to help the user as well as obtain valid information, so don&apos;t give the users a bad user experience.&lt;/p&gt;
&lt;h2&gt;Be wise, Optimize&lt;/h2&gt;
&lt;h3&gt;The content should be efficient.&lt;/h3&gt;
&lt;p&gt;Don&apos;t ask for unnecessary information. The longer it takes for the person to complete the form, the higher the chance is that he/she may leave.&lt;/p&gt;
&lt;h3&gt;The HTML should be as simple as possible. - Semantic markup makes your browser smile&lt;/h3&gt;
&lt;p&gt;don&apos;t use &lt;code class=&quot;language-text&quot;&gt;&amp;lt;div&gt;&lt;/code&gt;s when you &lt;a href=&quot;http://www.nodivs.com&quot;&gt;don&apos;t need to&lt;/a&gt; I&apos;ve found pre-defined elements work better cross-browser than divs. We have &lt;code class=&quot;language-text&quot;&gt;&amp;lt;form&gt;&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;&amp;lt;fieldset&gt;&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;&amp;lt;legend&gt;&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;&amp;lt;label&gt;&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;&amp;lt;input&gt;&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;&amp;lt;select&gt;&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;&amp;lt;option&gt;&lt;/code&gt; to work with. They were created for a reason, use them.&lt;/p&gt;
&lt;h2&gt;Visually appealing&lt;/h2&gt;
&lt;h3&gt;Don&apos;t over do the CSS3&lt;/h3&gt;
&lt;p&gt;Sometimes people inappropriately overdo the drop/text-shadow and it gives me the impression that the site was designed by an amateur developer.&lt;/p&gt;
&lt;h3&gt;Be subtle&lt;/h3&gt;
&lt;p&gt;You could use drop shadows, text-shadows, rounded corners, hover and focus events, etc. every single time you develop anything, but be subtle. A drop-shadow or text-shadow that is barely noticible at first could make a whole world of difference to the atmosphere of the web-page.&lt;/p&gt;
&lt;p&gt;Now that we have the basics down, let&apos;s get started.&lt;/p&gt;
&lt;h2&gt;The plan&lt;/h2&gt;
&lt;p&gt;My plan is to create a wizard-type form - with next and previous buttons - in order to add an element of simplicity. Basically, I&apos;m going to follow the above &apos;tips&apos; and use them while I create this form.&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;form&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;fieldset&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;legend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Step One&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;legend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;label&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;name&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Name:&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;label&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;input&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;name&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;name&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;20&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;

        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;label&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;email&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Email:&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;label&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;input&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;email&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;email&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;25&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;fieldset&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;fieldset&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;legend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Step Two&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;legend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;label&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;company&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Company:&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;label&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;input&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;company&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;company&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;20&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;

        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;label&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;tel-no&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Tel No:&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;label&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;input&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;tel-no&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;tel-no&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;20&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;

        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;label&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;fax-no&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Fax No:&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;label&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;input&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;fax-no&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;fax-no&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;20&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;fieldset&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;fieldset&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;legend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Step Three&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;legend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;label&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;country&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Country:&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;label&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;input&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;country&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;country&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;20&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;

        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;label&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;address&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Address:&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;label&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;input&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;address&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;address&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;20&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;

        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;label&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;state&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;State:&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;label&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;select&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;state&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;state&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;option&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Option one&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Option one&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;option&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;option&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Option two&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Option two&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;option&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;option&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Option three&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Option three&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;option&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;select&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;br&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;clear&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;

        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;input&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;submit&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;submit&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Submit&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;fieldset&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;form&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The HTML is fairly simple. I&apos;ve added the for, name and id attributes because it&apos;s more semantic to do so than to leave it out.&lt;/p&gt;
&lt;p&gt;The form has the empty attribute &apos;action&apos; because every form has to have an action. If the action attribute is not added, the page will not &lt;a href=&quot;http://validator.w3.org/&quot;&gt;validate&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A legend is the heading text on top of the border. It requires no styling (from us) in order to achieve this effect cross-browser. All that is needed is a &lt;code class=&quot;language-text&quot;&gt;&amp;lt;legend&gt;&lt;/code&gt; within a &lt;code class=&quot;language-text&quot;&gt;&amp;lt;fieldset&gt;&lt;/code&gt;. Pretty decent, right?&lt;/p&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;form&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 760px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #827254&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2px solid #c7b795&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0 20px 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 15px 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset.submit&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset legend&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #fff&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; bold&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 4px 4px 7px #4d412a&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset input&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1px solid #516764&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-right-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #504532&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-bottom-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #504532&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 25px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 25px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 20px 0 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 2px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset input:last-child&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset input:focus&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1px solid #4d412a&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset label&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 10px 0 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset input[type=&quot;submit&quot;]&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #827254&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3px solid #585246&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #e5d8b9&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; pointer&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 15px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px 0 0 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 4px 6px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset input[type=&quot;submit&quot;]:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #fff&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/*
	Navigation
*/&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;div.nav&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 200px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#prev,
#next&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #827254&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3px solid #585246&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #e5d8b9&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; pointer&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 15px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px 0 0 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 4px 6px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; center&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 65px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#prev&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#next&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; right&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#prev:hover,
#next:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #fff&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/*
	CSS3
*/&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset,
fieldset input,
#prev,
#next&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 5px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 5px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; inset 0 0 10px #4d412a&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; inset 0 0 10px #4d412a&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; inset 0 0 10px #4d412a&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset input:focus&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; inset 0 0 7px #a4a4a4&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; inset 0 0 7px #a4a4a4&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; inset 0 0 7px #a4a4a4&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset input[type=&quot;submit&quot;]:hover,
#prev:hover,
#next:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0 5px #5f553e&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In general, I don&apos;t usually use black as a drop-shadow colour. I normally find a darker tone of the background colour and use that.&lt;/p&gt;
&lt;p&gt;As you can see, along with CSS3, I&apos;ve used the &lt;code class=&quot;language-text&quot;&gt;selector[type=&quot;submit&quot;]&lt;/code&gt; selector. IE 6 and 7 have a few problems with this (Don&apos;t they always), but I&apos;ve made sure it gracefully degrades.&lt;/p&gt;
&lt;p&gt;And here is the IE specific stylesheet:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;form&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 780px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;The jQuery Javascript&lt;/h3&gt;
&lt;p&gt;I tend to create the javascript after I have completed the HTML and CSS. That way I know that the page will be functional without javascript.&lt;/p&gt;
&lt;p&gt;The first thing I&apos;m going to do is remove div#nav from the HTML and inject that into the page via javascript, as it will be a useless element to include if javascript is disabled.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;form&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;prepend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;token string&quot;&gt;&apos;&amp;lt;div class=&quot;nav&quot;&gt;&amp;lt;a id=&quot;prev&quot; href=&quot;#&quot;&gt;Previous&amp;lt;/a&gt;&amp;lt;a id=&quot;next&quot; href=&quot;#&quot;&gt;Next&amp;lt;/a&gt;&amp;lt;/div&gt;&amp;lt;div class=&quot;clear&quot;&gt;&amp;lt;/div&gt;&apos;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#prev&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;fieldset&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;not&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;:first&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#next&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;fieldset:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeIn&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#prev&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;block&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;fieldset:last&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;is&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#next&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#prev&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;fieldset:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;prev&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeIn&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#next&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;block&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;fieldset:first&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;is&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;:visible&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#prev&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The jQuery is saying:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Target the form and prepend the HTML we typed up earlier&lt;/li&gt;
&lt;li&gt;Target &lt;code class=&quot;language-text&quot;&gt;#prev&lt;/code&gt; and hide it - So that the users can&apos;t click previous while they are on slide one&lt;/li&gt;
&lt;li&gt;Target fieldset, but not the first fieldset, and change the display to none&lt;/li&gt;
&lt;li&gt;When you click on next, hide the visible fieldset, and display the next fieldset&lt;/li&gt;
&lt;li&gt;Whenever next is clicked, the display of &lt;code class=&quot;language-text&quot;&gt;#prev&lt;/code&gt; is changed to block - Because there is never a scenario where &lt;code class=&quot;language-text&quot;&gt;#prev&lt;/code&gt; should be hidden once next is clicked&lt;/li&gt;
&lt;li&gt;When you click on next, hide the visible fieldset, and display the next fieldset&lt;/li&gt;
&lt;li&gt;If the last fieldset is visible, hide the &lt;code class=&quot;language-text&quot;&gt;#next&lt;/code&gt; button in order stop the user from continuing past the last slide&lt;/li&gt;
&lt;li&gt;And finally, if &lt;code class=&quot;language-text&quot;&gt;#prev&lt;/code&gt; is clicked, do the exact opposite of #next&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Pretty cool how jQuery reads so nicely, huh?&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;fieldset&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;not&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;:first&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Target fieldset, not the first, change the CSS display property to none.&lt;/p&gt;
&lt;p&gt;If you have any questions or anything to say, feel free to leave a comment.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to make a jQuery Drop-Down Menu with a CSS fall-back]]></title><description><![CDATA[The biggest problem with javascript is that we can't completely rely on it. It can easily be disabled, and once this happens, websites…]]></description><link>https://css-plus.com/2010/06/how-to-make-a-jquery-drop-down-menu-with-a-css-fall-back</link><guid isPermaLink="false">https://css-plus.com/2010/06/how-to-make-a-jquery-drop-down-menu-with-a-css-fall-back</guid><pubDate>Sun, 20 Jun 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The biggest problem with javascript is that we can&apos;t completely rely on it. It can easily be disabled, and once this happens, websites should still function correctly. Javascript powered sub-navigation menus are a big problem, because if javascript is disabled, your website&apos;s navigation suddenly goes out the door. But fear not, there is a solution!&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;CSS &apos;popups&apos; do exist, but are almost never used (Well, I barely ever see them). Their only problem, is the IE6 and IE7 compatibility. The selectors used to achieve this &apos;popup&apos; effect are not supported in IE6, however it does work in IE7 (With a few bugs, but I&apos;ve got it working nicely in the &lt;a href=&quot;http://css-plus.com/examples/2010/06/create-a-search-form-with-css3-and-jquery/&quot;&gt;demo&lt;/a&gt;). People tend to stay away from this because IE6 doesn&apos;t support it, but I think this is a terrible reason not to use it.&lt;/p&gt;
&lt;p&gt;If we are going to use jQuery/javascript to handle the navigation menu&apos;s &apos;popup&apos; effect, there will be no fallback alternative for any browser. People will just have to live with an incomplete navigation menu. So why not use CSS to achieve this when javascript is turned off? There might be no backup plan for IE6, but it does work with javascript enabled.&lt;/p&gt;
&lt;p&gt;Let&apos;s get started!&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;ul&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;nav&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Home&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Products&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;ul&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;child&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Hard Drives&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Monitors&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Speakers&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;10 watt&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;20 watt&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;30 watt&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Random Equipment&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Services&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;ul&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;child&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Repairs&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Installations&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Setups&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;About&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Contact&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is a very simple nested Unordered List. The second level Unordered List will be hidden until the parent List Item is hovered on and the third level will be revealed once the second level &lt;code class=&quot;language-text&quot;&gt;&amp;lt;li&gt;&lt;/code&gt; is hovered on.&lt;/p&gt;
&lt;p&gt;The classes of &quot;child&quot; and &quot;grandchild&quot; are added to the sub-menus so that the CSS and javascript don&apos;t handle this at the same time. The CSS hover function specifically targets these classes, however, if the javascript is enabled, it will remove these classes in order to reduce conflict.&lt;/p&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;/* Targeting both first and second level menus */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav li&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; relative&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav li a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #d6cfbd&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3px solid #4f4026&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #333&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 5px 0 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 5px 8px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav li a:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #f7f7f7&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-decoration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* Targeting the first level menu */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 35px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 500px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;z-index&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 100&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav &gt; li &gt; a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-top-left-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-top-right-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-border-radius-topleft&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-border-radius-topright&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-border-top-left-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-border-top-right-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* Targeting the second level menu */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav li ul&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #e1ddd3&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3px solid #4f4026&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #333&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -3px 0 0 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 200px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav li ul li&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 100%&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav li ul li a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 30px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0 0 5px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav li ul li a:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #f7f7f7&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* Third level menu */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav li ul li ul&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -200px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* A class of current will be added via jQuery */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav li.current &gt; a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #f7f7f7&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;/* CSS fallback */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav li:hover &gt; ul.child&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#nav li:hover &gt; ul.grandchild&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you can see, there is only one line of CSS needed for the CSS fallback. The style is simply saying: When you hover on an &lt;code class=&quot;language-text&quot;&gt;&amp;lt;li&gt;&lt;/code&gt; element, make it&apos;s children (specifically the ul.child) display as a block.&lt;/p&gt;
&lt;p&gt;The CSS3 properties are only applied to the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;a&gt;&lt;/code&gt; links that are children of the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;li&gt;&lt;/code&gt; which are children of #nav. This is done so that rounded corners are not given to the sub-menu&apos;s &lt;code class=&quot;language-text&quot;&gt;&amp;lt;a&gt;&lt;/code&gt; links.&lt;/p&gt;
&lt;p&gt;Almost there, so far this is a fully functional menu with a sub-menu in IE7+ and all modern browsers.&lt;/p&gt;
&lt;h2&gt;The jQuery/Javascript&lt;/h2&gt;
&lt;p&gt;Now it&apos;s time for some minor fade effects and support in IE6.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// Remove the class of child and grandchild&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// This removes the CSS &apos;falback&apos;&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#nav ul.child&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;removeClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;child&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#nav ul.grandchild&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;removeClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;grandchild&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// When a list item that contains an unordered list&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// is hovered on&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#nav li&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;has&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ul&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;hover&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;//Add a class of current and fade in the sub-menu&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;current&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ul&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeIn&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// On mouse off remove the class of current&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// Stop any sub-menu animation and set its display to none&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;removeClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;current&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ul&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;display&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And that&apos;s it! A cross browser sub-menu with a CSS fallback!&lt;/p&gt;
&lt;p&gt;I can see this being done (with the fade effects) using CSS in the foreseeable future.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Create a Search Form with CSS3 and jQuery]]></title><description><![CDATA[Most websites nowadays have a search form somewhere. I'm pretty sure I don't need to explain why it's a good idea to have a 'search…]]></description><link>https://css-plus.com/2010/06/create-a-search-form-with-css3-and-jquery</link><guid isPermaLink="false">https://css-plus.com/2010/06/create-a-search-form-with-css3-and-jquery</guid><pubDate>Mon, 07 Jun 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Most websites nowadays have a search form somewhere. I&apos;m pretty sure I don&apos;t need to explain why it&apos;s a good idea to have a &apos;search&apos; functionality built into a website and most Content Management Systems already come with the functionality built in. Usually the search area is in an easy to see/find place and it&apos;s because of this reason it&apos;s a good idea for it to look good - Or at least consistent with the rest of the website.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;I immediately notice when a search form looks a out of place because it&apos;s not styled appropriately or at all. It always gives me the impression that the website hasn&apos;t been designed by a professional. Perhaps that thought might not go through every persons mind when they see a poorly designed form, but I&apos;m pretty sure a stylish form will give the website a better appearance overall.&lt;/p&gt;
&lt;h2&gt;What should a search-form contain?&lt;/h2&gt;
&lt;p&gt;There are a few things I like a search-form to have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The search form should be consistent with the rest of the website - Which means that the input-field and submit-button should be styled appropriately.&lt;/li&gt;
&lt;li&gt;I think search forms should have a little &apos;search&apos; image somewhere. Images can help people to know what something is without having to read. It&apos;s pretty common to use a magnifying glass.&lt;/li&gt;
&lt;li&gt;People should know that the search form will do exactly that. So I think it&apos;s a good idea to have the word &apos;Search&apos; next to the form or within it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Two decent examples of search forms are&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://css-tricks.com&quot;&gt;CSS-Tricks&lt;/a&gt;
&lt;img src=&quot;./assets/css-tricks-search-form.jpg&quot; alt=&quot;CSS-Tricks Search-Form&quot;&gt;&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://davidwalsh.name/&quot;&gt;David Walsh Blog&lt;/a&gt;
&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 531px; &quot;
    &gt;
      &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 7.4324324324324325%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAABABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAQC/8QAFgEBAQEAAAAAAAAAAAAAAAAAAgED/9oADAMBAAIQAxAAAAHVRoJAp//EABYQAQEBAAAAAAAAAAAAAAAAAAIxAP/aAAgBAQABBQJU5X//xAAVEQEBAAAAAAAAAAAAAAAAAAABEP/aAAgBAwEBPwEn/8QAFREBAQAAAAAAAAAAAAAAAAAAARD/2gAIAQIBAT8BZ//EABQQAQAAAAAAAAAAAAAAAAAAABD/2gAIAQEABj8Cf//EABcQAAMBAAAAAAAAAAAAAAAAAAAxcQH/2gAIAQEAAT8hFMg2n//aAAwDAQACAAMAAAAQDD//xAAVEQEBAAAAAAAAAAAAAAAAAAAQMf/aAAgBAwEBPxCj/8QAFhEBAQEAAAAAAAAAAAAAAAAAAAEx/9oACAECAQE/EMxH/8QAGRAAAgMBAAAAAAAAAAAAAAAAAAExobFx/9oACAEBAAE/EJOLEVRbaf/Z&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;CSS-Tricks Search-Form&quot;
        title=&quot;&quot;
        src=&quot;/static/7b30a2945903ac23f54a644926a9a098/135f3/david-walsh-search.jpg&quot;
        srcset=&quot;/static/7b30a2945903ac23f54a644926a9a098/a80bd/david-walsh-search.jpg 148w,
/static/7b30a2945903ac23f54a644926a9a098/1c91a/david-walsh-search.jpg 295w,
/static/7b30a2945903ac23f54a644926a9a098/135f3/david-walsh-search.jpg 531w&quot;
        sizes=&quot;(max-width: 531px) 100vw, 531px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;form&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;search-form&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;fieldset&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;input&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;search&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;search&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;input&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;submit&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;search-submit&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;fieldset&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;form&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The HTML is pretty standard. I&apos;ve included &lt;code class=&quot;language-text&quot;&gt;action=&quot;&quot;&lt;/code&gt; because the form will not validate without it and because something should happen once you click submit. So it&apos;s there to remind you to add that php.
&lt;code class=&quot;language-text&quot;&gt;value=&quot;&quot;&lt;/code&gt; has been added to the submit buttons because some browsers like to add the text &lt;code class=&quot;language-text&quot;&gt;submit&lt;/code&gt; to the submit button automatically. This tells the browser not to do that.&lt;/p&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;fieldset&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token selector&quot;&gt;#search-form&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 190px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; relative&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#search&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #b2a48c&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3px solid #402f1d&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #2b1e11&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 150px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2px 4px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 11px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#search-submit&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #b2a48c &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/search.png&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; no-repeat 12px 7px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3px solid #402f1d&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 50px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 50px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token selector&quot;&gt;.empty&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #524630&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* CSS3 */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#search&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;-webkit-gradient&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;linear&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; left top&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; left bottom&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;#b2a48c&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;#9b8d74&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;-moz-linear-gradient&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;top&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; #b2a48c&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; #9b8d74&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0.2&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 0 0 5px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token selector&quot;&gt;#search-submit&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 50px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-moz-border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 50px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 50px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-mox-box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0 5px black&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;/* Webkit-transition */&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-transition-property&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; background-color&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-transition-duration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0.4s&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0.4s&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-transition-timing-function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; linear&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; ease-in&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I generally separate the CSS3 properties from the CSS2.1 like I&apos;ve done above. It&apos;s just how I like writing my CSS.&lt;/p&gt;
&lt;p&gt;The first two lines are a quick css-reset.
I&apos;ve set the input field&apos;s line height to the height of itself so that the text will be forced to be centred in all browsers.
What I&apos;ve done is given the form a set width and given it a relative positioning - The other items have been absolutely positioned so that the search-button can be placed on top of the input field. I&apos;ve done this because I think it looks pretty cool.
The class of .empty was added to change the colour of the placeholder text.&lt;/p&gt;
&lt;p&gt;The &lt;code class=&quot;language-text&quot;&gt;webkit-transition&lt;/code&gt; property is pretty cool. Have a look at the example in Chrome or Safari.&lt;/p&gt;
&lt;p&gt;And that&apos;s about it. The javascript is an optional part of the tutorial to add a little bit more of an &apos;edge&apos; to the form.&lt;/p&gt;
&lt;h2&gt;The jQuery Javascript&lt;/h2&gt;
&lt;p&gt;The javascript is used to achieve the word &quot;Search..&quot; that displays within the input field. If the input field is clicked and it contains the word &quot;Search...&quot;, the input field is then emptied. If the input-field loses the focus and it is empty, the input field&apos;s value is changed back to &quot;Search...&quot;.&lt;/p&gt;
&lt;p&gt;I&apos;m pretty sure you have seen this somewhere before, it&apos;s not really anything new, but it&apos;s a cool little space-saving addition to a search-form.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// Add the value of &quot;Search...&quot; to the input field and a class of .empty&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#search&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Search...&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;empty&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// When you click on #search&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#search&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;focus&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// If the value is equal to &quot;Search...&quot;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Search...&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// remove all the text and the class of .empty&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;removeClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;empty&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;// When the focus on #search is lost&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#search&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;blur&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// If the input field is empty&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// Add the text &quot;Search...&quot; and a class of .empty&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Search...&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;empty&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content:encoded></item><item><title><![CDATA[Implementing fonts with @font-face]]></title><description><![CDATA[This is probably one of the coolest CSS3 features, along with box-shadow and border-radius. @font-face was introduced in CSS2 by IE and it…]]></description><link>https://css-plus.com/2010/05/implementing-fonts-with-font-face</link><guid isPermaLink="false">https://css-plus.com/2010/05/implementing-fonts-with-font-face</guid><pubDate>Tue, 18 May 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;This is probably one of the coolest CSS3 features, along with box-shadow and border-radius. @font-face was introduced in CSS2 by IE and it has been around since IE 5. Most browsers have the ability to use &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face#Font_MIME_Types&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;.otf&lt;/code&gt; or &lt;code class=&quot;language-text&quot;&gt;.ttf&lt;/code&gt;&lt;/a&gt; fonts, however IE has to be difficult - it only supports&lt;code class=&quot;language-text&quot;&gt;.eot&lt;/code&gt; fonts. Luckily it is very easy to implement all of these file types.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;How you say? Well I used to find a &lt;code class=&quot;language-text&quot;&gt;.ttf&lt;/code&gt; or &lt;code class=&quot;language-text&quot;&gt;.otf&lt;/code&gt; file and then try and find a converter in order to convert it to an &lt;a href=&quot;https://en.wikipedia.org/wiki/Embedded_OpenType&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;.eot&lt;/code&gt;&lt;/a&gt; - I never managed to get this to work though. Thankfully, &lt;a href=&quot;http://www.fontsquirrel.com&quot;&gt;fontsquirrel.com&lt;/a&gt; exists. Not only can you find font files to download, but you can download entire @font-face kits, which does absolutely everything for you by giving you the @font-face CSS code, as well as all of the font files you will be needing.&lt;/p&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@font-face&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Chunkfive&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string url&quot;&gt;&quot;../fonts/Chunkfive-webfont.eot#&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;eot&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string url&quot;&gt;&quot;../fonts/Chunkfive-webfont.woff&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;woff&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string url&quot;&gt;&quot;../fonts/Chunkfive-webfont.ttf&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;truetype&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string url&quot;&gt;&quot;../fonts/Chunkfive-webfont.svg#webfontM8M0EYs2&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;svg&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; normal&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; normal&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* Applying it to some text */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Chunkfive&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Arial&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Helvetica&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Sans-Serif&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It is as simple as that! The HTML would simple be a &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt; tag containing some text.
The other fonts that have been called for the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;p&gt;&lt;/code&gt; element are added as a backup in case our newly-added-font doesn&apos;t load for some reason.&lt;/p&gt;
&lt;h2&gt;What is actually going on?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Line 2 - A CSS name for the font has been declared - &quot;Chunk-five&quot;&lt;/li&gt;
&lt;li&gt;Line 3 - The first source file, &lt;code class=&quot;language-text&quot;&gt;.eot&lt;/code&gt;, solves IE&apos;s problems.&lt;/li&gt;
&lt;li&gt;Line 4 - This searches for a local version of the font file and uses it instead of downloading it again.&lt;/li&gt;
&lt;li&gt;Line 5 - &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face#Font_MIME_Types&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;.woff&lt;/code&gt;&lt;/a&gt; files are supported by Firefox 3.6+. This file font type has the ability to be a compressed version of &lt;code class=&quot;language-text&quot;&gt;.otf&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;.ttf&lt;/code&gt; fonts and unlike the latter, .woff fonts can contain meta data.&lt;/li&gt;
&lt;li&gt;Line 6 - The standard &lt;code class=&quot;language-text&quot;&gt;.otf&lt;/code&gt; file is loaded.&lt;/li&gt;
&lt;li&gt;Line 7 - &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/SVG&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;.svg&lt;/code&gt;&lt;/a&gt; fonts are supported by most modern browsers except Internet Explorer. These files are small and a single &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/SVG&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;.svg&lt;/code&gt;&lt;/a&gt; font file can contain multiple types of fonts.&lt;/li&gt;
&lt;li&gt;Line 8 &amp;#x26; 9 - This makes sure that the website knows Chunkfive is the regular text and that when you add font-weight: bold or font-style: italic, it should change shape.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Why are all these fonts included in the CSS you say? They are a backup. They don&apos;t hurt anyone or anything by being included in the CSS, but if one of the files gets deleted or becomes corrupt, the font-file will be swapped out and the website will carry on as usual.&lt;/p&gt;
&lt;p&gt;I have tested these @font-face fonts with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Chrome 4.0 +&lt;/li&gt;
&lt;li&gt;Firefox 3.5 +&lt;/li&gt;
&lt;li&gt;Internet Explorer 5 +&lt;/li&gt;
&lt;li&gt;Opera 10.5 +&lt;/li&gt;
&lt;li&gt;Safari 3.1 +&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you find that this works on an earlier browser version than I have above, let me know and I&apos;ll update the list.&lt;/p&gt;
&lt;h2&gt;!important&lt;/h2&gt;
&lt;p&gt;Make sure you are legally allowed to use the fonts you wish to use on your website! &lt;a href=&quot;http://www.fontsquirrel.com&quot;&gt;fontsquirrel.com&lt;/a&gt; is a great free-font resource, but be sure to read the license agreement attached.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The CSS code doesn&apos;t feel wonderful to type out, but it works in ALL major browsers which is what counts.
I noticed the font looked a tiny bit jagged in IE 8 (IE 7 seemed fine). I solved this by creating an IE8 only stylesheet and I changed the font&apos;s opacity to 90%.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;alpha&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;opacity=90&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In short, I think this is very awesome.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to create an image caption with jQuery]]></title><description><![CDATA[I've been meaning to create an image caption for a while now and instead of putting it off I just decided to do it. This image caption is…]]></description><link>https://css-plus.com/2010/05/how-to-create-an-image-caption-with-jquery</link><guid isPermaLink="false">https://css-plus.com/2010/05/how-to-create-an-image-caption-with-jquery</guid><pubDate>Thu, 13 May 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;ve been meaning to create an image caption for a while now and instead of putting it off I just decided to do it. This image caption is not a plugin - It merely allows you to understand how a jQuery image caption would be created. I will eventually turn it into a plugin with useful options, etc. But for now, this will just have to do.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;Let&apos;s get started:&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;p&gt;The markup is very simple:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;caption&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/image1.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Rainbow and Tree&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;caption&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/image4.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;big&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Pellentesque habitant&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;big&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;morbi tristique senectus et netus.&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you can see, all that is needed is a paragraph tag with a class of &lt;code class=&quot;language-text&quot;&gt;caption&lt;/code&gt; that contains an image and a span tag. The span tag would be the caption information.
If you would like a heading within the caption, just enclose it within a &lt;code class=&quot;language-text&quot;&gt;&amp;lt;big&gt;&lt;/code&gt; tag.&lt;/p&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.clear&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;clear&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; both&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.caption&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block &lt;span class=&quot;token important&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; relative &lt;span class=&quot;token important&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.caption img&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute &lt;span class=&quot;token important&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.caption span&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #000&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0.8&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; white &lt;span class=&quot;token important&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 5px 10px &lt;span class=&quot;token important&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; center&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute &lt;span class=&quot;token important&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 &lt;span class=&quot;token important&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 &lt;span class=&quot;token important&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.caption span big&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; bold&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I&apos;ve thrown quite a few !important&apos;s around to make sure other CSS selectors don&apos;t interfere with it. There isn&apos;t really anything interesting going on within the CSS. The span is set to display none because we only want it to display once we have hovered over the image. So for now, it is display: none.&lt;/p&gt;
&lt;h2&gt;The jQuery&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// For each instance of p.caption&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p.caption&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// Add the following CSS properties and values&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// Height equal to the height of the image&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt;
                    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;img&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;px&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// Width equal to the width of the image&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt;
                    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;img&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;px&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// Select the child &quot;span&quot; of this p.caption&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// Add the following CSS properties and values&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;span&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// Width equal to p.caption&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// But subtract 20px to callibrate for the padding&lt;/span&gt;
                &lt;span class=&quot;token string&quot;&gt;&quot;width&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;20&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;px&quot;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

            &lt;span class=&quot;token comment&quot;&gt;// find the &amp;lt;big&gt; tag if it exists&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// And then add the following div to break the line&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;big&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;after&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&apos;&amp;lt;div class=&quot;clear&quot;&gt;&amp;lt;/div&gt;&apos;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

        &lt;span class=&quot;token comment&quot;&gt;// When you hover over p.caption&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.caption&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;hover&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// Fade in the child &quot;span&quot;&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;span&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeTo&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// Once you mouse off, fade it out&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;span&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;600&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeOut&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It might look quite confusing but it&apos;s all very simple actually. What I&apos;ve had to do is break up the code so that it is readable, otherwise it would all be on one line. Everything is done on a single &lt;code class=&quot;language-text&quot;&gt;$(this)&lt;/code&gt; statement.&lt;/p&gt;
&lt;p&gt;The p.caption element&apos;s width and height are set to the same width and height as the image. That way there is a - {position: relative;} - wrapper and we can make the span tag act as a caption by sticking to the bottom of the image/wrapper.&lt;/p&gt;
&lt;p&gt;Note: On the span tag - padding is definitely needed other wise the text sticks right up against the top and sides. This is the reason width: 100% could not be applied to it within the CSS, otherwise the span would start moving outside of the wrapper. Padding has been used on the span, but this is only because the total span-padding-width has been subtracted from the span&apos;s total width within the javascript.&lt;/p&gt;
&lt;p&gt;Set the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;span&gt;&lt;/code&gt;s width to the width of the image/.caption, but subtract &lt;code class=&quot;language-text&quot;&gt;20&lt;/code&gt; - This &lt;code class=&quot;language-text&quot;&gt;20&lt;/code&gt; refers to the &lt;code class=&quot;language-text&quot;&gt;10px&lt;/code&gt; padding on either side.
&lt;code class=&quot;language-text&quot;&gt;&quot;width&quot;, $(this).width() - 20 + &quot;px&quot;)&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;Finally&lt;/h2&gt;
&lt;p&gt;So far, this image caption works with IE 7+, Opera 10, Webkit browsers and Firefox.
I hope you found this useful.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to add a Gaussian Blur effect to elements within firefox]]></title><description><![CDATA[I have been trying to find an easy, efficient way of applying a Gaussian blur effect to images and elements. I would usually achieve this by…]]></description><link>https://css-plus.com/2010/05/how-to-add-a-gaussian-blur-effect-to-elements-within-firefox</link><guid isPermaLink="false">https://css-plus.com/2010/05/how-to-add-a-gaussian-blur-effect-to-elements-within-firefox</guid><pubDate>Mon, 10 May 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I have been trying to find an easy, efficient way of applying a Gaussian blur effect to images and elements. I would usually achieve this by creating the image with the Gaussian Blur effect already applied. I wouldn&apos;t say this is efficient at all. It is about as efficient as creating rounded corners using images.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;One of the ways to apply a Gaussian blur to elements and images is by making use of the svg filters. It can be applied to any element or image just by adding a bit of code to the HTML and specifying which element you would like to target within the CSS.&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;xmlns:svg=&quot;http://www.w3.org/2000/svg&quot;&lt;/code&gt; must be added to the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;html&gt;&lt;/code&gt; tag. A working example would look like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;html&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;xmlns&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;http://www.w3.org/1999/xhtml&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;&lt;span class=&quot;token namespace&quot;&gt;xmlns:&lt;/span&gt;svg&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;http://www.w3.org/2000/svg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;html&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This allows Firefox to make use of the SVG filters. We also have to add one last bit of HTML to get this thing working.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;body&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Pellentesque habitant morbi tristique senectus&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/gaussian-blur.png&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;

    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;svg:&lt;/span&gt;svg&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;&amp;lt;!-- Filter ID/Name --&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;svg:&lt;/span&gt;filter&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;example-one&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;&amp;lt;!-- Amount of Gaussian Blur that should be applied --&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;svg:&lt;/span&gt;feGaussianBlur&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;stdDeviation&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;0.9&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;svg:&lt;/span&gt;filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;svg:&lt;/span&gt;filter&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;example-two&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;svg:&lt;/span&gt;feGaussianBlur&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;stdDeviation&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;2&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;svg:&lt;/span&gt;filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;token namespace&quot;&gt;svg:&lt;/span&gt;svg&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;body&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;p&gt;The CSS is quite simple and easy to implement. (This must be an INTERNAL stylesheet. - It does not work if it is external, for some reason)&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;style&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/css&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token style&quot;&gt;&lt;span class=&quot;token language-css&quot;&gt;
    &lt;span class=&quot;token selector&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token property&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;#example-one&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;img:hover,
    p:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token property&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;#example-two&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The ID that the url refers to is the ID we set within the svg html section.&lt;/p&gt;
&lt;h2&gt;!important&lt;/h2&gt;
&lt;p&gt;Any problems? - In short, yes. In long, yes.
There are quite a few problems and little annoyances I have come across. Here is a list (There are probably more that I haven&apos;t come across):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The filter only works in Firefox&lt;/li&gt;
&lt;li&gt;The filter only works if the file extension is .xhtml&lt;/li&gt;
&lt;li&gt;IE doesn&apos;t seem to open .xhtml file extensions, it automatically attempts to download it.&lt;/li&gt;
&lt;li&gt;An internal style sheet HAS to be used in order for the svg filter to take effect.&lt;/li&gt;
&lt;li&gt;jQuery doesn&apos;t seem to work properly with .xhtml file extensions. Certain methods that I tried, worked - css(), animate() - and other methods didn&apos;t - html(), prepend(), append().&lt;/li&gt;
&lt;li&gt;The HTML doesn&apos;t validate. Adding the html via jQuery in order to achieve validation doesn&apos;t work since the methods I used to achieve this didn&apos;t work within the .xhtml file&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;I think the effect is very cool and I have fun playing around with it, but I would never use this on an actual web page since there are just too many quirks. For the moment, I think I will stick to images.
If you are interested in applying clip-paths, filters and/or masks within webpages, or if you would just like more information regarding the Gaussian Blur, have a look &lt;a href=&quot;http://weblogs.mozillazine.org/roc/archives/2008/06/applying_svg_ef.html&quot;&gt;weblogs.mozillazine&lt;/a&gt;.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Adding user options to your jQuery plugin]]></title><description><![CDATA[Recently I created a tutorial named How to write a simple jQuery plugin. It is necessary to go through that tutorial if you have no idea how…]]></description><link>https://css-plus.com/2010/05/adding-user-options-to-your-jquery-plugin</link><guid isPermaLink="false">https://css-plus.com/2010/05/adding-user-options-to-your-jquery-plugin</guid><pubDate>Thu, 06 May 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Recently I created a tutorial named &lt;a href=&quot;/blog/how-to-create-a-simple-jquery-plugin/&quot;&gt;How to write a simple jQuery plugin&lt;/a&gt;. It is necessary to go through that tutorial if you have no idea how to create a simple jQuery plugin.
This tutorial will teach you how to create user-friendly-options for the plugin user - Like you have probably seen and used many times before.&lt;/p&gt;
&lt;!--more--&gt;
&lt;h2&gt;Why are options necessary?&lt;/h2&gt;
&lt;p&gt;These options turn a script into a jQuery plugin. It changes the script from being static to dynamic.
It can save you time in a few ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It makes the script dynamic.&lt;/li&gt;
&lt;li&gt;It saves you the time of sifting through the code.&lt;/li&gt;
&lt;li&gt;It saves you the time of re-scripting the jQuery.&lt;/li&gt;
&lt;li&gt;You don&apos;t have to worry about messing up the working plugin.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&apos;s get started.&lt;/p&gt;
&lt;h2&gt;What are we planning on doing?&lt;/h2&gt;
&lt;p&gt;I think we should do something similar to the &apos;How to create a simple jQuery plugin&apos; tutorial, since the most simple examples often gives us the &quot;AHA!&quot; moment.
This plugin is going to be called &quot;redBorder&quot; and it will be create a &lt;code class=&quot;language-text&quot;&gt;3px&lt;/code&gt;, solid red border around the targeted element by default. The options we are going to have is to change the values of the property, and to change the property itself as well!&lt;/p&gt;
&lt;h2&gt;The jQuery Javscript&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    $&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;fn&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;extend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// Plugin Name&lt;/span&gt;
        &lt;span class=&quot;token function-variable function&quot;&gt;redBorder&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// Defaults options are set here&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// Every default goes within the { } brackets as seen below&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// A comma separates the different values&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; defaults &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;border&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;3px solid red&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; options &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; $&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;extend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;defaults&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; options&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// Add &apos;options.&apos; before the value&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// This is done to inform jQuery it is part of the default options&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;jQuery&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;options&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;property&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; options&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;value&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;jQuery&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If we target a paragraph element like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;redBorder&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It will come out looking like it did in the other plugin example.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/c4bf7a28a7bf175db8c596c598f1a4c5/jQuery-options-border.gif&quot; alt=&quot;jQuery-options-border&quot;&gt;&lt;/p&gt;
&lt;p&gt;However, if we add the following options (The properties and values options have to be valid CSS properties and values)&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;redBorder&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;background&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;red&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It will produce the following results:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/fff43a0d69d41efbca71340d7684209d/jQuery-options-background.gif&quot; alt=&quot;jQuery-options-background&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;And that is it! You now know all you need to know in order to create a jQuery plugin with user options. I had an &quot;AHA!&quot; moment when I figured out how to add options. It seems to open up a whole new world.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Why you should download IE9 Platform Preview]]></title><description><![CDATA[IE is a pretty bad browser. It used to be the go-to browser, but now it would be an extreme understatement to say "it is no longer the go-to…]]></description><link>https://css-plus.com/2010/05/why-you-should-download-ie9-platform-preview</link><guid isPermaLink="false">https://css-plus.com/2010/05/why-you-should-download-ie9-platform-preview</guid><pubDate>Mon, 03 May 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;IE is a pretty bad browser. It used to be the go-to browser, but now it would be an extreme understatement to say &quot;it is no longer the go-to browser.&quot;&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;IE9 is probably going to be a pretty decent browser, but this article isn&apos;t about IE9, it&apos;s about IE9 Platform Preview. (It does not support Windows XP)
Something I personally find annoying, is that there is no &lt;a href=&quot;http://getfirebug.com/&quot;&gt;firebug&lt;/a&gt; - or something equivalent - for IE, like there is for Firefox, Chrome, Opera, etc. I have tried using firebug-light but it doesn&apos;t help much and I don&apos;t really like it.&lt;/p&gt;
&lt;h2&gt;Document Mode&lt;/h2&gt;
&lt;p&gt;I was having a look at &lt;a href=&quot;http://ie.microsoft.com/testdrive/&quot;&gt;IE9 Platform Preview&lt;/a&gt; recently and I found that I could switch between IE5, IE7, IE8 and IE9 Document Mode which is pretty handy. The IE8 document mode is to IE8 as IE8 compatibility mode is to IE7. Basically, the webpage might render exactly the same in the browser version and the document mode, or it might be slightly off. It&apos;s mostly accurate though.&lt;/p&gt;
&lt;h2&gt;My method&lt;/h2&gt;
&lt;p&gt;What I generally do (And I&apos;m sure lots of other people do this too) is have a look at what my webpage looks like in &lt;strong&gt;IE8 compatibility mode&lt;/strong&gt; (Checking for IE7).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If there are problems, I would fix them using (probably) an IE7 conditional stylesheet and then make sure everything is good in IE7.&lt;/li&gt;
&lt;li&gt;If I find no problems, I would test it in IE7 immediately, and fix any problems.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So far, this method has worked perfectly for me, however I may very well start using IE9 Platform Preview&apos;s IE7 Document Mode for this from now on since I&apos;ll be using IE5 Document Mode to check for IE6.&lt;/p&gt;
&lt;h2&gt;Developer Tools&lt;/h2&gt;
&lt;p&gt;The coolest thing about IE9 Platform Preview is that it comes with Developer Tools, which is a Firebug-type of application. This will make our lives, as web-developers, much easier. We can temporarily edit the CSS and HTML on the fly and view the changes immediately. It brought tears to my eyes when I stumbled upon this (Not really, but I was happy).
The best part about all of this is combining the Developer Tools with the Document Modes. As you can imagine, this could save you a lot of time while trying to fix IE6 or IE7 HTML and/or CSS problems. I tested this out recently and it worked really well.
Among other things, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Disable scripts, CSS, etc&lt;/li&gt;
&lt;li&gt;Colour picker&lt;/li&gt;
&lt;li&gt;Ruler&lt;/li&gt;
&lt;li&gt;View link paths, DOM page source, DOM element source&lt;/li&gt;
&lt;li&gt;View multiple image properties, such as image height/width, file size, etc&lt;/li&gt;
&lt;li&gt;Cache options&lt;/li&gt;
&lt;li&gt;Resize browser (The options don&apos;t seem to work for this)&lt;/li&gt;
&lt;li&gt;Validate HTML, CSS, feed and links&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Again, there are things I have left out. These are merely the options that left an impression on me.&lt;/p&gt;
&lt;h2&gt;Any problems?&lt;/h2&gt;
&lt;p&gt;I have encountered two little problems:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &apos;resize browser&apos; options don&apos;t seem to work&lt;/li&gt;
&lt;li&gt;The ruler is completely invisible on a white background since it is white itself&lt;/li&gt;
&lt;li&gt;And the Developer Tools were only loading the IE9 Platform Preview&apos;s default page&apos;s information instead of the page I was currently on. This has only happened once and I have used this multiple times.&lt;/li&gt;
&lt;li&gt;It took me a few minutes to get used to it - I guess that&apos;s normal though&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;IE9 Platform Preview&apos;s Developer Tools speeds up the process of solving some of IE&apos;s CSS problems. It&apos;s not perfect yet, but it&apos;s a start.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Create a Speech-Bubble Tooltip using CSS3 and jQuery]]></title><description><![CDATA[There are a couple of ways to create tooltips, but I decided that I wanted to try and create a very lightweight and good looking tooltip…]]></description><link>https://css-plus.com/2010/04/create-a-speech-bubble-tooltip-using-css3-and-jquery</link><guid isPermaLink="false">https://css-plus.com/2010/04/create-a-speech-bubble-tooltip-using-css3-and-jquery</guid><pubDate>Thu, 29 Apr 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;There are a couple of ways to create tooltips, but I decided that I wanted to try and create a very lightweight and good looking tooltip without using any images.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;Alright, time to get started.&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;p&gt;This tooltip is going to work on any &lt;code class=&quot;language-text&quot;&gt;&amp;lt;a /&gt;&lt;/code&gt; link that has a class of &quot;sbtooltip&quot; and contains a title attribute.
&lt;code class=&quot;language-text&quot;&gt;&amp;lt;a class=&quot;sbtooltip&quot; href=&quot;#&quot; title=&quot;CSS3 and jQuery&quot;&gt;Speech-Bubble Tooltip&amp;lt;/a&gt;&lt;/code&gt;
This is a tooltip and should be very easy to implement, so very little HTML is needed for this to take effect.&lt;/p&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;p&gt;Before we get into the real CSS, the border property should be explained.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/9a0d7a61b65a5dea8e2299355a4b1481/triangle-example.gif&quot; alt=&quot;triangle-example&quot;&gt;&lt;/p&gt;
&lt;p&gt;As you can see, you can form a triangle using borders. You can also create one of any size as long as you manipulate the border widths – Like we will be doing in the CSS for this tutorial. This is how the Speech-bubble&apos;s pointer will be created.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;a.sbtooltip:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; relative&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;/* Allows the tooltip to be absolutely positioned */&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;z-index&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 100&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* Speech Bubble */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;a.sbtooltip:before&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;224&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 168&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 38&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;/* For browsers that don&apos;t support gradients */&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;-moz-linear-gradient&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token comment&quot;&gt;/* Firefox gradient */&lt;/span&gt; 90deg&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;207&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 141&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 44%&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;224&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 168&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 38&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; 72%&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;-webkit-gradient&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;/* Webkit gradient */&lt;/span&gt; linear&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        left bottom&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        left top&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;color-stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;0.44&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;207&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 141&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;color-stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;0.72&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;224&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 168&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 38&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #fff&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;attr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
        data-sbtooltip
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;/* This takes the content of the attribute named &quot;data-sbtooltip&quot; and displays it within this element – We will use jQuery to take care of this to make sure that the document is still valid xHTML*/&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;/* Hidden until hovered upon */&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;/* Font, padding, top and right must change depending on the font size you are using on your web page */&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 12px sans-serif&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 5px 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 33px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 8px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;box-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0 4px #999&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* Triangle */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;a.sbtooltip:after&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 12px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; solid&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; transparent transparent &lt;span class=&quot;token function&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;224&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 168&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; 38&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; transparent&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;/* Forces this pseudo-element to appear on hover */&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;/* Width and height could  be left out, but I prefer a less &apos;pointy&apos; triangle */&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;/* Display on hover */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;a.sbtooltip:hover:after,
a.sbtooltip:hover:before&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;/* The Speech-bubble tooltip and pointer will appear on hover */&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Create a file called &lt;code class=&quot;language-text&quot;&gt;sbtooltip.css&lt;/code&gt; and type/paste the CSS into that file.&lt;/p&gt;
&lt;p&gt;There you have it! If you add an attribute of &quot;sbtooltip&quot;, containing a value, to an anchor link with a class of &quot;sbtooltip&quot; you will have a functional Speech-Bubble Tooltip!&lt;/p&gt;
&lt;p&gt;A major problem with the &apos;sbtooltip&apos; attribute is that the xHTML will not validate&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/c82765229ac0a3149ed61ace5563a7d6/validation-errors.gif&quot; alt=&quot;validation-errors&quot; title=&quot;Validation Errors&quot;&gt;&lt;/p&gt;
&lt;p&gt;Preferably, we would have the CSS &apos;content&apos; property do the following:
content: attr(title)&lt;/p&gt;
&lt;p&gt;The only problem with this is the browser&apos;s native tooltip will appear over OUR tooltip. The whole reason we are creating a tooltip is to replace that one.&lt;/p&gt;
&lt;h3&gt;We are faced with a dilemma&lt;/h3&gt;
&lt;p&gt;Have the browser&apos;s native tooltip appear over the one we have just made, or have xHTML validation errors.&lt;/p&gt;
&lt;p&gt;In order to correct this, we will need the help of the web developer&apos;s best friend. Javascript!&lt;/p&gt;
&lt;h2&gt;The jQuery javascript&lt;/h2&gt;
&lt;p&gt;I think it&apos;s going to be easiest to create a function to do our bidding. This will allow us the freedom to apply it to any element very easily so if you decide you want to change the class &quot;sbtooltip&quot; to something else within the CSS, it will be very easy to target a different element with the jQuery. Also, it will give you some insight into how to go about creating a function (If you don&apos;t already know).&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Function name&lt;/span&gt;
$&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;fn&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function-variable function&quot;&gt;sbTooltip&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// For each instance of this element&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// Add the new attribute with title&apos;s current value and then remove the title attribute&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;attr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token string-property property&quot;&gt;&quot;data-sbtooltip&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;attr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;removeAttr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This solves both of our problems. The document validates with xHTML strict.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/13cb6f6288cea3471a82bd701d05705f/validation-success.gif&quot; alt=&quot;validation-success&quot; title=&quot;Validation Success&quot;&gt;&lt;/p&gt;
&lt;p&gt;Create a file called &lt;code class=&quot;language-text&quot;&gt;jquery.sbtooltip.js&lt;/code&gt; and type/paste the function into that file. The function does nothing by itself; we will have to call the &apos;sbTooltip&apos; function to an element, like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;element&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;sbTooltip&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The CSS we have created only works on &lt;code class=&quot;language-text&quot;&gt;&amp;lt;a /&gt;&lt;/code&gt; elements with a class of sbtooltip, so that is what we will be targeting.&lt;/p&gt;
&lt;h2&gt;Implementation&lt;/h2&gt;
&lt;p&gt;Before we go any further; if you have gotten to this point, and tried viewing this in Internet Explorer, you might have seen that it doesn&apos;t work properly &lt;strong&gt;and&lt;/strong&gt; the native tooltip isn&apos;t showing up. To solve this problem we will have to use browser specific code to target everything that &lt;strong&gt;isn&apos;t&lt;/strong&gt; Internet Explorer. I have saved the CSS as &lt;code class=&quot;language-text&quot;&gt;sbtooltip.css&lt;/code&gt; and the javascript as &apos;jquery.sbtooltip.js&apos; like I suggested earlier. Place the following code within your &lt;code class=&quot;language-text&quot;&gt;&amp;lt;head&gt;&lt;/code&gt; tag:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;!—jQuery&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;loaded&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;remotely&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=1.4.2&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;!--[if&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;!IE]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;!--&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;link&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;rel&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;stylesheet&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/css&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;css/sbtooltip.css&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;media&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;screen&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;js/jquery.sbtooltip.js&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;span class=&quot;token language-javascript&quot;&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;a.sbtooltip&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;sbTooltip&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;&amp;lt;!--&amp;lt;![endif]--&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This code will load in every browser besides IE. You could view this tooltip as &apos;progressive enhancement&apos; since IE users will still have their browser&apos;s native tooltip and they won&apos;t even know they are missing out on anything.&lt;/p&gt;
&lt;h3&gt;Extra information&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The Speech-bubble&apos;s pointer looks good in Firefox and Chrome, decent in Safari, however it looks a bit jagged in Opera. An alternative to using the border could be to use an image or no speech-bubble pointer at all.&lt;/li&gt;
&lt;li&gt;If you&apos;re &lt;code class=&quot;language-text&quot;&gt;&amp;lt;a /&gt;&lt;/code&gt; hover state includes the property &lt;code class=&quot;language-text&quot;&gt;text-decoration: underline&lt;/code&gt;, the text within the tooltip will be underlined too - in Webkit browsers (Chrome and Safari).
I hope you&apos;ve learned something worthwhile during this tutorial.&lt;/li&gt;
&lt;/ul&gt;</content:encoded></item><item><title><![CDATA[How to create a simple jQuery plugin]]></title><description><![CDATA[I avoided learning how to create a jQuery plugin for quite a while because I thought it would be too difficult and/or too complicated to…]]></description><link>https://css-plus.com/2010/04/how-to-create-a-simple-jquery-plugin</link><guid isPermaLink="false">https://css-plus.com/2010/04/how-to-create-a-simple-jquery-plugin</guid><pubDate>Fri, 23 Apr 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I avoided learning how to create a jQuery plugin for quite a while because I thought it would be too difficult and/or too complicated to learn since I&apos;m not a &apos;hardcore&apos; programmer. Contrary to what I thought, it is actually pretty easy to create a plugin as long as you know the jQuery basics.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;jQuery plugins are great because they allow you to quickly implement something relatively complicated with, normally, a single line of jQuery. They also normally allow you to change a few options very easily. Have you ever needed a plugin to do something (that it should be able to do easily) but it wasn&apos;t able to? I&apos;ve had this a few times and it would be quite convenient to edit the plugin to my liking, which is possible once you know what is actually going on.&lt;/p&gt;
&lt;p&gt;Let&apos;s get started.&lt;/p&gt;
&lt;h2&gt;The basics&lt;/h2&gt;
&lt;p&gt;This is what the basic structure of a plugin looks like.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Place the plugin within an anonymous function to avoid outside problems&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;// Attatch the new method&lt;/span&gt;
    $&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;fn&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;extend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// Plugin Name&lt;/span&gt;
        &lt;span class=&quot;token function-variable function&quot;&gt;pluginName&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;// Here is where you insert your normal code&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;jQuery&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;redBorder jQuery plugin&lt;/h2&gt;
&lt;p&gt;The plugin I&apos;m going to create is a plugin that creates a red border around the elements the user selects.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    $&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;fn&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;extend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function-variable function&quot;&gt;redBorder&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;border&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; options&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;border&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;jQuery&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;There we go, the plugin is done!
As you can see, all that has changed is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;pluginName has been replaced with redBorder&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;language-text&quot;&gt;jQuery(this).css(&quot;border&quot;, &quot;3px solid red&quot;);&lt;/code&gt; has been inserted&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Create a &lt;code class=&quot;language-text&quot;&gt;.js&lt;/code&gt; file and paste/start writing your plugin within that file. After you have done that, create a link to that file within your HTML document.
Now, all you have to do is load jQuery, load the &lt;code class=&quot;language-text&quot;&gt;redborder.js&lt;/code&gt; plugin and call the redBorder function to selected elements.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;js/jquery-1.4.2.min.js&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;js/jquery.redborder.js&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;span class=&quot;token language-javascript&quot;&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;redBorder&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The output would look something like this:&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 236px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/d26d5f80ff616ebb13680adc00b82077/26f56/red-border.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 10.81081081081081%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAACABQDASIAAhEBAxEB/8QAFwABAAMAAAAAAAAAAAAAAAAAAAEDBf/EABcBAAMBAAAAAAAAAAAAAAAAAAABAgP/2gAMAwEAAhADEAAAAdGCdLQz/8QAGBAAAgMAAAAAAAAAAAAAAAAAAAEDMTL/2gAIAQEAAQUCWSOv/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAFRABAQAAAAAAAAAAAAAAAAAAARD/2gAIAQEABj8CL//EABoQAAICAwAAAAAAAAAAAAAAAAABETFRgbH/2gAIAQEAAT8h5BXsSXnJ/9oADAMBAAIAAwAAABCPz//EABYRAAMAAAAAAAAAAAAAAAAAAAEQMf/aAAgBAwEBPxA1f//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EABkQAQACAwAAAAAAAAAAAAAAAAEAMRGx8f/aAAgBAQABPxAFJxN+EoC53P/Z&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;red-border&quot;
        title=&quot;&quot;
        src=&quot;/static/d26d5f80ff616ebb13680adc00b82077/26f56/red-border.jpg&quot;
        srcset=&quot;/static/d26d5f80ff616ebb13680adc00b82077/a80bd/red-border.jpg 148w,
/static/d26d5f80ff616ebb13680adc00b82077/26f56/red-border.jpg 236w&quot;
        sizes=&quot;(max-width: 236px) 100vw, 236px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Adding options&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    jQuery&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;fn&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;extend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// Options is added within the brackets after function&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// This informs the plugin that options will be used&lt;/span&gt;
        &lt;span class=&quot;token function-variable function&quot;&gt;redBorder&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token parameter&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;// Defaults options are set&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; defaults &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token literal-property property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;3px solid red&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; options &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; $&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;extend&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;defaults&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; options&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;jQuery&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;border&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; options&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;border&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;jQuery&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you can edit the border options, as long as it adheres to the &apos;border&apos; properties syntax within the CSS.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;js/jquery-1.4.2.min.js&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;js/jquery.redborder.js&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;span class=&quot;token language-javascript&quot;&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;p&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;redBorder&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;3px dotted green&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The output of this would look something like this:&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 236px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/274774fbc19345987ecd46b58c61ced4/26f56/green-border.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 10.81081081081081%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAACABQDASIAAhEBAxEB/8QAFwABAAMAAAAAAAAAAAAAAAAAAAIDBf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAAHUiSXA/8QAFxAAAwEAAAAAAAAAAAAAAAAAAAExA//aAAgBAQABBQJQzn//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAQ/9oACAEBAAY/An//xAAaEAACAgMAAAAAAAAAAAAAAAAAARExIUFR/9oACAEBAAE/IaBNzezJ56f/2gAMAwEAAgADAAAAEPwv/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPxA//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPxA//8QAGhAAAgMBAQAAAAAAAAAAAAAAAAEhMUERgf/aAAgBAQABPxBnfqNlfSak+78P/9k=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;green-border&quot;
        title=&quot;&quot;
        src=&quot;/static/274774fbc19345987ecd46b58c61ced4/26f56/green-border.jpg&quot;
        srcset=&quot;/static/274774fbc19345987ecd46b58c61ced4/a80bd/green-border.jpg 148w,
/static/274774fbc19345987ecd46b58c61ced4/26f56/green-border.jpg 236w&quot;
        sizes=&quot;(max-width: 236px) 100vw, 236px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;There you have it. A very simple jQuery border plugin with basic options. Click &lt;a href=&quot;/blog/adding-user-options-to-your-jquery-plugin/&quot;&gt;here&lt;/a&gt; to learn to create more advanced jQuery plugin options.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[CSS shorthand properties]]></title><description><![CDATA[CSS shorthand properties make your CSS file look cleaner, easier to edit, easier to type and it reduces the total file size. The above image…]]></description><link>https://css-plus.com/2010/04/css-shorthand-properties</link><guid isPermaLink="false">https://css-plus.com/2010/04/css-shorthand-properties</guid><pubDate>Mon, 19 Apr 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;CSS shorthand properties&lt;/strong&gt; make your CSS file look cleaner, easier to edit, easier to type and it reduces the total file size.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;The above image &quot;CSS Shorthand - Saving you money every day&quot; is a play on &quot;saving you time - saving you money&quot; cliché, however, it does save you time, so it is essentially making you money.
This article is aimed at beginners who aren&apos;t familiar with CSS shorthand.&lt;/p&gt;
&lt;h2&gt;What is shorthand?&lt;/h2&gt;
&lt;p&gt;CSS shorthand is a way of getting the job done while using less CSS properties.&lt;/p&gt;
&lt;p&gt;The 5 CSS Shorthand properties I use in every single project I work on are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;background&lt;/li&gt;
&lt;li&gt;border&lt;/li&gt;
&lt;li&gt;font&lt;/li&gt;
&lt;li&gt;list-style&lt;/li&gt;
&lt;li&gt;margin&lt;/li&gt;
&lt;li&gt;outline&lt;/li&gt;
&lt;li&gt;padding&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Above is a list of all the shorthand properties, however I have crossed out the ones I don&apos;t use often. I would say that margin and padding are probably the ones I use the most, which is probably because almost every element uses both of them. My second most used would be background, then border and finally font.&lt;/p&gt;
&lt;p&gt;One important thing to remember about CSS shorthand is that the order is very important. If you mix up the order then it probably won&apos;t affect the element the way you want it to.&lt;/p&gt;
&lt;h2&gt;Margin and Padding&lt;/h2&gt;
&lt;p&gt;Margin and padding are the most simple and also written in exactly the same way.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 9px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 8px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 7px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token property&quot;&gt;padding-top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding-right&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 9px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding-bottom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 8px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding-left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 7px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Shorthand&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px 9px 8px 7px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px 9px 8px 7px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It&apos;s actually very easy to remember - top, right, bottom, left. It goes in a clockwise direction. So try and remember 12 o&apos;clock - 3 o&apos;clock - 6 o&apos;clock - 9 o&apos;clock and you are set for margin and padding.
Other examples:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;/* 10px top and bottom and 5px left and right */&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px 5px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;/* 10px top and 0 right, 0 bottom and 0 left */&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px 0 0 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Background&lt;/h2&gt;
&lt;p&gt;This is my favourite shorthand property. &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/CSS/color_value&quot;&gt;rgba&lt;/a&gt; and multiple background options have been added in CSS3.&lt;/abbr&gt;&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; red&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/example.jpg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-repeat&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; repeat-x&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; right bottom&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-attachment&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; scroll&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Background shorthand&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; red &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/example.jpg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; repeat-x right bottom scroll&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Border&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; solid&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; black&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Border shorthand&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2px solid black&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Font&lt;/h2&gt;
&lt;p&gt;This is probably the most difficult CSS shorthand property to remember. I don&apos;t have a clever way of remembering this one, I&apos;ve drilled it into my brain by using it many times.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; italic&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-variant&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; small-caps&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; bold&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 35px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Arial&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Helvetica&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; sans-serif&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Font shorthand&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; italic small-caps bold 35px/10px Arial&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Helvetica&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; sans-serif&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Outline&lt;/h2&gt;
&lt;p&gt;Outline is to border as margin is to padding.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;outline-width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;outline-style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; solid&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;outline-color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; black&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Outline shorthand&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;outline&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2px solid black&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;List Style&lt;/h2&gt;
&lt;p&gt;In this example, the square will only be used if the example.gif is not loaded which, I think, is good practice.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;list-style-type&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; square&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;list-style-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; outside&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;list-style-image&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/example.gif&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;List Style shorthand&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;list-style&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; square outside &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/example.gif&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And that&apos;s it folks! All 7 of the CSS shorthand properties wrapped up into a one little article.
If you have any questions, feel free to ask me.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to create a Fading Border gallery with Opacity Focus]]></title><description><![CDATA[Recently, someone asked me how they would go about creating a "fading border". I can't recall ever seeing one, so I decided to create this…]]></description><link>https://css-plus.com/2010/04/how-to-create-a-fading-border-gallery-with-opacity-focus</link><guid isPermaLink="false">https://css-plus.com/2010/04/how-to-create-a-fading-border-gallery-with-opacity-focus</guid><pubDate>Thu, 15 Apr 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Recently, someone asked me how they would go about creating a &quot;fading border&quot;. I can&apos;t recall ever seeing one, so I decided to create this tutorial.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;What exactly is a &apos;fading border with opacity focus&apos;? At first I created a really long-winded version. The jQuery javascript was about equally as long as this version, but the CSS was about 10 times larger and I managed to halve the amount of markup. The one thing this version has lost, however, is the box-shadow on hover (Which I think looked great). The fading border without a box-shadow seemed bland, which is why I&apos;ve added the opacity focus. In this tutorial you will learn how to create an awesome &apos;fading border&apos; and stylish opacity focus with minimal HTML, ridiculously little CSS and easy to understand jQuery javascript.
Alright, let&apos;s get started.&lt;/p&gt;
&lt;h2&gt;The Markup/HTML&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/bird.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Parakeet&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/thumb-bird.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/halloween.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Halloween&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/thumb-halloween.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/sushi.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Sushi&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/thumb-sushi.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/mountain.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;Mountain&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;img&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;images/thumb-mountain.jpg&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you can see, this is very standard and simple markup. What we have here is an Unordered List containing thumbnail images that link to another, larger, image. I&apos;ve added the title attribute because I will be using &lt;a href=&quot;http://fancybox.net/&quot;&gt;Fancybox&lt;/a&gt; to manage the image anchor links and Fancybox makes use of the this &quot;title&quot; attribute. You should be adding &apos;title&apos; attributes for SEO purposes anyway. Fancybox is not needed for the fading border or opacity focus to work.&lt;/p&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;p&gt;As I said before, this contains so little CSS that I find it quite amusing. Especially since it previously contained 2 lines for every image I used and an extra 4 or so lines.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #79694c&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;li&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;a img&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #79694c&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 5px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 40px 0 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When you are too close to something you are working on, it is difficult to step back and look at what you are actually doing. I did this and I am amazed. I think I will write an article based on exactly this subject at a later date.&lt;/p&gt;
&lt;p&gt;The float property is included to force the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;li&gt;&lt;/code&gt;s into a horizontal line and the margin-right of 40px is used to separate the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;li&gt;&lt;/code&gt;s, therefore separating the images.
As you can see, the image doesn&apos;t actually have a &apos;border&apos;. The padding around the image gives it the the illusion that it has a border. Also the padding is the same colour as the background. This is done because we want to give the impression that these images do not contain a border. This way, when we fade to another colour, it looks like the border is fading in and out of existence.
A border of the same colour is needed, otherwise a &apos;jump&apos; will occur when you hover over it due to a border being added and taken away. This jump is a big indication of a poor web developer.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 450px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/6ca5c1750e5d7cc9880308467bd2f71d/20e5d/fading-border-opacity-focus.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 23.64864864864865%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAFABQDASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAID/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAID/9oADAMBAAIQAxAAAAHODOgP/8QAFxAAAwEAAAAAAAAAAAAAAAAAAAECIf/aAAgBAQABBQJpUSaf/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAFhAAAwAAAAAAAAAAAAAAAAAAABAx/9oACAEBAAY/AlT/xAAaEAACAgMAAAAAAAAAAAAAAAABEQAhMUFR/9oACAEBAAE/IWgLQZqAAMaqPpP/2gAMAwEAAgADAAAAEAvP/8QAFhEBAQEAAAAAAAAAAAAAAAAAAAER/9oACAEDAQE/EIx//8QAFhEBAQEAAAAAAAAAAAAAAAAAAAER/9oACAECAQE/EK2v/8QAGhAAAwADAQAAAAAAAAAAAAAAAAERITFx8f/aAAgBAQABPxBbOSipejqqijLR5yP/2Q==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Fading border opacity focus&quot;
        title=&quot;&quot;
        src=&quot;/static/6ca5c1750e5d7cc9880308467bd2f71d/20e5d/fading-border-opacity-focus.jpg&quot;
        srcset=&quot;/static/6ca5c1750e5d7cc9880308467bd2f71d/a80bd/fading-border-opacity-focus.jpg 148w,
/static/6ca5c1750e5d7cc9880308467bd2f71d/1c91a/fading-border-opacity-focus.jpg 295w,
/static/6ca5c1750e5d7cc9880308467bd2f71d/20e5d/fading-border-opacity-focus.jpg 450w&quot;
        sizes=&quot;(max-width: 450px) 100vw, 450px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;The jQuery&lt;/h2&gt;
&lt;p&gt;This part of the tutorial is by far the most complicated (relative to the HTML and CSS). The first thing we need to do is include jQuery, obviously. Once that has been accomplished, a plugin named &lt;a href=&quot;https://github.com/jquery/jquery-color&quot;&gt;jQuery Color&lt;/a&gt; needs to be linked to in the header. This little plugin makes it very easy to fade background and border colours into one another. And now for the fading border and opacity focus jQuery javascript code:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;//Fading Border&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ul img&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;hover&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;backgroundColor&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;#40331b&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;backgroundColor&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;#79694C&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;//Opacity Focus&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;ul li&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;hover&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;siblings&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeTo&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.4&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;siblings&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;fadeTo&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Let&apos;s start with the &lt;strong&gt;Fading Border&lt;/strong&gt;, since it comes first in the jQuery. What it&apos;s saying is: Once you hover over &lt;code class=&quot;language-text&quot;&gt;ul img&lt;/code&gt;, animate the background colour to a dark brown; And once you mouse-off, animate the background to a lighter brown (The same colour we we&apos;re using before).&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Opacity Focus&lt;/strong&gt; is slightly different. What this is saying is: Once you hover over the &lt;code class=&quot;language-text&quot;&gt;ul li&lt;/code&gt; (List items), select the siblings (All of the other List Items) and fade them to an opacity level of &lt;code class=&quot;language-text&quot;&gt;0.4&lt;/code&gt; at a speed of 400 milliseconds; And once you mouse-off, fade the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;li&gt;&lt;/code&gt;&apos;s back to an opacity of 1 (100% visible).
The &lt;code class=&quot;language-text&quot;&gt;.stop()&lt;/code&gt; functions are used in order to stop the animation once you mouse on/mouse off. If you didn&apos;t have this and you quickly dragged your mouse over all of the images and stopped, the animations would play over and over until it had completed the amount of times you mouse on / mouse off-ed.&lt;/p&gt;
&lt;p&gt;The useful thing about this Fading Border with Opacity Focus is that the images can be any size and this will work just fine. I created every thumbnail equal in size because I think it looks a whole lot neater.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[IE opacity with CSS]]></title><description><![CDATA[Achieving Internet Explorer (IE) opacity is a bit of an annoyance, no matter how you would like to achieve it. The most common way of doing…]]></description><link>https://css-plus.com/2010/04/ie-opacity-with-css</link><guid isPermaLink="false">https://css-plus.com/2010/04/ie-opacity-with-css</guid><pubDate>Mon, 12 Apr 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Achieving Internet Explorer (IE) opacity is a bit of an annoyance, no matter how you would like to achieve it. The most common way of doing this is to set a .png file as the background of an HTML element. Unfortunately IE 6 doesn&apos;t support .png files without adding javascript to the page to enable .png opacity. It is beneficial to avoid using these files because it unnecessarily adds to the HTML requests.&lt;/p&gt;
&lt;!--more--&gt;
&lt;h2&gt;Work around&lt;/h2&gt;
&lt;p&gt;There is a fairly simple work-around to this problem. Other browsers (Chrome, Firefox, Opera, Safari) support the &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/CSS/color_value&quot;&gt;rgba&lt;/a&gt; CSS3 property, which makes backgrounds with alpha transparency ridiculously easy to implement. There is a similar IE opacity CSS property which has been around since IE 5.5. Unfortunately this solution looks absolutely horrible, and it doesn&apos;t pass CSS validation. Validation can still be achieved if this property is added to a &lt;code class=&quot;language-text&quot;&gt;[if lte IE 8]&lt;/code&gt; stylesheet. I&apos;ve written an article about &lt;a href=&quot;http://css-plus.com/2010/04/browser-detection/&quot;&gt;browser detection&lt;/a&gt; and why you should use &lt;code class=&quot;language-text&quot;&gt;[if lte IE 8]&lt;/code&gt; instead of &lt;code class=&quot;language-text&quot;&gt;[if IE]&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The IE opacity / alpha transparency CSS properties look like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; transparent&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;progid&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;DXImageTransform.Microsoft.&lt;span class=&quot;token function&quot;&gt;gradient&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;startColorStr=#7F516764&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;endColorStr=#7F516764&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-ms-filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;progid:DXImageTransform.Microsoft.gradient(startColorstr=#7F516764,endColorstr=#7F516764)&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;zoom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you can see, the &lt;code class=&quot;language-text&quot;&gt;filter&lt;/code&gt; and the &lt;code class=&quot;language-text&quot;&gt;-ms-filter&lt;/code&gt; properties are almost identical. IE 8 decided to start using the vendor prefix (Like the other versions should have done from the beginning).
The &lt;code class=&quot;language-text&quot;&gt;startColorStr&lt;/code&gt; and the &lt;code class=&quot;language-text&quot;&gt;endColorStr&lt;/code&gt; contain the same values in this example because we do not want a gradient. A gradient could be achieved with these IE CSS properties as easily as a normal colour could be implemented.
The first two characters are the alpha transparency hex values, and the last 6 are the colour&apos;s hex value. It is a bit of an annoying process to calculate the alpha transparency hex value, but here is how it is done.&lt;/p&gt;
&lt;h2&gt;How would I achieve &lt;code class=&quot;language-text&quot;&gt;background: rgba(0, 0, 0, 0.5)&lt;/code&gt; in IE?&lt;/h2&gt;
&lt;p&gt;Here is a quick tutorial on what you would do if you wanted a black background with a 50% alpha transparency value.
First multiply 255 by that 0.5
So 255 * 0.5 = 127.5
Round that up or down. I rounded it off to 127.
Now go to a website that converts &lt;a href=&quot;http://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html&quot;&gt;decimal to hexadecimal&lt;/a&gt;. (It should be 7f if you used 127)
The value you would use for the &lt;code class=&quot;language-text&quot;&gt;startColorStr&lt;/code&gt; and the &lt;code class=&quot;language-text&quot;&gt;endColorStr&lt;/code&gt; would be &lt;code class=&quot;language-text&quot;&gt;#7f000000&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; transparent&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token property&quot;&gt;progid&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;DXImageTransform.Microsoft.&lt;span class=&quot;token function&quot;&gt;gradient&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;startColorStr=#7f000000&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;endColorStr=#7f000000&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-ms-filter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f000000,endColorstr=#7f000000)&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;zoom&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This doesn&apos;t look or feel very semantic, but hey, it gets the IE opacity job done and the browser isn&apos;t very semantic anyway. Luckily we won&apos;t have to deal with any of these IE opacity annoyances in IE 9 since it is going to support CSS3.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Browser detection]]></title><description><![CDATA[Browser detection is evil, but sometimes a necessary evil. In a perfect world, we would create a webpage that looks the same in every…]]></description><link>https://css-plus.com/2010/04/browser-detection</link><guid isPermaLink="false">https://css-plus.com/2010/04/browser-detection</guid><pubDate>Thu, 08 Apr 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Browser detection is evil, but sometimes a necessary evil. In a perfect world, we would create a webpage that looks the same in every browser without browser detection or any other troubles; This is exactly what web standards aims to achieve. Unfortunately IE 6, 7 and 8 doesn&apos;t adhere to the standards like they should. This forces us to use browser specific stylesheets.&lt;/p&gt;
&lt;!--more--&gt;
&lt;h2&gt;What&apos;s wrong with browser detection?&lt;/h2&gt;
&lt;p&gt;An example of an immediate problem would be: websites that contain an IE specific stylesheet (I have a few of these out there).
IE 9 is going to be released next year and it seems like it is going to be a good browser. Once people start using it, webpages that contain IE specific stylesheets will force IE 9 to adopt the stylesheet too, which will probably throw elements around. An important fix for this would be to change &quot;if IE&quot; statements, to &quot;if less than or equal to IE 8&quot;&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;&amp;lt;!--[if IE]&gt;
    &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/ie.css&quot; media=&quot;screen&quot; /&gt;
&amp;lt;![endif]--&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;to:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;&amp;lt;!--[if lte IE 8]&gt;
    &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/ie.css&quot; media=&quot;screen&quot; /&gt;
&amp;lt;![endif]--&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Fortunately it is relatively simple to correct that problem, however it is creating unnecessary work for everyone. Also, there are (I have no idea how many) 1000&apos;s of cases where people have used &quot;greater than&quot; browser detection, such as &lt;code class=&quot;language-text&quot;&gt;[if gt IE 6]&lt;/code&gt; (If Greater Than IE 6). This will cause lots of problems in the future.&lt;/p&gt;
&lt;p&gt;IE doesn&apos;t release updates as much as other browsers do. Imagine adding Opera only code (css or javascript) to your webpage, only to have to deal with ANOTHER fix very soon afterwards because Opera has updated their browser.&lt;/p&gt;
&lt;h2&gt;But it&apos;s not working in every browser&lt;/h2&gt;
&lt;p&gt;If something isn&apos;t working cross browser, there are a few steps I take to make sure it&apos;s not my fault. (Computers only do what we tell them to do)&lt;/p&gt;
&lt;p&gt;Step 1 - &lt;a href=&quot;http://validator.w3.org/&quot;&gt;Validate your xHTML&lt;/a&gt;. Download this &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/60&quot;&gt;Webdeveloper firefox plugin&lt;/a&gt;, it gives you lots of options including local validation. Incorrect HTML markup is a big cause of cross browser problems. As soon as you are having a problem, check this immediately.&lt;/p&gt;
&lt;p&gt;Step 2 - &lt;a href=&quot;http://jigsaw.w3.org/css-validator/&quot;&gt;Validate your CSS&lt;/a&gt; (CSS3 doesn&apos;t validate at the moment, but validate to make sure you haven&apos;t made a spelling mistake or omitted something)&lt;/p&gt;
&lt;p&gt;Step 3 - Look at what you are trying to do and think about whether it is the most efficient way of doing it. I have had a problem with a navigation menu in firefox 3.5. It worked in every other browser so I thought about browser detection for a moment, but I decided against it. I ended up recreating the navigation menu bar in a more simple manner which fixed the problem (I still don&apos;t know what the actual problem was). Always keep your HTML markup as simple as possible.&lt;/p&gt;
&lt;h2&gt;Can&apos;t avoid it?&lt;/h2&gt;
&lt;p&gt;Obviously there are times where browser detection is the way. I created a &lt;a href=&quot;http://css-plus.com/examples/2010/04/yoyo-with-jquery-and-css3/&quot;&gt;yoyo&lt;/a&gt; using CSS3 and jQuery in my previous article. In the demo I detected for Safari and added an extra line of text with the following jQuery code:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;$&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;browser&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;safari&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#content p&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot; And see what happens when you hover over the link on the yoyo.&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I did this because webkit based browsers (Safari and Chrome) use certain CSS properties that don&apos;t work on other browsers yet.
Even though I said &apos;if the browser is safari&apos;, it still works on Chrome as well. This wasn&apos;t a problem for me in this specific example, but it&apos;s an example of how browser detection can be faulty and why it should be avoided.&lt;/p&gt;
&lt;h2&gt;Detect for different versions of IE&lt;/h2&gt;
&lt;p&gt;Target IE 8 and lower (The only time you should target every IE version, or use gt or gte is if you are sure you want to affect future versions with the code)&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;&amp;lt;!--[if lte IE 8]&gt;
    &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/ie.css&quot; media=&quot;screen&quot; /&gt;
&amp;lt;![endif]--&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Target everything except IE (I have never used this)&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;!--[if&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;!IE]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;!--&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;link&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;rel&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;stylesheet&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/css&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;not-ie.css&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;&amp;lt;!--&amp;lt;![endif]--&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Target IE 6 only&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;&amp;lt;!--[if IE 6]&gt;
    &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ie-6.css&quot; /&gt;
&amp;lt;![endif]--&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can target any version of IE by adjusting the number after &quot;IE &quot;.
&apos;lte&apos; is an abbreviation for &apos;Less Than and Equal to&apos;.
You can also use &apos;lt&apos; which means &apos;Less Than&apos;.&lt;/p&gt;
&lt;h2&gt;Detect for Opera using jQuery&lt;/h2&gt;
&lt;p&gt;Use the following jQuery code to add a class of &quot;opera&quot; to your body.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;$&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;browser&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;opera&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;body&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;opera&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can target Opera only by adding &quot;opera.body&quot; to the beginning of your CSS selectors. For example:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#header&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 960px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 350px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;body.opera #header&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3px solid red&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In Opera, the #header element will have a width of 960px, a height of 350px and a border of 3px solid red. Other browsers will not have a red 3px border.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;It is fairly easy to avoid browser problems (Outside of IE) if you want to.
Browser detection is evil and should be avoided at all costs, otherwise it will probably come back to haunt you.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Create a Yoyo with jQuery and CSS3]]></title><description><![CDATA[Haven't you ever just wanted a yoyo on your webpage? A beautiful, animated, spinning yoyo that slides down like a real yoyo would? I know I…]]></description><link>https://css-plus.com/2010/04/create-a-yoyo-with-jquery-and-css3</link><guid isPermaLink="false">https://css-plus.com/2010/04/create-a-yoyo-with-jquery-and-css3</guid><pubDate>Tue, 06 Apr 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Haven&apos;t you ever just wanted a yoyo on your webpage? A beautiful, animated, spinning yoyo that slides down like a real yoyo would? I know I have never even thought of it and I probably would never have the need for it either, however it is very useful to learn (If you don&apos;t already know) how one would go about creating a yoyo so you could use the techniques for other things. View the demo in Safari/Chrome and take full advantage of the CSS3.&lt;/p&gt;
&lt;!--more--&gt;
&lt;h2&gt;Where to start?&lt;/h2&gt;
&lt;p&gt;The first thing we need to do is create the images. So open up your vector drawing software (Or Photoshop, I prefer vector programs when I need to draw things) and draw a hand that is holding a yoyo. I used a photo and traced the hand. I inserted the &apos;yoyo&apos; afterwards. The completed image is broken down into multiple images in order to give the viewer the impression that there is some form of depth to it and the jQuery along with the CSS3 will animate it later. In my example the yoyo goes between layer 1 and layer 2 of the hand.
Once that is completed, save the different layers as separate images.
These are the images I came up with:
&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 190px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/ac8931a94c0a9bf508d9ee14d18a884e/a2d4f/hand-back.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 52.02702702702703%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAAsTAAALEwEAmpwYAAACbUlEQVR42n1STU8TURR9UF2QSFgQNZpGQItDUdrOdKYMtDPTTmfqQKFl2kyp9AtKbWiBBqaKEkLHoBsXEBe6dONGQsJKEv+AhJ/A3pVhoS40xZbONW1Dgo3xbN7LfTfnnXPuRagFioIMANB2sdZ/res2N9CXkWym/ZDD/G0c739Tr+8pigEh1Ib+g/PHy0O3bhBuc8+GZDEdyqT5NMFaIc0T+rxgr+UkBwQdA6/rjZqmtf+TiePQpfrpNPXMSBbTF5ky1+KMFVJuHFIeHOZ4/GxeJCtpgShnJer3kzADEWZou6F0r6H0LzR+sfVetcqU+UddTYyx1JKc9WyWJ/SMj4SsRMGin9ZV2QVxHq/lJoerm3EekiLxsqkUtbfa7AiS2NGsB4ek21ZNewl45CNhYcwBef+wvio7YXlq5HuMt+0Xw8zJ4tQoqAp7+iLtg4SPmGjmrxiQxnENq34C284IdkgL9kr2AQW58WFYmqShEByFYpipaAkBMpJ9t94bYu95NuJ8eTPl00spH6wnPJ8uDAkhr6UvnBFJWJActbyfhuXAKKzITlDDjL7+0A1r0+xP2TU4RxuNHecbEOXvW4pR1+5qxF0uhFldoDCyQUbfMZrSov1rITACS4GR6krICY8VFp5GOVif8VRfZccgH6DfNnNquqlP9vy+FnPvPE9JEHFaD7HrXb0oSA++U0MueDbNnWkJL5QSXtCSAmzNirWdxQlQp5nPCKErLXk380IILcc4Y152HqtBFoKk+QhhGNbJ43ctcdFWyE04PhQV13Ep6T3ZmhN/qRHXATVws7uVrHVvu7Huzklq8L1k7f/4ByRo42LihyDFAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;hand-back&quot;
        title=&quot;Hand back&quot;
        src=&quot;/static/ac8931a94c0a9bf508d9ee14d18a884e/a2d4f/hand-back.png&quot;
        srcset=&quot;/static/ac8931a94c0a9bf508d9ee14d18a884e/12f09/hand-back.png 148w,
/static/ac8931a94c0a9bf508d9ee14d18a884e/a2d4f/hand-back.png 190w&quot;
        sizes=&quot;(max-width: 190px) 100vw, 190px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 331px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/bd35842cfd7510be0d4200a05ec10ba1/62452/hand-front.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 51.35135135135135%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAAsTAAALEwEAmpwYAAACx0lEQVR42m2SXUySURjHjx+0LuymbmrrosvGbTettrxolTc6b2ir1jSdmFpqfowmyssrIK+A4CdKC78BBeUFBT/QiVraTBQNJEHE78zSOdfWlsD7tBe1za2znf3PxdnvPM/vPAj9Z2EYFg16fQx9ri9KuTql5ta5ugQHLl358YIG35nTYMvzGv7aR3XJlonIdun5aXn0XQAs+hwIAKIcKjaDThaTeWGsqZjj7RHtH47Vw6ZFFt60yKi9kRr4MVID323VsGqupJwaDD7UF0IzJzXxBGLHYv9tgMgLaUl3LjnaeYZfk0r4NqQI+0niz9ZAFXgMwgOnFlt2avm+6Vau42uPKLjUIwpONBaDTfZ6HXuWcP1chSnx8Rf75PmJbp1g4edoLQT6JKEVIxHcGZTDbDtvorbgyU0WkxmXzrp9GSEU1Vv1Ktepw4++dAuCk8oiMOIZLchWV8j51MwtnW3jtbi7hZ5taxW1O6Sg/CYi5COJ8O6QAj538GzxTGbcSUf22Eg6VAw69URW+mI3DuPvOGASslfRulkaPrI3wP5oLewNV8MaXRVZGfaRYmrDIoV5DX+7hP3o2pnjSGJYNIahaLsdi8Cb8dQHJlnOYUfpi23k7hIcb1lkwYBZElw1V4b8JgL8JAHe3goqYK6ERR2+N9ZUpB5VFksHat9kd4oy795CiHFqKQpOoYPy3C59eQYgl04QXO+X0qDQCkmEV0gxeI1i8PSIKI9BGPQaxeENqwwC/RLwkmJqUv0WtOLMgefJ96+cjRidjZyUG4q8x/dQwCyhjsYbgP4E2legTwIrJAFr/RLYtMrAbRBSTi1O+UwEzGv5FA1d6hWBICv5YcQhixVzogNFdKBxFadzrpPXNtNW1jHTWjY114H9dmpxmG7hro6pOMpe2cskbQU7YbihUGStyW/SVGS8lxc8zUEInRtiGqxisxl/ARpdqSczzKmKAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;hand-front&quot;
        title=&quot;Hand front&quot;
        src=&quot;/static/bd35842cfd7510be0d4200a05ec10ba1/62452/hand-front.png&quot;
        srcset=&quot;/static/bd35842cfd7510be0d4200a05ec10ba1/12f09/hand-front.png 148w,
/static/bd35842cfd7510be0d4200a05ec10ba1/e4a3f/hand-front.png 295w,
/static/bd35842cfd7510be0d4200a05ec10ba1/62452/hand-front.png 331w&quot;
        sizes=&quot;(max-width: 331px) 100vw, 331px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 116px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/100814acc0fcb28b79a167fb89bc66fd/a8277/yoyo.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 100%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAACh0lEQVR42mNgQAKrVq1ihrFDA7zNJvc3ta5cMm3n+lVzLoIwiD2lr7klLNDHFJseFBAKlQgI8DZePG/SvnMntv9//uDsvxcPz4FoMIaxQXKL503YF+jjboSsFw7q6+tZQHR3S0XGhRM7fn5+dfX/83un/z6+feL3o1vH/zy8eewvCD+6efzP41snfoPkPr28+v/88e0/u5rL0sFm7N/PAnFZaCjYdAsn2/Tpcyf9X7V+0Z+5i2f8Wbh89n90vGjFHDiev2TmnzUbl/yZMX/yfxs3l1RksxgU1dRMfRJif/ikJv1zi43565EQ958Y7BYX89cnJemfb1LCd3VDQxO4l11Cg/ZHFOT8D0xP+ROckfofFw7CgkF6IvJz/rtGhO4DG6Zvbe4QkJYEkvwXmJ7ynxwM0uufmvRfx8LCnsExMKAzLDfrf2Ba8m9yDQTpBZlh7+fTweASFnI0LC/rf0Bayh9yDQxIS/4DMgPsbeew4LehOZkgwX8UGPgXZIZ7dMQdBufQ4PehORlUMdAjJuIuyIUnQf4HCZJtYHrKH5AZHtERBxkcAvz6qRUpTmFBfQx6tpbuUAmyXQjSC0qTxk5OrqCkyOQWGXoClDgDM1L/BGem/ScFg/SA9LpHRRxnYGBgBCdudWN9B9+khL+eSQl/XWKi/7nFxfwnBoPUeiUn/PVLTvirYWJgDytpmEC0iZNDfsfEzv8zF07/0zut98+EmRP+g/BEJAzmz4Lgvum9f2YtnvGnc1Lnf3MXh3xks+BFT19LVcbFkzt/fnl9/f+L+2f+Pr1z8veT2yf+PL51/C8Y3z7x58mdk79Bcl9eX/t/8eSOn72tlajFF3qZSE4BC9OLAahRBQAAqAAJAwbVYKUAAAAASUVORK5CYII=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;yoyo&quot;
        title=&quot;CSS-Plus Yoyo&quot;
        src=&quot;/static/100814acc0fcb28b79a167fb89bc66fd/a8277/yoyo.png&quot;
        srcset=&quot;/static/100814acc0fcb28b79a167fb89bc66fd/a8277/yoyo.png 116w&quot;
        sizes=&quot;(max-width: 116px) 100vw, 116px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;p&gt;There is very little HTML markup, so it is pretty easy to understand.
Each &amp;#x3C;div&gt; tag is going to contain a separate background-image and eventually the divs will be absolutely positioned. This means we will need to include a container that will ultimately be relatively positioned. We are also going to include a string &amp;#x3C;div&gt; (I&apos;ve never seen a functional yoyo without a string before).&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;container&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;hand-back&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;hand-front&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;string&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;yoyo&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;{CSS: +; }&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;#container&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 550px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 331px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; relative&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#hand-front&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/hand-front.png&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; no-repeat left top&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 169px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 331px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;z-index&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 400&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#hand-back&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/hand-back.png&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; no-repeat left top&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 99px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 190px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 128px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 43px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;z-index&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 100&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#string&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #79694c&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1px solid #3b2f1d&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 2px
     &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 47px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 243px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;z-index&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 200&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#yoyo&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/yoyo.png&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; no-repeat center center&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 150px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 150px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 169px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 47px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;z-index&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 300&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#yoyo a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; white&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; bold&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 150px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 27px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;#yoyo a:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-decoration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-shadow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 0 15px #000&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.rotate&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-animation-duration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;1.1s&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-animation-iteration-count&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;infinite&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-animation-name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; yoyo&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;-webkit-animation-timing-function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;linear&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@-webkit-keyframes&lt;/span&gt; yoyo&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token property&quot;&gt;-webkit-transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;scale&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;1&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;0deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token selector&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token property&quot;&gt;-webkit-transform&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;scale&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;1&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;360deg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Most of this CSS is just giving the background, height, position, width and z-index to the corresponding ID which creates our desired image out of the multiple images we have and the &apos;#yoyo a&apos; is just styling and positioning the {CSS: +; } link.
The interesting part is the .rotate class. This is the awesome CSS3 that is causing the yoyo to spin in Webkit based browsers (Chrome and Safari). Unfortunately there is no pure CSS way to get an object to spin like this in other browsers.&lt;/p&gt;
&lt;h2&gt;The jQuery&lt;/h2&gt;
&lt;p&gt;I&apos;ve used the &lt;a href=&quot;http://gsgd.co.uk/sandbox/jquery/easing/&quot;&gt;jQuery easing plugin&lt;/a&gt; to give the yoyo a more visually appealing animation effect.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#container&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;hover&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#yoyo&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;rotate&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#string&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;400px&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;duration&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;easing&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;easeOutBack&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#yoyo&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;400px&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;duration&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;easing&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;easeOutBack&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#yoyo&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;removeClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;rotate&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#string&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;20px&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;duration&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;600&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;easing&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;easeInOutExpo&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#yoyo&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;47px&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;duration&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;600&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;easing&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;easeInOutExpo&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#yoyo a&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;hover&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;#yoyo&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;toggleClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;rotate&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Explanation based on line numbers&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;1: When the &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model&quot; title=&quot;Document Object Model&quot;&gt;DOM&lt;/a&gt; is ready&lt;/li&gt;
&lt;li&gt;3: When you hover on the &lt;code class=&quot;language-text&quot;&gt;#container&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;4: Add the class of &lt;code class=&quot;language-text&quot;&gt;.rotate&lt;/code&gt; to &lt;code class=&quot;language-text&quot;&gt;#yoyo&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;5: Animate the current height to &lt;code class=&quot;language-text&quot;&gt;400px&lt;/code&gt; within the duration of &lt;code class=&quot;language-text&quot;&gt;1000&lt;/code&gt; milliseconds (&lt;code class=&quot;language-text&quot;&gt;1&lt;/code&gt; second) and use easing &lt;code class=&quot;language-text&quot;&gt;easeOutBack&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;6: Animate the current &lt;code class=&quot;language-text&quot;&gt;top&lt;/code&gt; property to &lt;code class=&quot;language-text&quot;&gt;400px&lt;/code&gt; within the duration of &lt;code class=&quot;language-text&quot;&gt;1000&lt;/code&gt; milliseconds and use easing &lt;code class=&quot;language-text&quot;&gt;easeOutBack&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;7: When the object is not being hovered&lt;/li&gt;
&lt;li&gt;8: Remove the class of &lt;code class=&quot;language-text&quot;&gt;.rotate&lt;/code&gt; from &lt;code class=&quot;language-text&quot;&gt;#yoyo&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;9: Animate the current &lt;code class=&quot;language-text&quot;&gt;height&lt;/code&gt; property to 20px within the duration of &lt;code class=&quot;language-text&quot;&gt;1000&lt;/code&gt; milliseconds and use easing &lt;code class=&quot;language-text&quot;&gt;easeInOutExpo&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;10: Animate the current &lt;code class=&quot;language-text&quot;&gt;top&lt;/code&gt; property to 47px within the duration of &lt;code class=&quot;language-text&quot;&gt;1000&lt;/code&gt; milliseconds and use easing &lt;code class=&quot;language-text&quot;&gt;easeInOutExpo&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;13: When you hover over &lt;code class=&quot;language-text&quot;&gt;#yoyo a&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;14: Toggle the class &lt;code class=&quot;language-text&quot;&gt;.rotate&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There we go. A digital yoyo!&lt;/p&gt;</content:encoded></item><item><title><![CDATA[How to create a simple horizontal navigation menu from scratch]]></title><description><![CDATA[I have already done the Fading Navigation Menu tutorial, however it is a bit advanced for a beginner. This simple navigation menu tutorial…]]></description><link>https://css-plus.com/2010/03/6-steps-to-take-if-your-jquery-is-not-working</link><guid isPermaLink="false">https://css-plus.com/2010/03/6-steps-to-take-if-your-jquery-is-not-working</guid><pubDate>Mon, 29 Mar 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I have already done the &lt;a href=&quot;/blog/fading-navigation-menu&quot;&gt;Fading Navigation Menu&lt;/a&gt; tutorial, however it is a bit advanced for a beginner. This simple navigation menu tutorial will help you create a very basic horizontal navigation menu using semantic HTML and minimal CSS. You will need to know basic CSS properties and how CSS selectors work to understand the tutorial.&lt;/p&gt;
&lt;p&gt;Let&apos;s get started.&lt;/p&gt;
&lt;h2&gt;Step 1 - The HTML&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Blog&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Contact&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Freebies&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Tutorials&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If the above HTML code is all you have on your page, then it should look like this:
&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 136px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/7106a4817469566e9fb8f440e49d3d3e/8604e/simple-nav-menu-01.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 86.02941176470587%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAARCAIAAABSJhvpAAAACXBIWXMAAAsTAAALEwEAmpwYAAABkUlEQVR42qVTXUsCURT0bxcEWRZFL71UGKVlaFoWkUtFPRdURC5aQSp+LOzXveuW27q79+uEGkGlrtA8HmbumTPcicAfCMGFEDABIiPmgvcxqVgI4fs+Z6xWqzRaCqGk70CEiAcMjPHsbFRwvpeIRxdWri6l9P4RsuxvQshmQijnTFFaz+WXRv1Vks7sd2ciMefcdV0AQIZp253ehBJKGYDwvS4fpv9pOzrPAlcqnJXkx2z+KLG6spvJZzK5i8IJevf6zNFpD15pW9gwjGq1Vnl5qtTqpVJZ1TUvoONsM8YQQoJTWZYdtwsAhFBd00gQ9M2PTduyrFhsgTFWOD28OpcOD3LbqXRyayOVSMa3du7uH/4m9/uTMEqwhTHGCCHTxIauNhtNTdMNEw0uGy4mhNTrDQAmF4uKanw4ThAEvue92W9Kq0UpDbG9uLgEALJ8n83ll+di+ePj1HZ8fW1zanrm+uY23DYAeN2uhduGrmGrjZGpqpqqap2OE1KMCcs0bnOvDXzQqq9ucTa8pBH4Bz4BhL/HJj0edeIAAAAASUVORK5CYII=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;simple-nav-menu-01&quot;
        title=&quot;Fading Navigation Menu 01&quot;
        src=&quot;/static/7106a4817469566e9fb8f440e49d3d3e/8604e/simple-nav-menu-01.png&quot;
        srcset=&quot;/static/7106a4817469566e9fb8f440e49d3d3e/8604e/simple-nav-menu-01.png 136w&quot;
        sizes=&quot;(max-width: 136px) 100vw, 136px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
The next thing to do is to add the &amp;#x3C;a&gt; links, which will link to the specified pages.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Blog&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Contact&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Freebies&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Tutorials&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Your page should now look like this:
&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 136px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/0f3b45a52feae9f186499ac88ea64bf6/8604e/simple-nav-menu-02.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 86.02941176470587%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAARCAIAAABSJhvpAAAACXBIWXMAAAsTAAALEwEAmpwYAAABfklEQVR42p2TW0vDUAzH96nFRzfQ+QH25IM6L/MCXsE6hkxnZVapThQVxeF8UJGuFXW2TXKSSPVBxLkOQzgEzvmTX5KTjP4ykcT7scxfF8yJ9ysWEQBgo80b07pjRBFOQch8yVS13fazuaywzoxHuXy0VcFSCTxfvgpJz4wIhLJbo7U1qJShOAV+0Lc4DENVfXpk/zOhQUFUFQ1D6Vr/D+xcLmtAy5t4fmYWl2CyEE0vwvwCVCz0Xrog/Oh2MiPWI5dsmywLrXWwyri8DHs2vXZ6io0xXttjo65LL6/JqzjWh3uGWOMordu+7w+PDLNRawN2tnB1BafmYLYYz83AeBGOT0wKtqpCLI2GcV06OKB9h+p12q7iro2nZz3FiHjbaqnq4SE1W/wcSKcjb2/S9rjZNF3Jv7GDIMjnR1W1cUyzJRgZCucXYGIsKhTigcF3u07p2Mx6eWEch/Zs3HfIqVOthtUqXV1z2qj63KYeW8WsxihRcibBZ/znD/u3fQDpoMwcKoil0gAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;simple-nav-menu-02&quot;
        title=&quot;Fading Navigation Menu 02&quot;
        src=&quot;/static/0f3b45a52feae9f186499ac88ea64bf6/8604e/simple-nav-menu-02.png&quot;
        srcset=&quot;/static/0f3b45a52feae9f186499ac88ea64bf6/8604e/simple-nav-menu-02.png 136w&quot;
        sizes=&quot;(max-width: 136px) 100vw, 136px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
That is all the HTML we are going to need.
What we have is an Unordered List &amp;#x3C;ul&gt; which contains List Items &amp;#x3C;li&gt;, which contains an Anchor link &amp;#x3C;a&gt;. Our menu needs no more HTML-markup.&lt;/p&gt;
&lt;h2&gt;Step 2 - The CSS&lt;/h2&gt;
&lt;p&gt;The first thing we want to do is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add a margin and padding reset, always use some kind of CSS reset.&lt;/li&gt;
&lt;li&gt;Move the Unordered List away from the edge with a margin - with &apos;margin: 20px 10px&apos;&lt;/li&gt;
&lt;li&gt;Force the List Items to be horizontal - with &apos;float: left&apos;&lt;/li&gt;
&lt;li&gt;Get rid of those pesky black dots - with &apos;list-style-type: none&apos;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So let&apos;s add this to the CSS. (95% of the time I organise my properties in alphabetical order)&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;ul&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;ul li&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;list-style-type&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 201px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/ff5b6864e9aa2546362b7fe6f29e07d8/2ef63/simple-nav-menu-03.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 26.351351351351354%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAIAAADKYVtkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAArklEQVR42qWLzQqCQBSFff83aBH9WFmUBlG0kZCexJVRM6OhjHpH59wYiYK2fYvDud/leDwA8Bt84ut/vh/j9T2nqS0rNA2UAhHXmo3hLLNCWgYrhbqBrnC/27ZFXaMsofUw7jqeTcmftFFokmu3D818QsGGwh3FsTkeaBXQ0qdL0p1PZr2gKDLjUbuNjBsD/HxCSmQ3m+cQ0nUpUBRw58MVIZzMc5dKvbsb8x+8ADg+GjTYA4rUAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;simple-nav-menu-03&quot;
        title=&quot;Fading Navigation Menu 03&quot;
        src=&quot;/static/ff5b6864e9aa2546362b7fe6f29e07d8/2ef63/simple-nav-menu-03.png&quot;
        srcset=&quot;/static/ff5b6864e9aa2546362b7fe6f29e07d8/12f09/simple-nav-menu-03.png 148w,
/static/ff5b6864e9aa2546362b7fe6f29e07d8/2ef63/simple-nav-menu-03.png 201w&quot;
        sizes=&quot;(max-width: 201px) 100vw, 201px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
Next, what we want to achieve is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Get rid of the underline - with &apos;text-decoration: none&apos;&lt;/li&gt;
&lt;li&gt;Add some padding to give the buttons volume - with &apos;padding: 10px 20px&apos;&lt;/li&gt;
&lt;li&gt;Add a background colour - with &apos;background: #004b98&apos;&lt;/li&gt;
&lt;li&gt;Add a font colour - with &apos;color: white&apos;&lt;/li&gt;
&lt;li&gt;Change the display to &apos;block&apos; so that the entire &amp;#x3C;a&gt; is clickable, not just the text (It seems like this only needed for IE6 and IE7)- with &apos;display: block&apos;&lt;/li&gt;
&lt;li&gt;Change the type of font used - with &apos;font-family: Arial, Helvetica, sans-serif&apos;&lt;/li&gt;
&lt;li&gt;Add a hover state&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;ul&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 20px 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;ul li&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;list-style-type&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;ul li a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #004b98&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; white&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Arial&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; Helvetica&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; sans-serif&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px 20px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-decoration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;ul li a:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #0069d4&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 368px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/9583d50fda3bb582942d60b2f5769973/2b727/simple-nav-menu-04.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 10.135135135135135%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAIAAADXZGvcAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAhUlEQVR42gF6AIX/AAFMmR5gpBhboQBLmAJNmRZaoB1foxlcoQJOnQJozhR12Rt42Bt52A5z2gBcvAhPlxxepBpdohlcoQFMmAABTJggYqUjYqUAS5gBTJkXW6EiY6YdX6IBTpwCZ84VdtkifNkkfdkSddoAXL0GTZYfYaQgYaUfYKQCTJhmwCym9KIaXgAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;simple-nav-menu-04&quot;
        title=&quot;Fading Navigation Menu 04&quot;
        src=&quot;/static/9583d50fda3bb582942d60b2f5769973/2b727/simple-nav-menu-04.png&quot;
        srcset=&quot;/static/9583d50fda3bb582942d60b2f5769973/12f09/simple-nav-menu-04.png 148w,
/static/9583d50fda3bb582942d60b2f5769973/e4a3f/simple-nav-menu-04.png 295w,
/static/9583d50fda3bb582942d60b2f5769973/2b727/simple-nav-menu-04.png 368w&quot;
        sizes=&quot;(max-width: 368px) 100vw, 368px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
And there you have your own very simple horizontal navigation menu.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Save time – Use a template]]></title><description><![CDATA[I like doing things in an organised fashion, and I'm sure most of you do to. I write my CSS, HTML and jQuery in a certain way which I don't…]]></description><link>https://css-plus.com/2010/03/save-time-use-a-template</link><guid isPermaLink="false">https://css-plus.com/2010/03/save-time-use-a-template</guid><pubDate>Mon, 29 Mar 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I like doing things in an organised fashion, and I&apos;m sure most of you do to. I write my CSS, HTML and jQuery in a certain way which I don&apos;t change, unless I decide I&apos;ve found a more efficient way of doing it. For example, I include the CSS reset in every single thing I work on and I would feel as if something was missing if I didn&apos;t, however I have no problem editing the reset if I think it would be more efficient.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;I used to follow the following procedure to set up a the basics for creating a website:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create the HTML file&lt;/li&gt;
&lt;li&gt;Create the folders for the &quot;js&quot;, &quot;css&quot; and &quot;images&quot; folder.&lt;/li&gt;
&lt;li&gt;Copy a reset.css and create a blank style.css&lt;/li&gt;
&lt;li&gt;Get the latest jQuery from another project or from &lt;a href=&quot;https://jquery.com/&quot;&gt;jquery.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Get the jQuery plugins I&apos;m going to be using and edit them accordingly (Such as changing the file path of the images in the CSS)&lt;/li&gt;
&lt;li&gt;Link to the external files in the HTML file&lt;/li&gt;
&lt;li&gt;Make sure they are linking through properly and make sure the jQuery plugins are working correctly&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you can see, this becomes quite a problem if you have to do this fairly often. What I have done to solve this problem (And I&apos;m sure most people do something like this) is create a website template that contains everything I need. Everything is set up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The HTML is ready&lt;/li&gt;
&lt;li&gt;The CSS is linked and functional&lt;/li&gt;
&lt;li&gt;The jQuery and it&apos;s plugins are linked and functional&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And that is all you need. It saves me loads of time.&lt;/p&gt;
&lt;h2&gt;My default-template&lt;/h2&gt;
&lt;p&gt;I have the following linked to my default template:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A link to my favicon.ico&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://jquery.com/&quot;&gt;jQuery&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://fancybox.net/&quot;&gt;Fancybox&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jquery.andreaseberhard.de/pngFix/&quot;&gt;PNG Fix&lt;/a&gt; - Included with IE6 specific HTML code. It&apos;s not necessary to load it for every browser.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Default stylesheet - With a &lt;a href=&quot;http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/&quot;&gt;reset&lt;/a&gt; attached&lt;/li&gt;
&lt;li&gt;IE6 only stylesheet&lt;/li&gt;
&lt;li&gt;IE only stylesheet&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I include these &lt;code class=&quot;language-text&quot;&gt;.css&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;.js&lt;/code&gt; files because I use them so often. I use the jQuery PNG fix often because people still want support for IE6 on their web page. Including it inside the IE6 conditional statement forces it to load in IE6 alone, which is perfect.
I use Fancybox because it is so awesome, easy to implement and 99% of the time clients love it.&lt;/p&gt;
&lt;p&gt;I recommend creating one of these if you haven&apos;t already, and to make it easier, I have included my default-template as a download.
Modify it to suit your needs and you will end up saving a lot of time.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[6 steps to take if your jQuery is not working]]></title><description><![CDATA[1. The file is not there or does not exist People tend to become upset and/or frustrated (Including me) when something simple doesn't work…]]></description><link>https://css-plus.com/2010/03/6-steps-to-take-if-your-jquery-is-not-working</link><guid isPermaLink="false">https://css-plus.com/2010/03/6-steps-to-take-if-your-jquery-is-not-working</guid><pubDate>Thu, 25 Mar 2010 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;1. The file is not there or does not exist&lt;/h2&gt;
&lt;p&gt;People tend to become upset and/or frustrated (Including me) when something simple doesn&apos;t work, such as &lt;strong&gt;jQuery not working&lt;/strong&gt;. Before you do anything, navigate to your jQuery file and check that it is exactly where it should be.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;Also make sure that you have the correct html file open - I have actually tried to load files using the incorrect html, so the path would have been correct if I had the correct html file open. Don&apos;t ever be too proud to check the absolute basics.&lt;/p&gt;
&lt;h2&gt;2. Incorrect File Path&lt;/h2&gt;
&lt;p&gt;This is a common problem and it is the first thing I check when I&apos;m having a javascript problem (I actually do step 1 and 2 with my style.css as well). After checking that the file path is correct, I double check by viewing the page source using Firefox, I then click on the &lt;code class=&quot;language-text&quot;&gt;.js&lt;/code&gt; link. If it opens up the jQuery file (Double check it is opening the correct file) then the destination is correct. If it does not, or it opens a page-not-found, then I know I have a problem with my file path.&lt;/p&gt;
&lt;h2&gt;3. Script load order&lt;/h2&gt;
&lt;p&gt;Help! &lt;strong&gt;*jQuery not working&lt;/strong&gt;, however it is loading perfectly!!!&lt;/p&gt;
&lt;p&gt;Make sure that it is the first script loaded on your page. This is very easy to overlook. The problem exists because browsers understand javascript and not stand alone jQuery snippets. jQuery turns our code into normal javascript code, so that the browsers can interpret what we are saying. Javascript libraries are shortcuts.
If you were to load a library plugin (extra script file) before the library itself has been loaded, the plugin would be seen as bunch of mumbo-jumbo by the browser. This snippet of code means absolute nothing before the library has been loaded.&lt;/p&gt;
&lt;h2&gt;4. Plugin not working&lt;/h2&gt;
&lt;p&gt;Plugins malfunction sometimes, for whatever reason; And people sometimes tend to think that jQuery is not working, which isn&apos;t always the case. When it gets this far I think to myself, &quot;Lets get out the big guns&quot;.
Note: Step 1 and 2 can also be applied to CSS problems.
Even though I have tried step 1, step 2 and step 3, I do ANOTHER test to make 100% sure that it is loading properly. 99.999% of the time this is the final test.
Firstly, I make sure there are absolutely NO plugins, other libraries or anything javascript related on my page, except for the jQuery library and a little script I write beneath it.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;span class=&quot;token language-javascript&quot;&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;div&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;border&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;3px solid red&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This adds a &lt;code class=&quot;language-text&quot;&gt;3px&lt;/code&gt; red border to every single div on the page.&lt;/p&gt;
&lt;p&gt;If this works, which it really should, the library is loading correctly. You then know that there is something wrong with the plugin(s) and that it is time for more troubleshooting. If you have more than one plugin, try switching the plugin order (This has worked for me on a few occasions), if it is still unsuccessful then remove each plugin and test until something works. Once you find the problem plugin, download it&apos;s latest available version and see if it works.&lt;/p&gt;
&lt;p&gt;If the &lt;code class=&quot;language-text&quot;&gt;3px&lt;/code&gt; red border does not show up, then it&apos;s time to jump to the next step.&lt;/p&gt;
&lt;h2&gt;5. Javascript library issues&lt;/h2&gt;
&lt;p&gt;Do not use multiple javascript libraries simultaneously! There are a few reasons to avoid this even besides the conflicts that could occur. More &lt;code class=&quot;language-text&quot;&gt;.js&lt;/code&gt; libraries means more html requests and more things to load. It doesn&apos;t matter what &lt;code class=&quot;language-text&quot;&gt;.js&lt;/code&gt; library you use, use which ever you prefer more but stick with it throughout your project. There are thousands of &lt;a href=&quot;http://plugins.jquery.com/&quot;&gt;jQuery plugins&lt;/a&gt;, I would say that 99% of the time there is no need for multiple libraries anyway.&lt;/p&gt;
&lt;h2&gt;6. Javascript disabled/not supported by browser&lt;/h2&gt;
&lt;p&gt;Make sure you are using a modern browser, and not IE 5.5 or something old and outdated.
It is possible to turn off the javascript support within a browser, and I have had this problem before (I actually turned off javascript support and forgot to turn it back on).
jQuery not working by this point? Try viewing the page with a different modern browser and see if there is any difference or make sure that javascript is enabled within the browser. This is a last resort.&lt;/p&gt;
&lt;h2&gt;Tips&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Don&apos;t load two different javascript library versions, only one is ever needed.&lt;/li&gt;
&lt;li&gt;I have started loading jquery through Google at all times:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js?ver=1.4.2&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The only downside to doing this that I can think of is if you are working offline (Obviously it won&apos;t load) or if Google goes down for whatever reason.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Step 1, 2 and 3 can be applied to CSS files too. The Step 3 load order could refer to the IE specific stylesheets loading before the main one.&lt;/li&gt;
&lt;li&gt;jQuery not working? Then follow the 6 steps again :)&lt;/li&gt;
&lt;li&gt;Feel free to comment and ask for help if any is needed.&lt;/li&gt;
&lt;/ul&gt;</content:encoded></item><item><title><![CDATA[IE6 Height Problem]]></title><description><![CDATA[As we all know too well, IE6 has many issues, one of which is the IE6 height problem. The outdated browser reads the CSS differently to the…]]></description><link>https://css-plus.com/2010/03/ie6-height-problem</link><guid isPermaLink="false">https://css-plus.com/2010/03/ie6-height-problem</guid><pubDate>Mon, 22 Mar 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;As we all know too well, IE6 has many issues, one of which is the &lt;strong&gt;IE6 height problem&lt;/strong&gt;. The outdated browser reads the CSS differently to the modern browsers, and it places emphasis on things that aren&apos;t too important. Use IE6 to view the demo IE6 sees the font-size of a div as more important than the actual height of the div. This obviously causes many problems for people since we all learn that if you set the height property of an element in the CSS, it should change accordingly. If it does not, then you have obviously overlooked something. Also, just a side note, IE6 doesn&apos;t support min-height and max-height.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 23px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/84d3d180a3db278d61af2e2c97f776b0/b392f/ie6-height-problem.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 478.2608695652174%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAABgCAYAAAAdOlLaAAAACXBIWXMAAAsTAAALEwEAmpwYAAAUhUlEQVR42pVZB1RU19bedygCCmIBsUI0xoblaYwaNUSTPIkxMeaJNQY1xm6A8IzYMioiVRiKSO91BJEiqPTeZoYBhqEKDAjDACoqWGDm7rfuvQOWZ3z/f9e663Jnnfuxv3P2+fZ3zgEAIN6437yIN57EO78TwGazqBdTP97ueYG19QvcCjfABwDeBXr7yUYa7MQdmem30eKBcWFVON2fn2Pulq37IUD4r6ioC5F+7g4XT/4xvLr2+6jKrE0ZsmMTAwWtk52yVv9fonzvP/k1vsH2p5stze6pDdOo908TWl0XnA058j6w90fGPGmqm+0TjMxvPejaH1y0e7jhjsQ605VOyX/CewaF+B/0Ybe/wOGXm5Jiuh9TyVHUc8V2c6OV14r+/NBoKi8kzLhcFeqmo7Ng65pF3+/4M752K/VuZsb8DgC6czwLLT48wtQAKAeBrRzZwzfuH9sZUV9zcNkytTe/mQagOdOjdO+HAGkAtgjV2dmyj49myz6m3reEN5Zv9chh/9c/BmAt8ORt+gBVAO94qf6GoFrX1UGVTV8Ei0QbA+sidt5oqjfzuPvRewDhH7YxX/ztKLPZ2apbwiXcLyKacEmAUPFlSDX5Q2wL/nZXWn+1qE3z7X5nAI3PB6z622lmHiWx/C6sDv/FrRncldIi/y1NIjdPahn8OV2Kvybdt3m7PTMN55y58ek7lJWzwKFk2o/hTd2/Jjbg4cx2PJjThZYFPXg8rxv3FT1B09SOvnX7z81RcmENf7fAJnz5W3lows5WpX7Y7l9/wSy2Fi2yO/BYgQx/L32EJ8uf4O+lT3B/SR+uvi3BpcFCTzptuDicNvC1Q+LKt8NGJD4GGLUlqoV3LKMTj+VJyb2FPWhV8RRPCgfwOL8f95Q8JNdlSnFmdEOj3Y7fJ72RUqxvnG6/nsvD0W1zLft+5436JydLHuLWnE5yc1YX+W9hP/67agAP8p7itpIe0iSrA4249YNb0/uOMuKD1LdqX1wtWDcyKAd9eXSi7o5scf8jU4oWxT3k8lQJfnGnHc9UPUdL4XM0L3uM3xfLcF2uVDEnsxcnRzbGKxWIBTBZ6zP27fXDScJCJpdUdsY0ZV8QDOC+oh7FFG69fGNaW//5qufyY4IB3FXWixuKZLiuQCafXfAMRwVV1Rz47Bs6J8cu3qw7b78PnYeECZtN011nzV32a1yd5ILwGZrmdqN6aPUDm8JeHxvhgOI3QT9uLekm1xfI0CS/m5yW8xC1ohqfrvfM30J9O2aNqd43B51X0PEN0/3eW2RumSYZOil4jPOSJTg9gJfqKuw7b12PuJ/3dOiH4m5cm9+Na/O6cUKmTK6e+hhn+IvsaJBlGyabbDttTEfIzqY7FbaG1tmdK3uGB0p6cWxo5cudN8U2NkW9GcdFiL/wnshNC2W4Kq8Hl+d2o9a9riFW1iDqXiu9QX2rY2Y1fpmZwwwYLjYAoLkzUpx4SUzid5ntONq7uM06vnbr8fxHg4fLn5E7yvrIdQXd+FluDxrndCPrrlQOGQM45lqJ4KtPv5vJpIqJ6ogs6X9lOXNvTDXvXM0QLk68j7M4WYG/xwksjvCH8BC/X/6v0se4Ml9GR2eY3Y1wW6qA1Meofp3/aNJ+93VKAVAdyfSN7oLPj99ulZ7g9+G08GpcyOZu/S2uOvYw7wXu5/UrNhY9wqW53bg0twd1M7oRkrpIuCVVjIlowlluudsZwGxVMFH23wa/xm0WmTLckS/Fab68ji+v3FqxJ6lZeqSsH3/hDZDrC3txUbYM52d3o9pdClCKEN8+qJn8BCe5FZ5S5qMKleU05S0B/FOnKgbxi7RWnO/L9z8RU7vu53tSPMrrxx2lT3F5tgwXZHXjjCwZEmldCLc6EeIfDEJKP2pcSvXjAqi8JaY7Q3ge1lVDuDChBafaZ/3raKzYal/uQzzG68f19zpxYkIzzkqXMnRTuhBudiLEtg5B0hMcfTktbTloTxgB0zM5OmYPtzb2gOAlzgnk98GJ6Fm7Y0VJh0r7cW/RYzQKF5EQUEHq3GpB1bsyJd0OhJgWOST0orZTPm/ZplMzRgDNrhZNPZjSUrClZABnc7LvLjE7rfdzWsf9o7wB3HS3E42DxXdWcGUXNaLrH0GaDCGxk4S4diSiWxQQ24FjPQRt/ziXMm8E8AuHnHnmyc1NX+U9xZnOd045+aUsMUtpf3aoikTT+Nba3e4l86l2c2MaOepJnQi3OhC4bQhRzSRESsgx1ypeTrFJGpF/WHI+fvn3cXVP16R2oMbF5LW/hvH37UqX4v7yl2gaI3EfbveLA/czzbj2HkjuQYiVkBDZTEJ4s1w9sAnHWET89FoL3dK/NE17gMuCy2WwmW30T59i1/2lz3FX3qNnay4l0wV9mS+qsQFUdbkSHpH8ECG6hYSIZoTQpkG1CBmOsQw7OAK4xrfwx7WFr3CBd95tABi1Ob4567AI8aecxw+0l3w3mwFkBGRy1P0Y1s0uhOhWhPD7CMENgyqxD1HHMtBmBHCZZ/aBT0sRDb2KL84HGP/DLUnbkXrEb1MfiAFgNKPojMTN8Sm8worrQIiSIIQ1IQTUDRGxvahtHWY3ArjII9NmQfpTnOFauPXQuZjFWxJbnxwQI25I68ocLkQmJgzg55yMwyrRbSQNGNJIA0KEFA3sczxxOLk/8srxmBFSNTRrx6UFO8NE+7bd6cSfq0lcGiYMH6lsSlWacyroeyK6bQgiWxGCGxH8auQQ0YHjLqRFmoOhBlCoU4MqY8dfL7lvAqDxuX+V256iAdwqHMKPPTI86P9IOS+l3Vh53Gm1SqTkFQ0Y1IDgI5JDeCeOP3fzzudz5miDGYC6jtO9XK3g2nt0bY2sS94rJPGf5S/IT7xzL48AKs2T/te7FqpFtb+AiBaKLhLXqxQQJMFJjtlF3x2xH0e1Ga1zPkYwMbLFi3b13CbhPhHiZyUDCj0HLjNyJlSJNaP7x2C7xbxRke0vIKwFwb8W4VqlAoJbUdcht2LunisTAHbZjJtwLrZysifP8she2+kbbzR17qwkcUb+E7lmkODoG66fpjz9h/1TRoW3PYPQZgRfMYJXpQICmlHnanH9TOswfdBipxjMuJBQtPx8+FeLbaL/uTGh5aUJbxDVs3pJo5h615mnbi/UPpO/Utv67oqxJzOW6nM6tqgG1j2HoEYE3xoELyEJfo2o7VXRPp19awrMCqqePs/pXpKe3nwDs0SZ+Tf3elG/4BlCRjepEdMkH+VZ9ZLFEb1Uca1+qeJU9YLlyH8FfjUIgfXUgCB4VtCAWu78HkOLYCMwdKswMrRN96e7KqLObkHBK2Tl9snhngwhrhXBR4jgJUDglCO4lCC4liH4iRH8ahGuVyO4C0jwa0J115LHE/c6zoZPbHM/MnIqoi3u/CBR3PgyRMjqHYK7XQgJbQih9QiBYgTfagRvITUICP5ipv+8qxE4DCDLrbxffbvDPJh9xHvmIufsPUkAWgaB/EJWKVJ05XCH0r0OSgQQIpoQQhoQAmqRpktF51ODcK0awVVAU1b14j8fvZ9jDPMPOsxYcyVrhbmFvdGE6NoaKHqFRHq3HFKVdeNGOwMa3kwJAQNKRydC8KpCuMonwaeRKqcvdY84LYKZWw7rb/nZWn/l1YzPdLn3ZZA3gMTdLgXcVgLGtSPESJCWKnru1r+OzrMKwYVHR6jmI3g5+le7RTDNzIo24HNDxT/pULUis4ck0rpISJYiJHQyyvxaqphkvk5FV43gUTkMSKr6VLzS2me/mKmlAKDtmm2lnjlA9d8QTTdRWYhiJQiRLZSQMnOXGmEKkIrOvRLBWQnoW/FK6xADyMzR64VOrPxBCvAVXSbfotuCEEJrH5N7w3Q5lQhOPBL8lYB0hFTBB1CdEl7rBwWDCHdlgzTdWx1UVSOJ8CYFEdygIPxrFYRvjYK4VqkgPIQKglOhIK7yFIR9qRx86xTqPvznWvsuMYBHFn43boJ/eTLkv0JIlQ7RdKn+CxYjeJQhuJUguBQiOOYhXMlFsM1GuJiFwM5AOHeXhKulCnDJRq29l5fSgKt22Rrq+PMEkPMMIUUqH6ar7VfTP9WzutvAo+qhgZvwoYFLRa+BI6/XwL6818CO3zvZrrzX4GJRz2T3qt4pHqU90/ZeXUgDTrOOMR4dVNkJmX0ISZ0KKjoWV4LzQxucvwmTfrTCv2vRSs/7C1d5txmvchYbr+I0Ga/itBmbeDcZr7ITGpsEtBmvD2yYb2gerEEDjrEMXq0eLByC9EckJHSQkCBFIq4Dp58KsFD6Phb8f65pXnmmYyg3kCpTEBTgzU5k3ejAGeeiz9MNfFGN9n5UbeGiCl202Nmqbz6HF+j0Ncnhzj6tjAGE5M4huNmBEPcAWdwOnHHhhj1jfkYaMysutkgd2Fzmpv4ZV6Q+nytSH1kzTrBNsoGMFwjJ0kGIf4DAbUcithP1Lqdy3qgpf7uufmuJTFW9SR4FHEgfoJJ5iBaDWAkSMR2o55wX+A4gLP9xz4Q13pVnlrqUsBc7FZxd6lp2Zllozdl1ocITpuxwHarqaY53SIuhI0x4IGdcVSuyoh/glABR/Ih3Vla9+d8cWKJ7ufyl9qUSHHOxEMfYFZM6AXX4j4DKzh2O96bAbtPdOvqc7Ey4149EfLucnmqRzSQFONFfnM9E+LrQr7YI/5J1NvsVnM9G4nwWCZfz5OMjGnGNd365mdXV8bDSyn+8njefBymPkIhrUyiVhSSiO1Dzuqj+YwAd5XKVtiKLbBK2q1wuloNjKbIcShA8KuQLs57hVy6JqZTGwEz2Xf2xvlVNkNiDcKNNQdGF8CYSIttxlK+4/Y8jf0ynDdXBg7T7mnEk8E+WEx/BtQIJVwFCYO3QmuKXuDUgL4RybvCJbeJHekF1fcDtRCK2lVRKFQkhzajpI350Kr6OXrLOZ9NpAQYX8wJYrpWMdHlWI0Q3D22uIHFvSL4jPXBzz8Qs1fZvICG6nYToVpKRqkZa+9S8ReQnzqX0GsSQnU1PKz2X6kyWh4gSVxK8a1DzZvvgLzWI2x1jz9Bds9SjcL1WSAtC5DDdZsZVBdQqVAJbUN+9Mm54UXPI4rqRtkOZBDzFSFCAPmKckNw5eLwG0ZyTdJhuZ3Di+laV8E6EiDY5HR2lzFQR9xcrqA90nAU9X3s1baTLhKP4L3XbYlr6WVQJ8K8lZ2Z0y08U9uAezp1NzDy2DDoAkV2UIssh5P4bylxD1V0FOAtQ73KZaK1HI0fzXG4XOJbTdFnXRBQTxdL8x2idKenb61vEaKHRhZsWEPqAshRyCGxQmkhl3aCk/iofWewcVDudQeUd/U4VKMJHTOWr/Fv+c7RJrROvOxsyiwZc4Vt6lvBpQC23im7Cr1ZBA/oqAam66yZEsCtC+CsHwa4Qwa0CCYqubx2qcFuH9tUi/hFdmAN6hgY04OKoNo6aZ+Vjw4sZiarXhM9o2j4ikrYZVCFyq0BwKke4UozgTNNFgqIb2IDaSR2DJxsRLaOKQ+kcpNPhmjCC8KqSGO60O6PuLpBAaAtlghQ0XSrXKEAXPoJLOfO3ZzUS3jUIYfdxanrXoG09ohVX+BczQ1EF9C/dTiH8GhqW7/HcpOFSyoPQVqrv5CN1lwK5WkF5GObdS8T0X1QLuSz/ocK2tBcPhfF2MxqCqjDxSkYh4ddYs2myyVwNu9w0CG2jRneIdgUcIT3F6JsC9qhCoOj61yPcbFds5vfjxYymxz/Y3Vo3sjulYZtZzfJpEiEAoWtf7KMa2EoNxhAT3RuAFLhnFRKUSQppwlG3pfJjokG8lNFcvoEymsN7YDpXSxtUOYIq6ofZzhXHtShqnpUkcCpJOqrh6Gi61UhQGRDThnqZPYOXmxCtb1TEMBNJ6cPHeVV1qLrx+LSSHIjepH4hpw+uiamIFK/pCpV0q5H21gmd5JKCh/Irwmd4IKSMNqvZzIYagI57dQ84FdFCunaD6+RRp9MrwEtMgcjfokvlnl8dQlQbErdlip94T/F8RvOjXW63vx3eYqUB1d0q+zQcC1KGq8wYi5QIRu/4ryOk6PrUIr02iZPi6PQe+YmaIbRMrK2giuZbtVvDVdCvZZseOww4/ZeYQ6pn7r2ic4+yu3TuVSEENSHEdCDckuEnuQ8V1qV9eDCqOpjeO+Oh2khV1HDhvVD/Ky10WKKMjPYbqlilSsC+hDGTw9GFtyHckCKkdJMbip/iodvN/WYOKdve3MxkInQRPNe9eMeHVh6rItrNGp4sDVA5nYbgVMrkXXAzQnQHws0uHJveQ27N60Xz+CYBNd2U+z4jKy3QdCp/rmYZyuwrUE6AWuHvC1uhbpU6AHZ5CNepvpMgwe1ESJah0b0u/Da+kdwfUHSSMRXvmIBRzuXP4EiQu3IjcXh/HwxteAGEfTGCd5WCCGuh/Q4kPVBMS5Tguqj6mpkzx41VNmW9deKh4sjv07CKZNbFZuwRf7Jo1WH9sZf5QnAuRrgmlENY/SCE1uLUkJr+n7zzv/6boxICxroIu0dfuOP/BuUR/7KUfWeTnkPZ07Hu/IeaQQ04yV/Uviq4es8HDnAAJrhUtKrbZkUzto03PPz0rt1qjsD6a3fBkdmc8o36VzIsdyf1LKenmJmZyntP0ujlxOX8Gk2OMH1ku07pYWZbXZ/6sWdzyhzKDbwRgRnT5n0nRMy77tmkLBWPWt7IfjS17UltVlhzTy7zqnGjizzl/RBZ7NcL8b8/opvsXB7IchU2mo4x0Bs+4THZyZ44hdMqNt5x5tN3RvJ9B2Bv34s5RX+qugjIWZfytw23nGHHC512IS/rf378vrOsKSdCtqn6P8Bx9mX3tlzvXzzLtvzC6Ms8nHEw4Kv39tHfgzKXvhV3oZpD6aCKfQnq2ZY9VLXlkZPPZ6adOOE+6j0nQcQHjjyZe+6x0Anaf2XxgZoVp1PlOuzs50tPJ699ffjyQZrvP/+bcD7zMjjyUP1iAc65mOmAytR5ZzD+V3Svf98QLTWa5VSVP/cKz1soxdEfWOwQHzjqpK//AL5QYyLIDGjUAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;IE6 height problem&quot;
        title=&quot;ie6-height-problem&quot;
        src=&quot;/static/84d3d180a3db278d61af2e2c97f776b0/b392f/ie6-height-problem.png&quot;
        srcset=&quot;/static/84d3d180a3db278d61af2e2c97f776b0/b392f/ie6-height-problem.png 23w&quot;
        sizes=&quot;(max-width: 23px) 100vw, 23px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;The HTML&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;box1&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;box2&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;box3&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.box1&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; blue&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 150px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.box2&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; black&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 150px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.box3&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; white&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 3px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 150px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; hidden&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;IE6 Height Solution&lt;/h2&gt;
&lt;p&gt;If you looked at the demo using IE6, you will see that the height of box1 is about 18px and the other boxes are both 3px high (Like they should be). Box 1: The classic IE6 height problem. It is meant to be 3 pixels high, but it is defaulting to the font-size assigned to the box. Box 2: Since the minimum height is the font-size, why not give the box a font-size of 0? This will force IE6 to look at the height we assign instead of the font-size as a minimum height. Box 3: We have set the height to 3px, so anything over that is an overflow. If we set the overflow to hidden, it hides the excess of the div. We have to force ie6 to behave like a modern browser. Fortunately it is generally relatively simple.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[IE6 Hover Fix]]></title><description><![CDATA[The  pseudo-class is a very important CSS function. It can be used to highlight text, table-cells, divs, images and much more. Without it…]]></description><link>https://css-plus.com/2010/03/ie6-hover-fix</link><guid isPermaLink="false">https://css-plus.com/2010/03/ie6-hover-fix</guid><pubDate>Mon, 22 Mar 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The &lt;code class=&quot;language-text&quot;&gt;:hover&lt;/code&gt; pseudo-class is a very important CSS function. It can be used to highlight text, table-cells, divs, images and much more. Without it websites would be very bland and boring.
Unfortunately, there is an &lt;strong&gt;IE6 hover&lt;/strong&gt; problem which greatly affects how we can use the :hover pseudo class.&lt;/p&gt;
&lt;p&gt;All modern browsers support the hover pseudo-class properly and it functions properly on any html element, however in IE6 it can only be applied to &lt;code class=&quot;language-text&quot;&gt;&amp;lt;a&gt;&lt;/code&gt; links that contain the href attribute. This problem forces us to either change what we were thinking of doing, or find another way to complete it. Luckily we can fix this terrible IE6 hover problem using the almighty jQuery.
All we need to do is add a simple jQuery function that adds a class to our target element on hover and removes it when we mouse off.&lt;/p&gt;
&lt;p&gt;The jQuery&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;//Highlight the box&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.box&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;hover&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;toggleClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;active&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;What we are saying is&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;When the DOM is ready&lt;/li&gt;
&lt;li&gt;And you hover over &lt;code class=&quot;language-text&quot;&gt;.box&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Toggle the class named &lt;code class=&quot;language-text&quot;&gt;.active&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;So when the document has loaded, and you hover over &lt;code class=&quot;language-text&quot;&gt;.box&lt;/code&gt;, it then adds the class of &lt;code class=&quot;language-text&quot;&gt;.active&lt;/code&gt; to the list of classes it already has (if any at all). This is a very straight forward, helpful and easy to understand bit of jQuery that completely eliminates the IE6 hover issues. We would have to give the &lt;code class=&quot;language-text&quot;&gt;.active&lt;/code&gt; class CSS properties, otherwise our jQuery is adding a class that won&apos;t affect the element due to lack of CSS properties.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;The CSS&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.box&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; black&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 200px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 200px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.active&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; white&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;There we go. If you have to implement this code, it would work exactly like the IE6 hover pseudo class should work and how all modern browsers already work.
I think this is a very simple, effective and elegant way of dealing with the IE6 hover problem. If you are new to jQuery, then this is probably a good place to start learning it since it is very easy to understand what&apos;s going on.&lt;/p&gt;
&lt;p&gt;Keep in mind
You could run into some CSS specificity conflicts. This occurs if an element has two or more CSS rules of equal specificity value that point towards it. Such as:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;content&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;example problem&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; green&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 500px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 300px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.problem&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; black&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 600px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 700px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The class that is further in the CSS document will get the priority, so the &lt;code class=&quot;language-text&quot;&gt;.problem&lt;/code&gt; class would override the &lt;code class=&quot;language-text&quot;&gt;.example&lt;/code&gt; class.
But you could easily fix it by raising the specificity value of the class you would like to dominate, for example:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.content .example&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; green&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 500px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 300px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.problem&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; black&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 600px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 700px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this scenario the box would take the properties of the class &lt;code class=&quot;language-text&quot;&gt;.example&lt;/code&gt; over the &lt;code class=&quot;language-text&quot;&gt;.problem&lt;/code&gt; properties.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[SlideToggle()]]></title><description><![CDATA[The  effect and the  attribute are very useful jQuery tools. I will show you how to quickly implement this into your website and perhaps…]]></description><link>https://css-plus.com/2010/03/slidetoggle</link><guid isPermaLink="false">https://css-plus.com/2010/03/slidetoggle</guid><pubDate>Tue, 16 Mar 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The &lt;code class=&quot;language-text&quot;&gt;slideToggle()&lt;/code&gt; effect and the &lt;code class=&quot;language-text&quot;&gt;toggleClass()&lt;/code&gt; attribute are very useful jQuery tools. I will show you how to quickly implement this into your website and perhaps give you ideas on how you can add this to your already existing websites.&lt;/p&gt;
&lt;h2&gt;Step 1 - What am I planning on doing?&lt;/h2&gt;
&lt;p&gt;What I want to do is add a slideToggle() effect to the {CSS: +; DEMOPAGE; } logo and another seperate &lt;code class=&quot;language-text&quot;&gt;slideToggle()&lt;/code&gt; effect to the CSS-text image behind it.&lt;/p&gt;
&lt;h2&gt;Step 2 - The HTML&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;page-wrap&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;&amp;lt;!--used to center everything--&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;header&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;http://css-plus.com&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;home-link&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;CSS Plus&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token comment&quot;&gt;&amp;lt;!-- {CSS: +; } logo --&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;content&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;button-wrap&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;&amp;lt;!-- used to align the buttons nicely --&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;toggle-logo&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Toggle logo&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token comment&quot;&gt;&amp;lt;!-- button 1 --&gt;&lt;/span&gt;
            &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;toggle-header&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Toggle header&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token comment&quot;&gt;&amp;lt;!-- button 2 --&gt;&lt;/span&gt;
        &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Step 3 - The CSS&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;/* reset margin and padding */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #79694c &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../../images/bg.jpg&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; repeat-x left top&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; sans-serif&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;overflow-y&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; scroll&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.page-wrap&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; relative&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;min-width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 991px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1024px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;/*
        Basic Elements
    */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.header&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../../images/css-bg.gif&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; no-repeat 50px top&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 127px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 0 auto&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 100%&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 39px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;/* add css-text image and set header position */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.home-link&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../../images/logo.gif&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; no-repeat left 5px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 127px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 878px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-indent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -9999px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;/* add logo */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.content&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 960px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; absolute&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 224px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;/*
        slideToggle() demo
    */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.content .button-wrap&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px 0 0 0&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 960px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;/* add button styling */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.content .button-wrap a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #006ec1&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1px solid #034e86&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #fff&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; bold&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 5px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; center&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-decoration&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 10px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.content .button-wrap a.toggle-header&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; right&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.content .button-wrap a.toggle-logo&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;/* add active state styling*/&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.content .button-wrap a.active&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; #8f0000&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1px solid #450000&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;/* this will be explained later on */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.content .button-wrap .hidden&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The CSS is pretty straightforward.&lt;/p&gt;
&lt;h2&gt;Step 4 - The jQuery&lt;/h2&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.content .button-wrap a.toggle-logo&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// When you click on a.toggle-logo&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.header a.home-link&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;slideToggle&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;slow&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// Toggle the &quot;slow&quot; slide effect on the logo&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;toggleClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;active&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// Toggle the active button state&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// Prevents browser from jumping to link anchor&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.content .button-wrap a.toggle-header&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// When you click on a.toggle-header&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.header&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;slideToggle&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;slow&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// Toggle the &quot;slow&quot; slide effect on .header&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;toggleClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;active&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// Toggle the active button state&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// Prevents browser from jumping to link anchor&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;With just 8 short lines of jQuery code we have two interactive buttons.&lt;/p&gt;
&lt;h2&gt;A problem you say?&lt;/h2&gt;
&lt;p&gt;I was playing around with the buttons; Turning one off and then the other one on, etc. and I found that if I clicked the &quot;Toggle logo&quot;, then &quot;Toggle header&quot;, then &quot;Toggle logo&quot; again, the logo would still be &quot;off&quot;, which is what we want. However, if we clicked on &quot;Toggle header&quot;, &quot;Toggle logo&quot; then &quot;Toggle header&quot; again, the logo was still there but the button was on active state (red). To fix this I added 1 more line to the jQuery, this is also where I make use of &quot;hidden&quot; class I declared in the CSS.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.content .button-wrap a.toggle-logo&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;toggleClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;hidden&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What that line of jQuery does is: whenever you click on the &quot;Toggle header&quot; button, it toggles the &quot;hidden&quot; class on the &quot;Toggle logo&quot; button. That way it prevents the little problem we have by hiding the one button when the other one is clicked. So the final jQuery code looks like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.content .button-wrap a.toggle-logo&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.header a.home-link&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;slideToggle&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;slow&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;toggleClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;active&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.content .button-wrap a.toggle-header&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.header&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;slideToggle&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;slow&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;toggleClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;active&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;// Toggles the &quot;hidden&quot; class on a.toggle-logo&lt;/span&gt;
        &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.content .button-wrap a.toggle-logo&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;toggleClass&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;hidden&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content:encoded></item><item><title><![CDATA[Fading Navigation Menu]]></title><description><![CDATA[For my first tutorial, I have decided on building a simple, yet awesome navigation menu using CSS sprites. After we are done with this I…]]></description><link>https://css-plus.com/2010/03/fading-navigation-menu</link><guid isPermaLink="false">https://css-plus.com/2010/03/fading-navigation-menu</guid><pubDate>Mon, 15 Mar 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;For my first tutorial, I have decided on building a simple, yet awesome navigation menu using CSS sprites. After we are done with this I will add a bit of jquery code to give it a visually appealing fade effect. I have included the Photoshop &lt;code class=&quot;language-text&quot;&gt;.psd&lt;/code&gt; file I created in the &lt;a href=&quot;http://css-plus.com/downloads/fade-nav-menu.zip&quot;&gt;download&lt;/a&gt; under the images folder to make it easier for you to create your own Fading Navigation Menu.&lt;/p&gt;
&lt;p&gt;&lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 545px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/4e073b5dd817b54b485da7f08d18157b/3ddad/fade-nav-menu-header.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 20.27027027027027%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAIAAAABPYjBAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA3ElEQVR42mNIi/HMT/LKS/TKBaOcBM+sOPesOPfcBM/cRM/cRJAUXBbGBmlJj/FgKEz13bdtwcnDG4/tX3X+6PqWrpqQ9MSU8nzX2DDv2JADu5adOLTu2P41x/evPrp35bH9q4/tX3P22KZta6fmJnoxFKX6blk9de+2Rfu3Lzy5b0VTW5l3XGhsfqpHbIh/XMj2jXP2bluwa/P8AzsW7QMz9mxZcHTvik3L+/MSvRjSoj2y49yyYl0zY0AoJ949L8EjJ84tP9EzP9EzKxYkBZeFsDOiXbPj3FJjPACHTHHjkowjhgAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Fading Navigation Menu&quot;
        title=&quot;fade-nav-menu-header&quot;
        src=&quot;/static/4e073b5dd817b54b485da7f08d18157b/3ddad/fade-nav-menu-header.png&quot;
        srcset=&quot;/static/4e073b5dd817b54b485da7f08d18157b/12f09/fade-nav-menu-header.png 148w,
/static/4e073b5dd817b54b485da7f08d18157b/e4a3f/fade-nav-menu-header.png 295w,
/static/4e073b5dd817b54b485da7f08d18157b/3ddad/fade-nav-menu-header.png 545w&quot;
        sizes=&quot;(max-width: 545px) 100vw, 545px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
        decoding=&quot;async&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;What is a sprite?&lt;/h2&gt;
&lt;p&gt;In case you aren&apos;t sure, a CSS sprite is a large image, made up of all the smaller images you wish to use on your webpage. The benefits of using CSS sprites include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Page load speed
&lt;ul&gt;
&lt;li&gt;Reduces HTTP requests&lt;/li&gt;
&lt;li&gt;Each image file contains extra unnecessary information. Using one image saves on file size.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Save on editing time
&lt;ul&gt;
&lt;li&gt;If I&apos;m working on a navigation menu and I need to edit the hover states in photoshop, all I do is edit one of the layer styles and paste it over the rest of the button hover states, save and all is done. Doing this takes a matter of seconds.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Easier to organize
&lt;ul&gt;
&lt;li&gt;The more files there are, the greater the margin for confusion and error is. Also, I don&apos;t enjoy a messy work environment.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Step 1 - The HTML&lt;/h2&gt;
&lt;p&gt;Alright, let&apos;s get started. First thing we need to do is create the html.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;html&quot;&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;ul&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;nav&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;home&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Blog&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;about&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;About&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;contact&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Contact&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;freebies&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;a&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;#&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;Freebies&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;ul&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It is a very simple unordered list and I have given each of the list items class names so that we can target them individually. The sprite we are going to be using is this one that I created: &lt;img src=&quot;fade-nav-sprite-prop.png&quot; alt=&quot;Fade navigation sprite&quot; title=&quot;fade-nav-sprite-prop&quot;&gt; I usually create a red grid around the items to make it easier to determine where the one &apos;image&apos; begins and the other one ends. We give the CSS the x and y co-ordinates of our sprite, this is how it knows which area to look at. Since each list item has a different class, we can target each of them and give them different sprite background-positions.&lt;/p&gt;
&lt;h2&gt;Step 2 - The CSS&lt;/h2&gt;
&lt;p&gt;I always import a css reset. I use a modified version of &lt;a href=&quot;http://meyerweb.com/eric/tools/css/reset/index.html&quot;&gt;Eric Mayer&apos;s CSS reset&lt;/a&gt; which include with these downloads.&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.nav li,
.nav a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/nav-sprite.png&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; no-repeat left top&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 67px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 192px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;/* We give the &amp;lt;li&gt; and &amp;lt;a&gt; the sprite as the background and set the button dimensions */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1px solid #243e3b&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.home&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1px solid #243e3b&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-indent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -9999px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token selector&quot;&gt;.nav li.home a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -1px -1px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;/* Here we set the background/sprite position */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.about a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -194px -1px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.contact a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -387px -1px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.freebies a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -580px -1px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token selector&quot;&gt;.nav li.home a:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -1px -69px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;/* And now the hover background-position position */&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.about a:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -194px -69px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.contact a:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -387px -69px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.freebies a:hover&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -580px -69px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That&apos;s it! We have a working CSS sprite navigation menu. &lt;a href=&quot;http://css-plus.com/examples/2010/03/fade-navigation/navigation/&quot;&gt;Demo CSS version&lt;/a&gt; / &lt;a href=&quot;http://css-plus.com/downloads/2010/03/nav-menu.rar&quot;&gt;Download CSS version&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Step 3 - The jQuery&lt;/h2&gt;
&lt;p&gt;Before we do anything more, remember to always include the &lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery library&lt;/a&gt; when using any jQuery plugins or code. We have to slightly modify the CSS before we can make us of the cool fade effect. First we have to decide how we will go about creating the effect. I think the most efficient way would be to give the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;li&gt;&lt;/code&gt; item the default background state and the &lt;code class=&quot;language-text&quot;&gt;&amp;lt;a&gt;&lt;/code&gt; link the hover state with an opacity of 0. When we hover it will fade to an opacity of 1, and when we mouse off it will fade back to 0, giving the fade effect. We slightly modify the CSS selectors to look like this:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;css&quot;&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token selector&quot;&gt;.nav li,
.nav a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token url&quot;&gt;&lt;span class=&quot;token function&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;../images/nav-sprite.png&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; no-repeat left top&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 67px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 192px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; left&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1px solid #243e3b&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; none&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; block&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;text-indent&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -9999px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token selector&quot;&gt;.nav li.home&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -1px -1px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;border-left&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; 1px solid #243e3b&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.about&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -194px -1px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.contact&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -387px -1px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.freebies&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -580px -1px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token selector&quot;&gt;.nav li.home a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -1px -69px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.about a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -194px -69px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.contact a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -387px -69px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token selector&quot;&gt;.nav li.freebies a&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token property&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; -580px -69px&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;javascript&quot;&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;//Set the anchor link opacity to 0 and begin hover function&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.nav a&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;hover&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;//Fade to an opacity of 1 at a speed of 200ms&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;//On mouse-off&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;//Fade to an opacity of 0 at a speed of 100ms&lt;/span&gt;
                &lt;span class=&quot;token function&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token literal-property property&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;code class=&quot;language-text&quot;&gt;stop()&lt;/code&gt; is necessary so that the animations don&apos;t queue up if you mouse-on and off repeatedly very quickly. And we are done in 3 easy steps. Pretty simple right?&lt;/p&gt;</content:encoded></item><item><title><![CDATA[CSS Plus Launched]]></title><description><![CDATA[Hi everyone. This is my first article on css-plus.com. I am going to be fine tuning a few things before I start on the awesome tutorials…]]></description><link>https://css-plus.com/2010/03/css-plus-launched</link><guid isPermaLink="false">https://css-plus.com/2010/03/css-plus-launched</guid><pubDate>Wed, 10 Mar 2010 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Hi everyone. This is my first article on css-plus.com. I am going to be fine tuning a few things before I start on the awesome tutorials, articles and freebies. I&apos;m pretty excited to get things going.&lt;/p&gt;
&lt;p&gt;Come back and check on the progress!&lt;/p&gt;</content:encoded></item></channel></rss>