How to create these boxes with CSS and HTML [closed]


Tags: html,css,html5,css3

Problem :

If I go to this website https://www.odesk.com/ and scroll down a little bit, there are some boxes just below "Find talented freelances ready" and I was wondering how I would create these using CSS?

Also on the website http://www.lynda.com/ there are some nice boxes that flip on hover, and I was wondering if there was anyway to recreate these too.



Solution :

For the flip animation:

You have to create four divs: two to hold the whole thing, one which is the front, and holds the contents for when the front is showing, and lastly the back one, which displays on hover.

<div class="flip-container" ontouchstart="this.classList.toggle('hover');">
<div class="flipper">

<!-- This is the front of the card, put your initial content here -->

    <div class="front">
        <h1>Hello</h1>      
    </div>

<!-- This is the back of the card, put the content to be displayed on flip here-->

    <div class="back">
        <h1>Hello again!</h1>
    </div>
</div>

And the CSS:

/* entire container, keeps perspective */
.flip-container {
perspective: 1000;
}
/* flip the pane when hovered */
   .flip-container:hover .flipper, .flip-container.hover .flipper {
    transform: rotateY(180deg);
}

.flip-container, .front, .back {
width: 155px;
height: 150px;
}

/* flip speed goes here */
.flipper {
transition: 0.6s;
transform-style: preserve-3d;

position: relative;
}

/* hide back of pane during swap */
.front, .back {
backface-visibility: hidden;

position: absolute;
top: 0;
left: 0;
}

/* front pane, placed above back */
.front {
border: 2px black solid;
text-align: center;
background-color: #76EE00;
z-index: 2;
/* for firefox 31 */
transform: rotateY(0deg);
}

/* back, initially hidden pane */
.back {
    border: 2px black solid;
    text-align: center;
background-color: #66CD00;
transform: rotateY(180deg);
}

JSFiddle: http://jsfiddle.net/jofish999/twuddn6f/


And the boxes on the other site...

And as a sidenote if your interested, here's the CSS from the site for the boxes.

CSS

.oBtn {
  height: 35px;
  line-height: 35px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  display: inline-block;
  background: transparent;
  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
  font-weight: bold;
  font-size: 14px;
  line-height: 35px;
  border-radius: 6px;
  background-clip: padding-box;
  padding: 5px 14px 3px;
  -webkit-font-smoothing: antialiased;
  font-smoothing: always
}
.oBtn.isDisabled,
.oBtnDisabled,
.oBtn[disabled],
.oBtn.isDisabled:active,
.oBtnDisabled:active,
.oBtn[disabled]:active,
.oBtn.isDisabled:hover,
.oBtnDisabled:hover,
.oBtn[disabled]:hover {
  color: #a7a7a2;
  border: 1px solid #e0e0de;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
  text-shadow: none;
  background: #f0f0ee;
  cursor: default
}
.oBtn:hover {
  text-decoration: none
}
.oBtnPrimary {
  color: white;
  background: #7bd454;
  background: #7bd454 -webkit-linear-gradient(top, #7bd454, #62c831 95%, #53bf29);
  background: #7bd454 -moz-linear-gradient(top, #7bd454, #62c831 95%, #53bf29);
  background: #7bd454 -o-linear-gradient(top, #7bd454, #62c831 95%, #53bf29);
  background: #7bd454 linear-gradient(top, #7bd454, #62c831 95%, #53bf29);
  border: 1px solid #509e19;
  border-bottom-color: #198d0f;
  border-top-color: #6dbe38;
  -webkit-box-shadow: 0 1px 3px rgba(38, 151, 72, 0.5), inset 0 1px 0 #9fe662;
  -moz-box-shadow: 0 1px 3px rgba(38, 151, 72, 0.5), inset 0 1px 0 #9fe662;
  box-shadow: 0 1px 3px rgba(38, 151, 72, 0.5), inset 0 1px 0 #9fe662;
  text-shadow: 0 1px 0 #25a811
}
.oBtnPrimary:hover {
  background: #93dd64;
  background: #93dd64 -webkit-linear-gradient(top, #93dd64, #72d239 95%, #6fcc37);
  background: #93dd64 -moz-linear-gradient(top, #93dd64, #72d239 95%, #6fcc37);
  background: #93dd64 -o-linear-gradient(top, #93dd64, #72d239 95%, #6fcc37);
  background: #93dd64 -ms-linear-gradient(top, #93dd64, #72d239 95%, #6fcc37);
  background: #93dd64 linear-gradient(top, #93dd64, #72d239 95%, #6fcc37);
  -webkit-box-shadow: 0 1px 3px rgba(38, 151, 72, 0.5), inset 0 1px 0 #9fe662;
  -moz-box-shadow: 0 1px 3px rgba(38, 151, 72, 0.5), inset 0 1px 0 #9fe662;
  box-shadow: 0 1px 3px rgba(38, 151, 72, 0.5), inset 0 1px 0 #9fe662;
  border: 1px solid #6dbe38;
  border-bottom: 1px solid #198d0f;
  color: white
}
.oBtnPrimary:active {
  background: #6ec54f;
  background: #6ec54f -webkit-linear-gradient(top, #6ec54f, #56b92d);
  background: #6ec54f -moz-linear-gradient(top, #6ec54f, #56b92d);
  background: #6ec54f -o-linear-gradient(top, #6ec54f, #56b92d);
  background: #6ec54f -ms-linear-gradient(top, #6ec54f, #56b92d);
  background: #6ec54f linear-gradient(top, #6ec54f, #56b92d);
  border: 1px solid #239365;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
  color: white
}
.oBtnPrimary:visited {
  color: white
}
.oBtnPrimaryBlue {
  background: #00aaec;
  background: #00aaec -webkit-linear-gradient(top, #00aaec, #00a7ec 95%, #0096e8);
  background: #00aaec -moz-linear-gradient(top, #00aaec, #00a7ec 95%, #0096e8);
  background: #00aaec -o-linear-gradient(top, #00aaec, #00a7ec 95%, #0096e8);
  background: #00aaec linear-gradient(top, #00aaec, #00a7ec 95%, #0096e8);
  color: white;
  border: 1px solid #007de8;
  border-bottom-color: #1d60dd;
  border-top-color: #0a81d4;
  -webkit-box-shadow: 0 1px 3px rgba(15, 59, 141, 0.31), inset 0 1px 0 #00c1f0;
  -moz-box-shadow: 0 1px 3px rgba(15, 59, 141, 0.31), inset 0 1px 0 #00c1f0;
  box-shadow: 0 1px 3px rgba(15, 59, 141, 0.31), inset 0 1px 0 #00c1f0;
  text-shadow: 0 1px 0 #0069de
}
.oBtnPrimaryBlue:hover {
  background: #00b6ee;
  background: #00b6ee -webkit-linear-gradient(top, #00b6ee, #00b0ee 95%, #00a1eb);
  background: #00b6ee -moz-linear-gradient(top, #00b6ee, #00b0ee 95%, #00a1eb);
  background: #00b6ee -o-linear-gradient(top, #00b6ee, #00b0ee 95%, #00a1eb);
  background: #00b6ee -ms-linear-gradient(top, #00b6ee, #00b0ee 95%, #00a1eb);
  background: #00b6ee linear-gradient(top, #00b6ee, #00b0ee 95%, #00a1eb);
  -webkit-box-shadow: 0 1px 3px rgba(15, 59, 141, 0.31), inset 0 1px 0 #00c1f0;
  -moz-box-shadow: 0 1px 3px rgba(15, 59, 141, 0.31), inset 0 1px 0 #00c1f0;
  box-shadow: 0 1px 3px rgba(15, 59, 141, 0.31), inset 0 1px 0 #00c1f0;
  text-shadow: 0 1px 0 #0069de;
  border: 1px solid #007de8;
  border-bottom-color: #1d60dd;
  border-top-color: #0a81d4;
  color: white
}
.oBtnPrimaryBlue:active {
  background: #1a9fec;
  background: #1a9fec -webkit-linear-gradient(top, #1a9fec, #1a9fec);
  background: #1a9fec -moz-linear-gradient(top, #1a9fec, #1a9fec);
  background: #1a9fec -o-linear-gradient(top, #1a9fec, #1a9fec);
  background: #1a9fec -ms-linear-gradient(top, #1a9fec, #1a9fec);
  background: #1a9fec linear-gradient(top, #1a9fec, #1a9fec);
  color: white;
  border: 1px solid #156ee8;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none
}
.oBtnPrimaryBlue:visited {
  color: white
}
.oBtnSecondary {
  cursor: pointer;
  font-family: "Helvetica", Arial, sans-serif;
  font-weight: normal;
  font-size: 16px;
  padding: 12px;
  color: #80807c;
  background-image: -webkit-gradient(linear, 50% 0, 50% 100%, color-stop(0%, #f4f4f2), color-stop(100%, #e5e5e3));
  background-image: -webkit-linear-gradient(#f4f4f2, #e5e5e3);
  background-image: -moz-linear-gradient(#f4f4f2, #e5e5e3);
  background-image: -o-linear-gradient(#f4f4f2, #e5e5e3);
  background-image: linear-gradient(#f4f4f2, #e5e5e3);
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  -ms-border-radius: 5px;
  -o-border-radius: 5px;
  border-radius: 5px;
  border: 1px solid #d1d1d1;
  border-bottom-color: #b7b7b7;
  box-shadow: 0 2px 2px rgba(204, 202, 202, 0.51), inset 0 1px 0 rgba(229, 228, 228, 0.51);
  text-shadow: 0 1px 0 rgba(128, 128, 124, 0.1);
  display: -moz-inline-stack;
  display: inline-block;
  vertical-align: middle;
  *vertical-align: auto;
  zoom: 1;
  *display: inline
}
.oBtnSecondary:hover {
  color: #80807c;
  background-image: -webkit-gradient(linear, 50% 0, 50% 100%, color-stop(0%, #f8f8f7), color-stop(100%, #ededec));
  background-image: -webkit-linear-gradient(#f8f8f7, #ededec);
  background-image: -moz-linear-gradient(#f8f8f7, #ededec);
  background-image: -o-linear-gradient(#f8f8f7, #ededec);
  background-image: linear-gradient(#f8f8f7, #ededec);
  border: 1px solid #d6d6d4;
  border-bottom-color: #bdbdba;
  box-shadow: 0 2px 2px rgba(204, 202, 202, 0.51), inset 0 1px 0 rgba(229, 228, 228, 0.51);
  text-shadow: 0 1px 0 rgba(128, 128, 124, 0.1)
}
.oBtnSecondary:active {
  color: #80807c;
  background-image: -webkit-gradient(linear, 50% 0, 50% 100%, color-stop(0%, #d2d2d0), color-stop(100%, #dddddc));
  background-image: -webkit-linear-gradient(center top, #d2d2d0 0, #dddddc);
  background-image: -moz-linear-gradient(center top, #d2d2d0 0, #dddddc);
  background-image: -o-linear-gradient(center top, #d2d2d0 0, #dddddc);
  background-image: linear-gradient(center top, #d2d2d0 0, #dddddc);
  border: 1px solid #d2d2d0;
  border-top-color: #b9b9b6;
  box-shadow: 0 2px 2px rgba(183, 183, 183, 0.4) inset;
  text-shadow: 0 1px 0 white
}
.oBtnSecondary:visited {
  color: #80807c
}
.oBtnSecondary.oDisabled,
.oBtnSecondary[disabled] {
  cursor: default;
  opacity: .5
}
.oBtnSecondary.oDisabled:hover,
.oBtnSecondary.oDisabled.active,
.oBtnSecondary.oDisabled.visited,
.oBtnSecondary[disabled]:hover,
.oBtnSecondary[disabled].active,
.oBtnSecondary[disabled].visited {
  background-image: -webkit-gradient(linear, 50% 0, 50% 100%, color-stop(0%, #f4f4f2), color-stop(100%, #e5e5e3));
  background-image: -webkit-linear-gradient(#f4f4f2, #e5e5e3);
  background-image: -moz-linear-gradient(#f4f4f2, #e5e5e3);
  background-image: -o-linear-gradient(#f4f4f2, #e5e5e3);
  background-image: linear-gradient(#f4f4f2, #e5e5e3);
  box-shadow: 0 2px 2px rgba(204, 202, 202, 0.51), inset 0 1px 0 rgba(229, 228, 228, 0.51);
  text-shadow: 0 1px 0 rgba(128, 128, 124, 0.1);
  border: 1px solid #d1d1d1;
  border-bottom-color: #b7b7b7
}
.oBtnPrimary,
.oBtnSecondary,
.oBtnTertiary,
.oBtnPrimaryBlue,
.oBtnPrimaryGradient,
.oBtnBlueGradient {
  display: inline-block;
  text-align: center
}
.oBtnTertiary {
  color: #00afef;
  background: transparent;
  border: none
}
.oBtnTertiary:hover {
  color: #006489
}
.oBtnTertiary:active {
  color: #383838
}
.oBtnPrimaryGradient {
  display: inline-block;
  font-family: "Helvetica", Arial, sans-serif;
  font-weight: bold;
  background: -webkit-gradient(linear, center top, center bottom, color-stop(0%, #68b339), color-stop(49%, #68b339), color-stop(51%, #5ea32b));
  background: -ms-linear-gradient(top, #68b339 0, #68b339 49%, #5ea32b 51%, #5ea32b 100%);
  background: linear-gradient(to bottom, #68b339 0, #68b339 49%, #5ea32b 51%, #5ea32b 100%);
  font-size: frompx(18);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
  color: #fff;
  padding: 1rem 2.5rem;
  margin: 0;
  border-radius: .25rem;
  border: 0 solid transparent;
  box-shadow: 0 1px .99px .01px rgba(0, 0, 0, 0.2);
  color: white
}
.oBtnPrimaryGradient:hover {
  background: -webkit-gradient(linear, center top, center bottom, color-stop(0%, #5eaa2c), color-stop(49%, #5eaa2c), color-stop(51%, #51991a));
  background: -ms-linear-gradient(top, #5eaa2c 0, #5eaa2c 49%, #51991a 51%, #51991a 100%);
  background: linear-gradient(to bottom, #5eaa2c 0, #5eaa2c 49%, #51991a 51%, #51991a 100%);
  box-shadow: none;
  cursor: pointer;
  color: white
}
.oBtnPrimary:not(#postJob):not(#findJob) {
  width: auto;
  display: inline-block;
  font-family: "Helvetica", Arial, sans-serif;
  font-weight: bold;
  background-image: -webkit-gradient(linear, to bottom, to top, color-stop(0%, #30bcf2), color-stop(49%, #30bcf2), color-stop(51%, #00adef), color-stop(100%, #00adef));
  background-image: -webkit-linear-gradient(to bottom, #30bcf2 0, #30bcf2 49%, #00adef 51%, #00adef 100%);
  background-image: -moz-linear-gradient(to bottom, #30bcf2 0, #30bcf2 49%, #00adef 51%, #00adef 100%);
  background-image: -o-linear-gradient(to bottom, #30bcf2 0, #30bcf2 49%, #00adef 51%, #00adef 100%);
  background-image: linear-gradient(to bottom, #30bcf2 0, #30bcf2 49%, #00adef 51%, #00adef 100%);
  font-size: frompx(18);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
  text-align: center;
  text-transform: uppercase;
  color: white;
  padding: 12px 30px;
  margin: 0;
  border-radius: .25rem;
  border: 0 solid transparent;
  box-shadow: 0 1px .99px .01px rgba(0, 0, 0, 0.1);
  color: white
}
.oBtnPrimary:not(#postJob):not(#findJob):hover {
  background-image: -webkit-gradient(linear, to bottom, to top, color-stop(0%, #30b1e2), color-stop(49%, #30b1e2), color-stop(51%, #009fdb), color-stop(100%, #009fdb));
  background-image: -webkit-linear-gradient(to bottom, #30b1e2 0, #30b1e2 49%, #009fdb 51%, #009fdb 100%);
  background-image: -moz-linear-gradient(to bottom, #30b1e2 0, #30b1e2 49%, #009fdb 51%, #009fdb 100%);
  background-image: -o-linear-gradient(to bottom, #30b1e2 0, #30b1e2 49%, #009fdb 51%, #009fdb 100%);
  background-image: linear-gradient(to bottom, #30b1e2 0, #30b1e2 49%, #009fdb 51%, #009fdb 100%);
  box-shadow: none;
  cursor: pointer
}
.oBtnPrimary:not(#postJob):not(#findJob):visited {
  color: white
}
.oBtnSecondary:not(.oPageBtn):not(.oButton) {
  display: inline-block;
  font-family: "Helvetica", Arial, sans-serif;
  font-weight: bold;
  background: white;
  color: #00adef;
  text-transform: uppercase;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  border: 4px solid #e2e2e2;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  -ms-border-radius: 3px;
  -o-border-radius: 3px;
  border-radius: 3px;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  padding: 4px 10px
}
.oBtnSecondary:not(.oPageBtn):not(.oButton):hover,
.oBtnSecondary:not(.oPageBtn):not(.oButton):visited {
  color: #00adef
}
.oMed {
  overflow: hidden;
  zoom: 1;
  margin: 5px 0
}

And the HTML...
<a class="oBtn oBtnPrimary" href="#" id="findJob">Want a job? Sign up!</a>
<a class="oBtn oBtnPrimary oBtnPrimaryBlue" href="#" id="postJob">Want to hire? Post a job!</a>

http://jsfiddle.net/jofish999/twuddn6f/1/


    CSS Howto..

    How can I align my HTML components with CSS?

    .addClass - How to call CSS from linked css?

    Showing play button and time on each image

    Show jquery datepicker with HTML/CSS image

    CSS how to change the color of a link within a class

    How to create a absolute element overlapping several rows in a calendar (table) design?

    Preventing jquery's show/hide from adding inline style?

    How to Make a Dropdown In a Navbar Using CSS?

    How to add physics to CSS animations?

    Live search div not showing up when something is entered

    Non-responsive website - Viewport issue - Page showing zoomed in on mobile

    how to override unselectable=“on” with css in IE10?

    HTML/CSS: How do I make right floats go to the top instead of floating at the position where they were when they were inline?

    how to make a text ele to the right of a left floated ele automatically occupy the rest width?

    How to make shapes with CSS which have borders?

    How can I make my numbered scale responsive to scrolling and clicking?

    how to put 2 triangle in together css

    How to blur the div below the section with CSS 3 without background image?

    How do I have fieldset::before rule account for the legend?

    How do I center these three blocks horizontally?

    How to highlight a row of my table

    How to style QTableView CSS

    How do I have a div go around another div?

    webkit just cuts off decimals in css number … how to workaround?

    How to say that you need to turn your mobile phone in javascript/css? [closed]

    How to align nav bar to bottom of window with no gap between buttons and window edge

    Howto stretch jsf panelgrid in horizontal direction

    Is there a plugin for Wordpress that lets me show HTML/JS/CSS examples? [closed]

    Dropdown Menu will move all
    Below. How to prevent it?

    How can i have CSS3 animating menu like followbubble.com