Pure css ‘Pinterest Design’

Pinterest is a great concept in web design to keep cards in nice alignment. Now in CSS/CSS3 world we can easily build it with pure css even without single line code of JS. Following, I am writing very simple code structure to show cards in ‘Pinterest Design’.

pinterest-design
pinterest-design

DOM Structure

<section class="pinterest_design">
 <h2 class="pinterest_design--title">Pinterest Design</h2>
 <ul class="pinterest_design--columns">
 <li class="pinterest_design--pin">
 <h3 class="pinterest_design--pin-title">What is Lorem Ipsum?</h3>
 <p class="pinterest_design--pin-body">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. when an unknown printer took a galley of type and scrambled it to make a type specimen book</p>
 </li>
 <li class="pinterest_design--pin">
 <h3 class="pinterest_design--pin-title">Why do we use it?</h3>
 <p class="pinterest_design--pin-body">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here'</p>
 </li>
 <li class="pinterest_design--pin">
 <h3 class="pinterest_design--pin-title">Where does it come from?</h3>
 <p class="pinterest_design--pin-body">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. </p>
 </li>
 <li class="pinterest_design--pin">
 <h3 class="pinterest_design--pin-title">Where can I get some?</h3>
 <p class="pinterest_design--pin-body">There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable.</p>
 </li>
 <li class="pinterest_design--pin">
 <h3 class="pinterest_design--pin-title">The standard Lorem Ipsum passage, used since the 1500s</h3>
 <p class="pinterest_design--pin-body">"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. "</p>
 </li>
 <li class="pinterest_design--pin">
 <h3 class="pinterest_design--pin-title">1914 translation by H. Rackham</h3>
 <p class="pinterest_design--pin-body">"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth,"</p>
 </li>
 </ul>
</section>

CSS

 * {
    margin: 0;
    padding: 0;
}
            
.pinterest_design {
    width: 50%;
    margin: auto;
}
            
.pinterest_design--title {
    margin: 30px 0px;
}
            
.pinterest_design--columns {
    column-width: 320px;
    column-gap: 15px;
}
            
.pinterest_design--pin {
    display: inline-block;
    width: 100%;
    margin-bottom: 15px;
}
            
.pinterest_design--pin-title {
    background-color: #006FC4;
    color: #ffffff;
    padding: 10px 20px;
}
            
.pinterest_design--pin-body {
    background-color: #dddddd;
    padding: 10px 20px;
}

Best Practices & Considerations when writing HTML Emails

Following text fully Copywriting from http://stackoverflow.com/questions/2229822/best-practices-considerations-when-writing-html-emails/21437734#21437734

This seems like a great place to list some resources for anyone trying to learn HTML email. This is (probably) the most comprehensive list of HTML Email resources you will find on the web. Happy learning.

Getting Started Guides:

CSS Support & General Guides:

You should always inline your CSS in html-email. Here is a list of CSS Inlining Tools

Responsive Guides:

Templates & Frameworks:

Responsive Alternate Examples:

Also the Ted Goas Responsive link above has an excellent fluid example.

Troubleshooting & General Guides:

You’ll need to use VML to get background images working in Outlook (Except in the body tag). Here are some VML links:

Pure CSS3 Accordion

Pure CSS3 Accordion! creating CSS3 based accordion can be a tricky task, so in this post I will try to share the concept that how to make it. But indeed we can always use jQuery to include nice effects.

Pure CSS3 Accordion GUI
Pure CSS3 Accordion

The DOM Structure

<section>
   <h3>Auto collapse</h3>
    <ul>
        <li>
            <label>
                <input type="radio" name="auto-collapse" checked="checked" />
                <span class="title">What is Lorem Ipsum?</span>
                <span class="detail">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</span>
            </label>
        </li>
        <li>
            <label>
                <input type="radio" name="auto-collapse" />
                <span class="title">Where does it come from?</span>
                <span class="detail">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</span>
            </label>
        </li>
        <li>
            <label>
                <input type="radio" name="auto-collapse" />
                <span class="title">Why do we use it?</span>
                <span class="detail">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</span>
            </label>
        </li>
    </ul>
</section>
    
<hr>
    
<section>
   <h3>Manual collapse</h3>
    <ul>
        <li>
            <label>
                <input type="checkbox" name="manual-collapse" checked="checked" />
                <span class="title">What is Lorem Ipsum?</span>
                <span class="detail">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</span>
            </label>
        </li>
        <li>
            <label>
                <input type="checkbox" name="manual-collapse" />
                <span class="title">Where does it come from?</span>
                <span class="detail">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</span>
            </label>
        </li>
        <li>
            <label>
                <input type="checkbox" name="manual-collapse" />
                <span class="title">Why do we use it?</span>
                <span class="detail">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</span>
            </label>
        </li>
    </ul>
</section>

CSS

* {
            margin: 0px;
            padding: 0px;
        }
        
        hr {
            margin: 20px 0px;
        }
        
        section {
            width: 500px;
            margin: auto;  
        }
        
        h3 {
            margin: 20px 0px;
        }
        
        ul, li {
            list-style: none;
            padding: 0px;
            margin: 0px;
            position: relative;
        }
        
        li {
            margin-bottom: 10px;
        }
        
        input[type="radio"],
        input[type="checkbox"] {
            opacity:0;
            position: absolute;
            top: 20px;
            left: 80px;
        }
        
        .title {
            background: #EFEFEF;
            padding: 10px 20px;
            cursor: pointer;
            display: block;
            border: 1px solid #dddddd;
            border-radius: 3px;
        }
        
        .detail {
            opacity: 0;
            height: 0px;
            border: 1px solid #dddddd;
            display: block;         
        }
        
        input[type="radio"]:checked ~ .title,
        input[type="checkbox"]:checked ~ .title {
            background: #006FC4;
            border: 1px solid #006FC4;
            color: #ffffff;
            border-radius: 3px;
            border-bottom-left-radius: 0px;
            border-bottom-right-radius: 0px;
        }

         input[type="radio"]:checked ~ .detail,
         input[type="checkbox"]:checked ~ .detail {
            opacity: 1;
            height: auto;
            padding: 20px;
            border-bottom-left-radius: 3px;
            border-bottom-right-radius: 3px;
        }