{"id":1554,"date":"2012-08-07T17:06:33","date_gmt":"2012-08-07T17:06:33","guid":{"rendered":"http:\/\/cssreset.com\/?p=1554"},"modified":"2012-08-07T17:06:33","modified_gmt":"2012-08-07T17:06:33","slug":"create-killer-sliding-boxes-with-css3","status":"publish","type":"post","link":"https:\/\/cssdeck.com\/blog\/create-killer-sliding-boxes-with-css3\/","title":{"rendered":"Create Killer Sliding Boxes with CSS3"},"content":{"rendered":"<p>Make a killer sliding image box for your website with the help of this insightful CSS3 tutorial and some of your ninja coding skills.<!--more--><\/p>\n<p>By now, everyone has seen some of the sliding box animations made possible by CSS3 features. This lesson walks you through the necessary steps to make them and will hopefully impart some other helpful knowledge along the way. It&#8217;s best viewed in HD in full screen mode.<\/p>\n<p>This CSS tutorial video is a perfect example of something that is fairly straight forward in following along with and executing for advanced users, but rather difficult in describing in written directions in a short post such as this. So to save everyone from confusion we will focus on the code used in the video and share it below. This way you can compare it to what you ended up with in the end.<\/p>\n<p>To begin with, you need to set up the initial HTML. This gives you the basic box, and a place for the image to be placed. It also provides the shell for the slider.<\/p>\n<pre class=\"prettyprint linenums\">&lt;div id=\"montage-wrap\"&gt;\r\n\t&lt;div class=\"montage-block\"&gt;\r\n\t\t&lt;span id=\"block1\"&gt;&lt;\/span&gt;\r\n\t\t&lt;div class=\"thumb_content\"&gt;\r\n\t\t\t&lt;h1&gt;Sample Title&lt;\/h1&gt;\r\n\t\t\t&lt;p&gt;This is a sample title. Sample text.&lt;\/p&gt;\r\n\t\t&lt;\/div&gt;\t\r\n\t&lt;\/div&gt; \r\n&lt;\/div&gt;<\/pre>\n<p>Now, the CSS begins small, but grows in complexity with each idea introduced throughout the process. By the time you are done with all the styling, it should look something like this.<\/p>\n<pre class=\"prettyprint linenums\">body { font: 13px sans-serif; }\r\n\r\n#montage-wrap\t{ width: 820px; height: 200px; }\r\n.montage-block\t{ width: 200px; height: 200px; float: left; display: block; overflow: hidden; position: relative; \r\n\t\tmargin: 0 4px 0 0; background: white; border: 1px solid #666;}\r\n.montage-block:last-child    { margin: 0; } \/* removes margin on last block *\/\r\n\r\n#block1\t{ width: 200px; height: 200px; position: absolute; display: block;\r\n\t\tbackground: url(\"pixelforlife_thumb.png\") no-repeat; \r\n\r\n\t\t-webkit-transition: top .3s ease-in-out; }\r\n\r\n.montage-block:hover #block1 \t{ top: -150px; }\r\n\r\n.thumb_content\t{ padding: 70px 15px 0 15px; color: #777; }\r\n.thumb_content h1\t{ margin: 0 0 5px 0; color: #666; font-size: 14px; }<\/pre>\n<p>And to tie everything together, your final HTML code should be something like this.<\/p>\n<pre class=\"prettyprint linenums\">&lt;body&gt;\r\n\r\n&lt;div id=\"montage-wrap\"&gt;\r\n\r\n\t&lt;div class=\"montage-block\"&gt;\r\n\t\t&lt;span id=\"block1\"&gt;&lt;\/span&gt;\r\n\t\t&lt;div class=\"thumb_content\"&gt;\r\n\t\t\t&lt;h1&gt;Sample Title&lt;\/h1&gt;\r\n\t\t\t&lt;p&gt;This is a sample title. Sample text.&lt;\/p&gt;\r\n\t\t&lt;\/div&gt;\t\r\n\t&lt;\/div&gt; &lt;!-- block end --&gt;\r\n\r\n    &lt;!-- A sample Block --&gt;\r\n\t&lt;div class=\"montage-block\"&gt;\r\n\t\t&lt;span id=\"block1\"&gt;&lt;\/span&gt;\r\n\t\t&lt;div class=\"thumb_content\"&gt;\r\n\t\t\t&lt;h1&gt;Sample Title&lt;\/h1&gt;\r\n\t\t\t&lt;p&gt;This is a sample title. Sample text.&lt;\/p&gt;\r\n\t\t&lt;\/div&gt;\t\r\n\t&lt;\/div&gt; &lt;!-- block end --&gt;\r\n\r\n&lt;\/div&gt; &lt;!-- montage wrap --&gt;\r\n\r\n&lt;\/body&gt;<\/pre>\n<p>If you found this CSS tutorial useful, the you will also enjoy this one on <a title=\"Bring Life to Your Projects by Rotating Objects with CSS3 Animations\" href=\"https:\/\/cssdeck.com\/blog\/\/bring-life-to-your-projects-by-rotating-objects-with-css3-animations\/\">rotating objects with CSS3 animations<\/a>. Thanks for stopping by!<\/p>\n<div class=\"wp-socializer wpsr-share-icons \" data-lg-action=\"show\" data-sm-action=\"show\" data-sm-width=\"768\" ><h3>Share and Enjoy !<\/h3><div class=\"wpsr-si-inner\"><div class=\"wpsr-counter wpsrc-sz-32px\" style=\"color:#000\"><span class=\"scount\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook,twitter,linkedin,pinterest,print,pdf\">0<\/span><\/span><small class=\"stext\">Shares<\/small><\/div><div class=\"socializer sr-popup sr-32px sr-circle sr-opacity sr-pad sr-count-1 sr-count-1\"><span class=\"sr-facebook\"><a rel=\"nofollow\" href=\"https:\/\/www.facebook.com\/share.php?u=\" target=\"_blank\"  title=\"Share this on Facebook\"  style=\"color: #ffffff\" ><i class=\"fab fa-facebook-f\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-twitter\"><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/intent\/tweet?text=%20-%20%20\" target=\"_blank\"  title=\"Tweet this !\"  style=\"color: #ffffff\" ><i class=\"fab fa-twitter\"><\/i><\/a><\/span>\n<span class=\"sr-linkedin\"><a rel=\"nofollow\" href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=\" target=\"_blank\"  title=\"Add this to LinkedIn\"  style=\"color: #ffffff\" ><i class=\"fab fa-linkedin-in\"><\/i><\/a><\/span>\n<span class=\"sr-pinterest\"><a rel=\"nofollow\" href=\"https:\/\/www.pinterest.com\/pin\/create\/button\/?url=&amp;media=&amp;description=\" target=\"_blank\"  title=\"Submit this to Pinterest\"  style=\"color: #ffffff\" data-pin-custom=\"true\"><i class=\"fab fa-pinterest\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"pinterest\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-print\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Print this article \"  style=\"color: #ffffff\" ><i class=\"fa fa-print\"><\/i><\/a><\/span>\n<span class=\"sr-pdf\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Convert to PDF\"  style=\"color: #ffffff\" ><i class=\"fa fa-file-pdf\"><\/i><\/a><\/span><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Make a killer sliding image box for your website with the help of this insightful CSS3 tutorial and some of your ninja coding skills.<\/p>\n<p>Share and Enjoy !0Shares0<\/p>\n<p>0<\/p>\n<p> [&#8230;]<\/p>\n<p><a class=\"more-link video\" href=\"https:\/\/cssdeck.com\/blog\/create-killer-sliding-boxes-with-css3\/\" title=\"Click to watch 'Create Killer Sliding Boxes with CSS3'\">Watch Video<\/a><\/p>\n","protected":false},"author":18,"featured_media":1558,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,13],"tags":[62,49,39,99,102,83],"_links":{"self":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/1554"}],"collection":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/comments?post=1554"}],"version-history":[{"count":4,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/1554\/revisions"}],"predecessor-version":[{"id":1560,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/1554\/revisions\/1560"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/media\/1558"}],"wp:attachment":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/media?parent=1554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/categories?post=1554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/tags?post=1554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}