Bootstrap flip-card front and back not an top of each other - html

I am new to HTML/CSS/Bootstrap, so hopefully the solution of my problem is obvious to one of you.
I am creating a flip card that contains a coloured table on the front and on the back (different information will be displayed on front and back).
To provide "axis labeling" to this table I add one extra column on the left side and below the colored table entries. I have this table + axis labeling on the front and back side of the flip card. When the card is fliped parts of the front + the axis labeling are visible to the right of the backside-card . How can I put the cards on top of each other so no part of the front side is visible when the back is up? (Actually there should be axis labeling as well, but somehow it does not show correctly in the code snippet so I commented it out.
.table#risikomatrix{
width: 90%;
height: 90%;
}
.table td{
border-top: 0px solid #121416;
}
#left_axis_front{
background-color: white;
border-right: 3px solid black;
width: 0%;
vertical-align: middle;
}
#left_axis_label{
background-color: white;
transform: rotate(-90deg) translateY(-18px) translateX(-110px);
width: 0%;
height: 0%;
position: absolute;
white-space: nowrap;
font-size: 14pt;
}
#lower_axis{
border-top:3px solid black; ;
}
#lower_axis_label{
background-color: white;
transform:translateY(-12px) translateX(50%);
width: 50%;
height: 0%;
white-space: nowrap;
font-size: 14pt;
}
.cell{
width: 33.33%;
position: relative;
}
.cell::after {
content: '';
display: block;
margin-top: 100%;
}
.card {
background-color: white;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
border: 1px solid #f1f1f1;
/* Centered alignment in card */
text-align: center;
display: flex;
justify-content: center;
}
.card#yellow{
background-color: gold;
}
.card#red{
background-color: red;
}
.card#green{
background-color: green;
}
.flip-card-big {
background-color: white;
width: 40%;
height: 40%;
/* perspective: 1000px; Remove this if you don't want the 3D effect */
}
/* This container is needed to position the front and back side */
.flip-card-big-inner {
background-color: white;
position: relative;
width: 100%;
height: 100%;
text-align: center;
transition: transform 0.8s;
transform-style: preserve-3d;
/* align-self: center; */
}
/* Do an horizontal flip when you move the mouse over the flip box container */
.flip-card-big:hover .flip-card-big-inner{
background-color: white;
transform: rotateY(-180deg);
}
/* Position the front and back side */
.flip-card-big-front {
background-color: white;
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden; /* Safari */
backface-visibility: hidden;
}
.flip-card-big-back {
background-color: white;
position: absolute;
width: 100%;
height: 100%;
-webkit-backface-visibility: hidden; /* Safari */
backface-visibility: hidden;
}
/* Style the front side (fallback if image is missing) */
.flip-card-big-front {
background-color: white;
color: rgb(255, 255, 255);
text-align: middle;
}
/* Style the back side */
.flip-card-big-back{
background-color: white;
color: rgb(255, 255, 255);
transform: rotateY(180deg);
}
<div class="container" style="height: 300px;">
<div class="row">
<div class="col-sm d-flex justify-content-sm-center" >
<div class="flip-card-big">
<div class="flip-card-big-inner">
<div class="flip-card-big-front">
<table class="table" id="risikomatrix">
<tr>
<td rowspan="3" id="left_axis_front">
<!-- <div id="left_axis_label">Instabilität</div> -->
</td>
<td class="cell">
<div class="card" id="yellow">
<div style="font-size: 40pt;" id="fm1">
</div>
</div>
</td>
<td class="cell">
<div class="card" id="red">
<div style="font-size: 40pt;" id="fm2">
</div>
</div>
</td>
<td class="cell">
<div class="card" id="red">
<div style="font-size: 40pt;" id="fm3">
</div>
</div>
</td>
</tr>
<tr>
<td class="cell">
<div class="card" id="green">
<div style="font-size: 40pt;" id="fm1">
</div>
</div>
</td>
<td class="cell">
<div class="card" id="yellow">
<div style="font-size: 40pt;" id="fm2">
</div>
</div>
</td>
<td class="cell">
<div class="card" id="red">
<div style="font-size: 40pt;" id="fm3">
</div>
</div>
</td>
</tr>
<tr>
<td class="cell">
<div class="card" id="green">
<div style="font-size: 40pt;" id="fm1">
</div>
</div>
</td>
<td class="cell">
<div class="card" id="green">
<div style="font-size: 40pt;" id="fm2">
</div>
</div>
</td>
<td class="cell">
<div class="card" id="yellow">
<div style="font-size: 40pt;" id="fm3">
</div>
</div>
</td>
</tr>
<tr>
<td></td>
<td colspan="3" id="lower_axis">
<!-- <div id="lower_axis_label">Auslauflänge</div> -->
</td>
</tr>
</table>
</div>
<div class="flip-card-big-back">
<table class="table" id="risikomatrix">
<tr>
<td rowspan="3" id="left_axis_front">
<!-- <div id="left_axis_label">Instabilität</div> -->
</td>
<td class="cell">
<div class="card" id="yellow">
<div style="font-size: 40pt;" id="fm1">
</div>
</div>
</td>
<td class="cell">
<div class="card" id="red">
<div style="font-size: 40pt;" id="fm2">
</div>
</div>
</td>
<td class="cell">
<div class="card" id="red">
<div style="font-size: 40pt;" id="fm3">
</div>
</div>
</td>
</tr>
<tr>
<td class="cell">
<div class="card" id="green">
<div style="font-size: 40pt;" id="fm1">
</div>
</div>
</td>
<td class="cell">
<div class="card" id="yellow">
<div style="font-size: 40pt;" id="fm2">
</div>
</div>
</td>
<td class="cell">
<div class="card" id="red">
<div style="font-size: 40pt;" id="fm3">
</div>
</div>
</td>
</tr>
<tr>
<td class="cell">
<div class="card" id="green">
<div style="font-size: 40pt;" id="fm1">
</div>
</div>
</td>
<td class="cell">
<div class="card" id="green">
<div style="font-size: 40pt;" id="fm2">
</div>
</div>
</td>
<td class="cell">
<div class="card" id="yellow">
<div style="font-size: 40pt;" id="fm3">
</div>
</div>
</td>
</tr>
<tr>
<td></td>
<td colspan="3" id="lower_axis">
<!-- <div id="lower_axis_label">Auslauflänge</div> -->
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>

First off, don't give multiple elements the same ID, keep them unique, plain bad practice and will cause issues when JS gets involved.
Answer:
.table#risikomatrix {
width: 90%;
height: 90%;
margin: auto;
}
The <table> is a block level element, which means you can center them if you have margin: auto on the left and right if they're not 100% width of the parent.
In your case you needed to center them because the back table was aligned to the right when flipped while the front was to the left.

Related

Flexbox to change position of elements

Is it possible to use flexbox to do something like in this example? Basically Id like to flip elements which are in a column to be in a row when viewed in mobile. How would you do this?
<p> Desktop:</p>
<table style="height: 52px;" width="331">
<tbody>
<tr>
<td style="width: 103.533px;">image-icon1</td>
<td style="width: 103.533px;">image-icon2</td>
<td style="width: 103.533px;">image-icon3</td>
</tr>
<tr>
<td style="width: 103.533px;">Text1</td>
<td style="width: 103.533px;">Text2</td>
<td style="width: 103.533px;">Text3</td>
</tr>
</tbody>
</table>
<p> Mobile:</p>
<table style="height: 71px;" width="189">
<tbody>
<tr>
<td style="width: 87.1px;">image-icon1</td>
<td style="width: 87.1px;">Text1</td>
</tr>
<tr>
<td style="width: 87.1px;">image-icon2</td>
<td style="width: 87.1px;">Text2</td>
</tr>
<tr>
<td style="width: 87.1px;">image-icon3</td>
<td style="width: 87.1px;">Text3</td>
</tr>
</tbody>
</table>
Yes, its possible
Check below example.
I am using CSS media query #media(max-width:768px) to check whether the width of screen is less than 768px(can be any value less than this).
Depending on that, I am setting the direction of flex children to column, so that the children can stack on top of each other.
Along with that, on mobile screen, I am also setting, the display of inner containers(.sec class) to flex,
<div class="sec">
<div class="img">Image</div>
<div class="text">
Text
</div>
</div>
So that, its children will align itself in row.
.container {
display: flex;
flex-direction: row;/* default value*/
}
.text,.img{
padding:10px;
}
.sec {
flex: 1;
background-color: wheat;
padding: 5px;
border: 1px solid black;
text-align: center;
}
#media(max-width:768px) { /* can be anything less than this*/
.container {
flex-direction: column;
}
.sec {
display: flex;
flex-direction: row;/* default value*/
}
}
<div class="container">
<div class="sec">
<div class="img">Image</div>
<div class="text">
Text
</div>
</div>
<div class="sec">
<div class="img">Image</div>
<div class="text">
Text
</div>
</div> <div class="sec">
<div class="img">Image</div>
<div class="text">
Text
</div>
</div> <div class="sec">
<div class="img">Image</div>
<div class="text">
Text
</div>
</div> <div class="sec">
<div class="img">Image</div>
<div class="text">
Text
</div>
</div> <div class="sec">
<div class="img">Image</div>
<div class="text">
Text
</div>
</div> <div class="sec">
<div class="img">Image</div>
<div class="text">
Text
</div>
</div>
</div>

The div in my website move when I zoom. (Even if I use em or percentage)

I know that many people ask this question, but I can't make my website work. When I zoom every div go one under the other. I post only a little part of my html css cause the problem comes also with two div.
body {
margin: 0;
font-family: Sans-Serif;
background-image: url("pictures/backgroundbody.png");
background-repeat: repeat-x;
}
p {
display: inline;
}
a {
text-decoration: none;
}
#page {
margin: 0 auto;
}
#header{
height: 11.937em;
width: 100%;
margin-top: 0.812em;
}
#titlebar {
height: 6.25em;
}
#giga_weather_and_search{
float: right;
margin-right: 15em;
font-size: 0.875em;
color: #5278ae;
text-align: right;
width: 27.875em;
height: 6em;
}
#weather_bar{
font-size: 0.857em;
float: right;
}
#weather_bar td{
padding-left: 0.357em;
padding-right: 0.357em;
}
.weather_table{
padding: 0.428em;
border-spacing: 0px;
border-collapse: separate;
}
#upper_search_bar{
float: right;
font-size: 0.857em;
}
.upper_search_table{
padding: 0.214em;
}
#upper_search_bar td{
padding-left: 0.143em;
padding-right: 0.143em;
}
#bottom_search_bar{
float: right;
font-size: 0.857em;
}
#bottom_search_bar td{
padding-left: 0.143em;
padding-right: 0.143em;
}
#logo_bar{
margin-left: 12em;
margin-top: 4.312em;
float: left;
width: 23.125em;
height: 2.375em;
}
#logo_bar img{
width: 23.125em;
height: 2.375em;
}
<head>
<title>
Colorado Breaking News, Sports, Wheather, Traffic - The Denver Post
</title>
<link rel="stylesheet" type="text/css" href="style1.css" />
<style type="text/css">
A:link, A:visited {text-decoration: none}
A:hover {text-decoration: underline}
</style>
</head>
<body>
<div id="page">
<div id="header">
<div id="titlebar">
<div id="giga_weather_and_search">
<div id="weather_bar">
<table class="weather_table">
<td style="white-space:nowrap">
<div class="weather">
Weather:
<img src="pictures/weather.png" alt="weather logo">
<p>Denver, CO</p>
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_weather_bar.png" alt="weather barretta">
</td>
<td style="white-space:nowrap">
<div class="now">
Now: 39°
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_weather_bar.png" alt="weather barretta">
</td>
<td style="white-space:nowrap">
<div class="high">
High: 49°
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_weather_bar.png" alt="weather barretta">
</td>
<td style="white-space:nowrap">
<div class="low">
Low: 49°
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_weather_bar.png" alt="weather barretta">
</td>
<td style="white-space:nowrap">
<div class="forecast">
5-Day Forecast
</div>
</td>
</table>
</div> <!--weather_bar-->
<div id="upper_search_bar">
<table class="upper_search_table">
<td style="white-space:nowrap">
<div class="newsletters">
Newsletter
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_weather_bar.png" alt="weather barretta">
</td>
<td style="white-space:nowrap">
<div class="subscribe">
Subscribe
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_weather_bar.png" alt="weather barretta">
</td>
<td style="white-space:nowrap">
<div class="member_services">
Member Services
</div>
</td>
</table>
</div> <!--upper_search_bar-->
<div id="search_bar">
<img src="pictures/search_bar.png" alt="search bar"/>
</div>
<div id="bottom_search_bar">
<table class="bottom_search_table">
<td style="white-space:nowrap">
<div class="autos">
Autos
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_bottom_search_bar2.png" alt="barretta bottom search bar">
</td>
<td style="white-space:nowrap">
<div class="real_estate">
Real Estate
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_bottom_search_bar2.png" alt="barretta bottom search bar">
</td>
<td style="white-space:nowrap">
<div class="jobs">
Jobs
</div>
</td>
</table>
</div> <!--bottom_search_bar-->
</div> <!--giga_weather_and_search-->
<div id="logo_bar">
<img src="pictures/logo_bar.png"/>
</div>
</div> <!--titlebar-->
</div> <!--header-->
</div> <!--page-->
</body>

Image 100% height error inside table in Chrome and Safari

I tried pretty hard to find the answer to this on here, on google, and elsewhere, but it seems pretty obscure. I had to do some fancy CSS in order to create a box with a specific aspect ratio inside which a thumbnail would be centered vertically and horizontally. Those are straight-forward ideas that are actually somewhat complicated to implement in CSS. My solution works great everywhere except inside a table in Chrome with an image that has dimensions larger than the container.
Here is code that demonstrates the issue:
/*
sets aspect ratio of container by adding padding that is calculated
according to width of its parent element
*/
.aspect-ratio {
width: 100%;
display: inline-block;
position: relative;
}
.aspect-ratio:after {
padding-top: 76.19%;
display: block;
content: '';
}
/*
parent has no height, this fills the container's space
*/
.fill-container {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
font-size: 0;
}
/*
centers image horizontally and vertically
background color
*/
.image-background {
text-align: center;
background-color: #444;
height: 100%;
width: 100%;
}
.image-background::before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -0.25em;
}
img {
display: inline-block;
padding: 5px;
box-sizing: border-box;
vertical-align: middle;
}
/*
Firefox: image height fills the parent element
Chrome:
inside table - image is rendered at its natural height
outside table - image height fills the parent element as expected
*/
.fill-height {
height: 100%;
}
.fill-width {
width: 100%;
}
/* other styles */
h1, h2, h3 {
text-align: center;
}
table {
width: 100%;
}
.thumbnail-viewer {
width: 40%;
margin: 10px auto;
}
<h1>tall image</h1>
<h2>small</h2>
<h3>table</h3>
<table>
<tbody>
<tr>
<td>
<div class="thumbnail-viewer">
<div class="aspect-ratio">
<div class="fill-container">
<div class="image-background">
<img class="fill-height" src="http://www.irmaagro.com/images/d.jpg" style="height: 100%;">
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<h3>no table</h3>
<div class="thumbnail-viewer">
<div class="aspect-ratio">
<div class="fill-container">
<div class="image-background">
<img class="fill-height" src="http://www.irmaagro.com/images/d.jpg" style="height: 100%;">
</div>
</div>
</div>
</div>
<h2>large</h2>
<h3>table (works in firefox and IE, breaks in chrome and safari)</h3>
<table>
<tbody>
<tr>
<td>
<div class="thumbnail-viewer">
<div class="aspect-ratio">
<div class="fill-container">
<div class="image-background">
<img class="fill-height" src="http://www.landscapeontario.com/thumbnailer.php?image=/assets/1320240573.Twine_wrap_2.JPG&imgWH=500" style="height: 100%;">
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<h3>no table</h3>
<div class="thumbnail-viewer">
<div class="aspect-ratio">
<div class="fill-container">
<div class="image-background">
<img class="fill-height" src="http://www.landscapeontario.com/thumbnailer.php?image=/assets/1320240573.Twine_wrap_2.JPG&imgWH=500" style="height: 100%;">
</div>
</div>
</div>
</div>
<h1>wide image</h1>
<h2>small</h2>
<h3>table</h3>
<table>
<tbody>
<tr>
<td>
<div class="thumbnail-viewer">
<div class="aspect-ratio">
<div class="fill-container">
<div class="image-background">
<img class="fill-width" src="http://www.beach.com/images/activity-photo-county-londonderry-ireland-3-day-lake-district-and-hadrian-s-wall-small-group-tour-from-edinburgh-1.jpg">
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<h3>no table</h3>
<div class="thumbnail-viewer">
<div class="aspect-ratio">
<div class="fill-container">
<div class="image-background">
<img class="fill-width" src="http://www.beach.com/images/activity-photo-county-londonderry-ireland-3-day-lake-district-and-hadrian-s-wall-small-group-tour-from-edinburgh-1.jpg">
</div>
</div>
</div>
</div>
<h2>large</h2>
<h3>table</h3>
<table>
<tbody>
<tr>
<td>
<div class="thumbnail-viewer">
<div class="aspect-ratio">
<div class="fill-container">
<div class="image-background">
<img class="fill-width" src="http://www.craterlaketrust.org/pub/photo/thumb/Crater-Summer_cropto_500x200.JPG">
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<h3>no table</h3>
<div class="thumbnail-viewer">
<div class="aspect-ratio">
<div class="fill-container">
<div class="image-background">
<img class="fill-width" src="http://www.craterlaketrust.org/pub/photo/thumb/Crater-Summer_cropto_500x200.JPG">
</div>
</div>
</div>
</div>
Hopefully as you can see, in Chrome (I'm using 43.0.2357.132 64-bit) and Safari (8.0.7) the tall/large image is exceeding the boundaries of its parent and its height is being set to the natural height of the image. The wide images all work as expected, so this appears to only be an issue of height.
My question: What is a simple or straight-forward way to fix this issue in Chrome and Safari? Or is it a bug and should I look for a less-than-ideal work-around that makes it look less terrible? What is causing this issue?
Thanks!
FYI, on smaller screens (screenwidth < 650px), your first image inside the table breaks as well.
To fix it, change your img to use the absolute positioning centering trick:
img {
padding: 5px;
box-sizing: border-box;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
This also means you don't need the image-background::before declaration.
Why do you need .fill-container to have absolute positioning? If I remove the lines below from styles then everything looks fine in Chrome (I can't test in Safari):
.fill-container {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
font-size: 0;
}
You also haven't closed img tags, you have
<img class="fill-height" src="http://www.irmaagro.com/images/d.jpg" style="height: 100%;">
instead of (notice /> at the end of line)
<img class="fill-height" src="http://www.irmaagro.com/images/d.jpg" style="height: 100%;" />

How do you make HTML elements appear on a vertical line using CSS?

Image of the problem:
How do I go from the one on the left, to the one on the right, using CSS?
You can use a table:
<table>
<tr>
<td>You own</td>
<td>20</td>
</tr>
<tr>
<td>Price</td>
<td>20</td>
</tr>
<tr>
<td>BPS</td>
<td>0.50</td>
</tr>
</table>
or floating divs:
<div style="display:inline-block;">
<div style="float:left; width:150px;">You own</div>
<div style="float:left;">20</div>
</div>
<div style="display:inline-block;">
<div style="float:left; width:150px;">Price</div>
<div style="float:left;">20</div>
</div>
<div style="display:inline-block;">
<div style="float:left; width:150px;">BPS</div>
<div style="float:left;">0.50</div>
</div>
<div>
<div id="left"> <!-- float left -->
<p>You Own></p>
<p>Price</p>
<p>BPS</p>
</div>
<div id="right">
<p>20</p>
<p>20</p>
<p>0.50</p>
</div>
</div>
Two divs
<div class="box">
Your own:<br />
Price:<br />
PBS
</div>
<div class="box">
20<br />
20<br />
50
</div>
CSS
.box {
float:left;
padding-right:40px;
}
While I am in agreement that this can be a table, you can easily do this with floats.
.container {
padding: 0.5em;
width: 200px;
background: #333;
color: #fff;
}
.button {
background: #efefef;
padding: 5px;
color: #000;
margin-bottom: 0.5em;
}
.item-header {
font-weight:bold;
float:left;
width: 45%;
clear:both;
}
<div class="container">
<div class="button">Buy Foreign Worker</div>
<div class="items">
<div class="item-header">You Own:</div>
<div class="item-value">20</div>
<div class="item-header">Price:</div>
<div class="item-value">20</div>
<div class="item-header">BPS:</div>
<div class="item-value">0.5</div>
</div>
</div>
All you are doing is making the header values float to the left, and the clear ensures that it starts on a new row.

How to achieve table layout without using tables?

In the name of progress (and learning) how can I rid tables from my code and achieve the same layout?
For example, here is my table:
<table cellspacing="0px">
<tr>
<td>
<img src="http://www.poltairhomes.com/images/footerlogo.png" />
</td>
<td id="footertext">
<p>Poltair Homes Plc<br />Registered Office: The Old Chapel, Greenbottom, Truro, Cornwall, TR4 8QP.<br />Registered in England & Wales: 3955425<br />www.poltairhomes.com<br />info#poltairhomes.com</p>
</td>
<td id="footertext">
<p>Terms and Conditions | Privacy Policy | Sitemap</p>
</td>
<td id="footertext">
<p>SIGN UP FOR OUR NEWSLETTER:</p>
<img src="http://www.poltairhomes.com/images/signup(temp).png" />
</td>
</tr>
</table>
And the relevant CSS:
.footertext {
margin: 0;
padding:0 5px 0 5px;
color: #AAA;
font-size: 10px;
font-family:Arial, Helvetica, sans-serif;
text-align:center;
border-left: 1px solid #CCC;
}
http://jsfiddle.net/userdude/tYjKw/
CSS:
.table {
display: table;
}
.table-row {
display: table-row;
}
.table-cell {
display: table-cell;
}
HTML:
<div class="table">
<div class="table-row">
<div class="table-cell">Table cell 1</div>
<div class="table-cell">Table cell 2</div>
</div>
</div>
<div class="table">
<div class="row">
<div class="cell twocol">
<span>Content1</span>
</div>
<div class="cell twocol">
<span>Content2</span>
</div>
</div>
<div class="row">
<div class="cell onecol">
<span>Content3</span>
</div>
</div>
</div>
And the CSS
.table {width: 100%; height: 100%;}
.row {width: 100%; min-height: 1px; height: auto; margin: 0;}
.cell {float: left; margin: 0; padding: 0;}
.onecol {width: 100%;}
.twocol {width: 50%;}
I suggest you look into some gridsystems, like 960grid (http://960.gs/) or 1140grid (http://cssgrid.net/), will help you a lot.
Create a style as:
.footerItem { float: left; }
<div class="footerItem">
<img src="http://www.poltairhomes.com/images/footerlogo.png" />
</div>
<div class="footerItem">
<p>Poltair Homes Plc<br />Registered Office: The Old Chapel, Greenbottom, Truro, Cornwall, TR4 8QP.<br />Registered in England & Wales: 3955425<br />www.poltairhomes.com<br />info#poltairhomes.com</p>
</div>
<div class="footerItem">
<p>Terms and Conditions | Privacy Policy | Sitemap</p>
</div>
<div class="footerItem">
<p>SIGN UP FOR OUR NEWSLETTER:</p><img src="http://www.poltairhomes.com/images/signup(temp).png" />
</div>
and then create your body using DIVs to separate the blocks and apply the class to each one: