Spacing issue with HTML and floats - html

first time poster here. I've been freshing up on my HTML and CSS and I've encountered some small problems.
If you look at the link then you can see some unwanted spacing between the pink colored "My Gaming Life" and the plum colored "My Lack of Religion". Those 2 paragraphs have an id of right and I've set them to float:right as so;
#right {float:right;}
Ive done the same with the elements on the left side like so:
#left {float:left;}
I will put a full list of the code below and a picture of the website:
The CSS:
p {
font-size: 2em;
font-family: "Poiret One", cursive;
color: #D6EBFF;
}
ul {
border:0.2em solid #1f2f31;
border-radius: 10px;
background-color: rgba(123, 321, 78, .2);
padding-right: 5ps;
}
li {
font-size: 2em;
font-family: "Poiret One", cursive;
color: #D6EBFF;
}
h1, h2, h3, h4, h5, h6 {
font-size: 2em;
font-family: "Poiret One", cursive;
color: #D6EBFF;
}
#span1 {
text-decoration: underline;
}
#hello {
margin-top: 1em;
font-size: 3em;
}
#wonder {
font-family: "Poiret One", cursive;
font-weight: bold;
font-size: 2.5em;
}
#mystery {
font-size: 2em;
font-family: "Dancing Script", cursive;
padding-bottom: 5px;
margin-bottom: 15px;
}
.intro {
background-color: rgba(240,230,140, 0.8);
}
.intro p {
color: #000029;
}
#img1 {
width: 75px;
height: 75px;
margin-right: 2px;
margin-bottom: 5px;
}
.img_header {
/*float: left;*/
border: 2px solid #1f2f31;
border-radius: 10px;
background-color: rgba(255,69,0,0.3);
width: 24%;
}
.img_header_container h3 {
padding: 15px;
margin-top: -15px;
margin-bottom: -2px;
}
.picture {
margin-left: 5px;
margin-bottom: 5px;
}
.center {
display: table;
margin: auto;
}
.main_container {
border:0.2em solid #1f2f31;
border-radius: 10px;
background-color: rgba(157, 139, 178, .5);
}
.main_container p {
padding-left: 10px;
}
.list {
width: 24%;
/*float: left;*/
}
.img_header {
width: 24%;
}
.main_content {
/*float:right;*/
width: 73%;
border:0.2em solid #1f2f31;
border-radius: 10px;
margin-right: 10px;
margin-top:17px;
background-color: rgba(205, 120, 200, .5);
margin-bottom: 5em;
}
.main_content_container {
text-align: center;
padding-bottom: 10px;
}
.main_content_container p {
font-size: 1.5em;
line-height: 170%;
text-align: left;
padding-left: 10px;
}
.main_content_container a {
font-size: 2em;
color: #D6EBFF;
}
.religion {
/*float:right;*/
width: 73%;
border:0.2em solid #1f2f31;
border-radius: 10px;
margin-right: 10px;
margin-top:17px;
background-color: rgba(103, 0, 124, .5);
margin-bottom: 5em;
}
.religion_container {
text-align: center;
padding-bottom: 10px;
}
.religion_container {
font-size: 1.5em;
line-height: 170%;
text-align: left;
padding-left: 10px;
}
.religion_container a {
font-size: 2em;
color: #D6EBFF;
}
#left {
float: left;
}
#right {
float: right;
}
body {
background-image: url("http://orig01.deviantart.net/064f/f/2010/064/6/1/arcane_symbols_by_stinkmeaner.jpg");
background-color: black;
font-size: 100%;
}
The HTML:
<div class="intro">
<div class="intro_container">
<p id="hello", class="center">Content </p>
<p id="wonder", class="center">Content</p>
<p id="mystery", class="center">Content</p>
</div>
</div>
<div class="main">
<div class="main_container">
<p>Content</p>
</div>
<div class="list" id="left">
<div class="list_container">
<ul>
<li>MenuItem</li>
<li>MenuItem</li>
<li>MenuItem</li>
</ul>
</div>
</div>
<div class="main_content" id="right">
<div class="main_content_container">
<h2>title</h2>
<p>Some content</p><br>
Read more!
</div>
</div>
<div class="img_header" id="left">
<div class="img_header_container">
<h3>Title</h3>
<div class="picture">
<img src="" id="img1">
<img src="" id="img1">
<img src="" id="img1">
<img src="" id="img1">
</div>
</div>
</div>
<div class="religion" id="right">
<div class="religion_container">
<h2>Title</h2>
<p>Some content</p><br>
Read more!
</div>
</div>
Do you have any clues ?

Id MUST be unique. You cannot have multiple "right" div. If the same style should be applied to multiple elements, it should be a class. It is also true for id img1
<div class="font_links"> is useless since the <link> tags are not displayed.
You used margin-bottom: 5em instead (?) of margin-bottom: 5px
http://jsfiddle.net/29tz5efb/

Your .main_content has margin-bottom: 5em; which causes it to move down

IDs should only be used with a single element; if you intend to apply a particular style to multiple elements, then a class should be used.
The spacing issue is caused by .main_content - the margin-bottom: 5em; produces a 5em (five times the size of a 'M' in whatever font size you were using) gap between your pink- and plum-coloured paragraph.

Remove margin-bottom: 5em; on .main_content

Related

Avoiding multiple rows when lining up content in grids

I currently have a grid showing products. Full screen there is 3 products and once the screen gets smaller it shows 4 products.
My issue is, some names of the products are longer then others. In this example, as the container gets smaller, the product name of the 2nd and 3rd item moves to a new line faster then the 1st does.
Ideally, I'd like the Price and the SHOP buttons to be even with one another when this happens.
The only way I can think about achieving this is to have 3 separate rows for the picture, name, and price/button. By doing this, it makes it kind of difficult for the 4th item to appear nicely without making completely separate containers for different window sizes and loading the images twice.
Does anyone have any ideas on how I can achieve this without making multiple rows for each item?
*, input, :before, :after {
box-sizing: border-box;
}
h2.product-header {
font-family: "Open Sans", sans-serif;
font-size: 23px;
color: #231f20;
letter-spacing: 3px;
text-align: center;
padding-bottom: 50px;
border-bottom: 2px solid #c2c1c5;
}
.row {
display: block;
font-size: 0;
}
.row .grid {
vertical-align: top;
display: inline-block;
font-size: 18px;
}
.grid.one-third {
width: 33.33%;
}
#index-new-arrivals {
font-family: "Open Sans", sans-serif;
padding: 75px 50px;
}
#index-new-arrivals .grid {
width: 33.33%;
}
#index-new-arrivals .grid.product {
margin: 75px 0 15px 0;
padding: 0 7%;
}
#index-new-arrivals .grid.product:last-child { display:none;}
#index-new-arrivals .grid.product > div {
padding-bottom: 150%;
position: relative;
}
#index-new-arrivals .grid.product > div > div {
position: absolute;
width: 100%;
height: 100%;
background-size: cover;
}
#index-new-arrivals .grid.product-name {
margin-bottom: 15px;
padding: 0 7%;
vertical-align: middle;
}
#index-new-arrivals .grid.product h3 {
font-size: 18px;
text-align: center;
margin-top: 25px;
text-transform: uppercase;
letter-spacing: 4px;
color: #231f20;
font-size: 19px;
}
#index-new-arrivals .grid.product p {
font-size: 18px;
text-align: center;
text-transform: uppercase;
letter-spacing: 4px;
color: #231f20;
font-size: 19px;
}
#index-new-arrivals .grid.product a {
font-size: 15px;
letter-spacing: 2px;
display: block;
background-color: #3e3e3f;
max-width: 230px;
width: 80%;
margin: 25px auto 100px auto;
padding: 15px 0;
text-align: center;
text-transform: uppercase;
color: #fff;
}
#media (max-width:880px) {
#index-new-arrivals .grid {
width: 50%;
}
#index-new-arrivals .grid.product:last-child { display:inline-block;}
}
<section id="index-new-arrivals">
<div class="row" style="border:1px solid blue;">
<div class="grid product" style="border:1px solid grey;">
<div>
<div style="background-image:url('//cdn.shopify.com/s/files/1/2497/8510/products/9126_BROWN_1_500x.jpg?v=1509207888');"></div>
</div>
<h3>Convertible Belt Bag</h3>
<p>$50</p>
Shop
</div>
<div class="grid product" style="border:1px solid grey;">
<div>
<div style="background-image:url('//cdn.shopify.com/s/files/1/2497/8510/products/9113_BLACK_500x.jpg?v=1509207748');"></div>
</div>
<h3>Mini Quilted Backpack</h3>
<p>$54</p>
Shop
</div>
<div class="grid product" style="border:1px solid grey;">
<div>
<div style="background-image:url('//cdn.shopify.com/s/files/1/2497/8510/products/9155_IVORY_1_500x.jpg?v=1509207616');"></div>
</div>
<h3>Snake Mini Reversible Tote</h3>
<p>$50</p>
Shop
</div>
<div class="grid product" style="border:1px solid grey;">
<div>
<div style="background-image:url('//cdn.shopify.com/s/files/1/2497/8510/products/9155_IVORY_1_500x.jpg?v=1509207616');"></div>
</div>
<h3>Snake Mini Reversible Tote</h3>
<p>$50</p>
Shop
</div>
</div>
</section>
you can fix the name h3 element max-height and show dot after text is bigger then h3 using those css properties :
white-space: pre;
overflow: hidden !important;
text-overflow: ellipsis;
*, input, :before, :after {
box-sizing: border-box;
}
h2.product-header {
font-family: "Open Sans", sans-serif;
font-size: 23px;
color: #231f20;
letter-spacing: 3px;
text-align: center;
padding-bottom: 50px;
border-bottom: 2px solid #c2c1c5;
}
.row {
display: block;
font-size: 0;
}
.row .grid {
vertical-align: top;
display: inline-block;
font-size: 18px;
}
.grid.one-third {
width: 33.33%;
}
#index-new-arrivals {
font-family: "Open Sans", sans-serif;
padding: 75px 50px;
}
#index-new-arrivals .grid {
width: 33.33%;
}
#index-new-arrivals .grid.product {
margin: 75px 0 15px 0;
padding: 0 7%;
}
#index-new-arrivals .grid.product:last-child { display:none;}
#index-new-arrivals .grid.product > div {
padding-bottom: 150%;
position: relative;
}
#index-new-arrivals .grid.product > div > div {
position: absolute;
width: 100%;
height: 100%;
background-size: cover;
}
#index-new-arrivals .grid.product-name {
margin-bottom: 15px;
padding: 0 7%;
vertical-align: middle;
}
#index-new-arrivals .grid.product h3 {
font-size: 18px;
text-align: center;
margin-top: 25px;
text-transform: uppercase;
letter-spacing: 4px;
color: #231f20;
font-size: 19px;
white-space: pre;
overflow: hidden !important;
text-overflow: ellipsis;
}
#index-new-arrivals .grid.product p {
font-size: 18px;
text-align: center;
text-transform: uppercase;
letter-spacing: 4px;
color: #231f20;
font-size: 19px;
}
#index-new-arrivals .grid.product a {
font-size: 15px;
letter-spacing: 2px;
display: block;
background-color: #3e3e3f;
max-width: 230px;
width: 80%;
margin: 25px auto 100px auto;
padding: 15px 0;
text-align: center;
text-transform: uppercase;
color: #fff;
}
#media (max-width:880px) {
#index-new-arrivals .grid {
width: 50%;
}
#index-new-arrivals .grid.product:last-child { display:inline-block;}
}
<section id="index-new-arrivals">
<div class="row" style="border:1px solid blue;">
<div class="grid product" style="border:1px solid grey;">
<div>
<div style="background-image:url('//cdn.shopify.com/s/files/1/2497/8510/products/9126_BROWN_1_500x.jpg?v=1509207888');"></div>
</div>
<h3>Convertible Belt Bag</h3>
<p>$50</p>
Shop
</div>
<div class="grid product" style="border:1px solid grey;">
<div>
<div style="background-image:url('//cdn.shopify.com/s/files/1/2497/8510/products/9113_BLACK_500x.jpg?v=1509207748');"></div>
</div>
<h3>Mini Quilted Backpack</h3>
<p>$54</p>
Shop
</div>
<div class="grid product" style="border:1px solid grey;">
<div>
<div style="background-image:url('//cdn.shopify.com/s/files/1/2497/8510/products/9155_IVORY_1_500x.jpg?v=1509207616');"></div>
</div>
<h3>Snake Mini Reversible Tote</h3>
<p>$50</p>
Shop
</div>
<div class="grid product" style="border:1px solid grey;">
<div>
<div style="background-image:url('//cdn.shopify.com/s/files/1/2497/8510/products/9155_IVORY_1_500x.jpg?v=1509207616');"></div>
</div>
<h3>Snake Mini Reversible Tote</h3>
<p>$50</p>
Shop
</div>
</div>
</section>

Image border issue

HTML
<body>
<div class="header">
<div class="header-logo"><u>MMH</u></div>
<div class="header-inner">Miami Max Hydro</div>
<nav class="header-nav">
About
Contact
</nav>
</div>
<div class="homepage">
<div class="content">
<div class="images">
<div class="column">
<div class="profile-large">
<div class="column1">
<div class="profile-overlay">
<div class="column1">
<img src=data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUTExMVExIVGBYYFRcVFhcVFxUVFxUYFxUVFRUYHSggGB0lGxUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGBAQFysdHR0rLS0rKy0tLSstKysrKy0tLSsrLS0tLS0tNy0tLS0tNystNysrLS03KystKy0tKysrK//AABEIAJABAAMBIgACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAAFAgMEBgcBAAj/xABBEAABAwIDBQUFBgQEBwEAAAABAAIDESEEBTESQVFhcQYTIoGhMpGxwdEHFEJS4fBTYnKSFiOCshckM2PC0vEV/8QAGQEAAwEBAQAAAAAAAAAAAAAAAQIDAAQF/8QAJREAAwEAAQMEAgMBAAAAAAAAAAECESEDEjEEE0FRIjJCYXEF/9oADAMBAAIRAxEAPwDSyEy5t1Ik1TUiuzmXkYJTdUp+qSEg6OtYvPdYrxKTKFgkZjUpwXmrsjqKNlJIGKfuTMh8DuiTiH1KTM6jD0UWW3gB97dO/eNOf1UDaulk12U5MtfZLFATedB51RHtRiSJyK0o0H0VTyWYh4INDttoTuNUX7VzO7522AHBgrS4JpqOqp/EVL8hzCZi/ZF61v7yArblspdG08QqFBUUFq0aPmrzlX/TaOS55/Y6KngKNclgpgOqlDgrESU0qFmnstHF3wU1uiGZo7xMHUrN8BaGsse0zHiAd46KG1//ADQP8gp5hPZQ87UruDHUud5tuUeED7w48Nge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ryWEiFtN9TREGTlp4K1NyaJuGhsQ7YZcbyWgkrmNwDHNFdRbqOa565ZTwf/9k= />
<div class="column2">
<p>Cell2</p>
</div>
<div class="column3">
<p>Cell3</p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
CSS:
body {
background-image: url(http://weknowyourdreamz.com/images/sea/sea-08.jpg);
background-size: cover;
font-family: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif;
back
}
.header {
text-align: center;
padding: 10px;
background: #D2F0C6;
overflow: auto;
position: fixed;
top: 1px;
right: 1px;
left: 1px;
border: 6px solid #80bc80;
}
.header-inner {
Margin-top: 10px;
}
.images {
padding: 20px;
}
.header-inner a {
text-decoration: none;
color: #000000;
font-size: 24px;
font-weight: bold;
line-height: 20px;
}
.header-logo {
font-size: 32px;
Font-weight: bold;
line-height: 28px;
}
.header-logo a {
text-decoration: none;
color: #000000;
}
.header-nav a {
text-decoration: none;
color: #295f6f;
margin-right: 5px;
margin-left: 5px;
line-height: 25px;
font-weight: bold;
}
.header-nav {
margin-right: 5px;
margin-left: 5px;
}
..images {
padding: 20px 0;
}
.column {
width: 33%;
height: 33%;
font-weight: bold;
line-height: 30;
float: left;
text-align: center;
}
.profile-overlay {
float: left;
border: 6px solid #80bc80;
width: 255px;
height: 245px;
}
My Issue:
Basically, No matter what I do to get a border around my image, I get
Basically the top border extends behind the header.
I've tried margin-top with no success, it just keeps the picture in the same spot relative to the border while pushing the top of the border down.
line-height won't work either. Even line-height 1 will instantly make the picture match the top border but go away from the bottom and hide under the header.
I do have an idea in mind, doing line-height 1 then doing some command to move the whole border/picture down relative to the body, but I don't know any code that does that.
JSFiddle.
Remove border: 6px solid #80bc80; for .profile-overlay and add it to .column1 img.
.column1 img {
border: 6px solid #80bc80;
}

how to remove line breaks after each word in ionic

I made a custom list in my ionic app and it runs fine on my browser. But when I built it on android, the text in the h2 tag for the display name breaks to a new line after each word. I've tried removing the word-wrap and word-break from the css, but it still doesn't work.
This is the HTML for the view:
<ion-view view-title="Crave">
<fab ui-sref="post" class="ink"><i class="ion-compose"></i></fab>
<ion-content>
<ion-refresher pulling-text="Pull to refresh" pulling-icon="ion-arrow-down-b" on-refresh="doRefresh()">
</ion-refresher>
<div class="m-cards">
<div class="m-card" ng-repeat="post in posts">
<div class="m-card-header">
<span><i class="ion-android-time"></i>&nbsp In 2hrs</span>
<img ng-src="{{post.face}}" class="ink rip">
<h2>{{post.name}}</h2><br />
<p>#{{post.username}}</p><br /><br />
</div>
<span>{{post.postText}}</span>
<div class="m-card-stats">
<i class="ion-ios-heart"></i>&nbsp {{post.likes}}
<i class="ion-chatbox"></i>&nbsp {{post.comments}}
<i class="ion-android-share-alt"></i>
<span>12d ago</span>
</div>
<hr />
</div>
</div>
</ion-content>
</ion-view>
And this is the css:
.m-cards {
}
.m-card {
border-radius: 2px;
margin-bottom: 5px;
padding: 2px 20px;
width: 100%;
}
.m-card a {
color: #ef473a;
}
.m-card-post-alt {
color: #777;
height: 18px;
overflow: hidden;
}
.m-card-header h2 {
color: #000;
float: left;
font-size: 12pt;
font-weight: 300;
margin: 0;
margin-left: 10px;
word-wrap: normal !important;
word-break: normal !important;
}
.m-card-header p {
color: #000;
float: left;
margin: 0;
margin-left: 10px;
}
.m-card-header span {
color: #444;
float: right;
margin: 0;
}
.m-card-header img {
border-radius: 5px;
float: left;
height: 48px;
width: 48px;
}
.m-card-header span {
color: #444;
float: right;
margin: 0;
}
.m-card-stats {
margin-top: 20px;
}
.m-card-stats span {
color: #000;
float: right;
margin: 0;
}
.m-card-stats a {
color: #000;
margin-right: 20px;
}
Thanks in advance!!!
Finally fixed it. All I needed was to set the word-spacing to normal.
.m-card-header h2 {
color: #000;
float: left;
font-size: 12pt;
font-weight: 300;
margin: 0;
margin-left: 10px;
word-spacing: normal !important;
}

How do I put one <div> element below another <div>

I just finished doing HTML/CSS with Codecademy. One of the "projects" there is to make your own resume. I took the HTML/CSS from that project, and I'm tweaking it to make the resume look better. I'm currently trying to put one div - the part of the resume where text about my career objective will go - under another div, the header. It is, however, not working. The div for the "objective" is currently behind the div for the header. How on earth do I get that second div for the objective to go underneath the first div?
I read something about how I should float the header div to the left and then put clear:both; in the div for the objective, but that's not working.
HTML
<div id="header">
<p id="name">My Name</p>
<p id="email">myemail#email.com</p>
</div>
<div id="objective"></div>
<div class="left"></div>
<div class="right"></div>
<div id="footer">
<p>1234 Anywhere Street, Brooklyn NY 11216 | Tel: (123) 456-7890</p>
</div>
CSS
div {
border-radius: 5px;
}
#header {
z-index:1;
position: fixed;
width: 98%;
margin-top: -20px;
height: 60px;
background-color: #668284;
margin-bottom: 10px;
float:left;
}
#name {
float:left;
margin-left: 5px;
padding-top: 5px;
font-size: 16px;
font-family: Verdana, sans-serif;
color: #ffffff;
}
#email{
float:right;
margin-right: 5px;
padding-top: 5px;
font-size: 16px;
font-family: Verdana, sans-serif;
color: #ffffff;
}
.right p {
margin-left: 5px;
margin-right: 5px;
margin-top: -10px;
font-family: Garamond, serif;
color: #000000;
}
a:hover {
font-weight: bold;
}
#objective {
height: 50px;
background-color: #668284;
font-family: Verdana, sans-serif;
font-size: 14px;
text-align: center;
clear:both;
color: #ffffff;
}
.left {
position: relative;
float: left;
margin-top: 50px;
width: 49%;
height: 400px;
background-color: #B9D7D9;
margin-bottom: 10px;
}
.right {
position: relative;
float: right;
margin-top: 50px;
width: 49%;
height: 400px;
background-color: #F4EBC3;
margin-bottom: 10px;
}
#footer {
position: relative;
height: 50px;
background-color: #668284;
clear: both;
font-family: Verdana, sans-serif;
font-size: 14px;
text-align: center;
color: #ffffff;
}
#footer p {
position: relative;
padding-top: 15px;
}
For example:
<div class="div1">KSD;JSFAJ;SSD;</div>
<div class="div2">KSD;JSFAJ;SSdfaD;</div>
Css with float:
.div1 {
float: none;
}
.div2 {
float: none;
}
Css with display:
.div1 {
display: inline;
}
.div2 {
display: inline;
}
Here is the updated HTML :
<div id="header">
<p id="name">My Name</p>
<p id="email">myemail#email.com</p>
</div>
<div style="height:50px;width:98%;">
</div>
<div id="objective">Objective goes here</div>
<div class="left"></div>
<div class="right"></div>
<div id="footer">
<p>1234 Anywhere Street, Brooklyn NY 11216 | Tel: (123) 456-7890</p>
</div>
This will show the objective div underneath header div.
Also this is a link for your reference.
Here is update CSS, This show the responsive your html
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
div {
border-radius: 5px;
}
#header {
width: 98%;
margin: 0 auto;
height: 60px;
background-color: #668284;
margin-bottom: 10px;
}
#name {
float:left;
margin-left: 5px;
padding-top: 5px;
font-size: 16px;
font-family: Verdana, sans-serif;
color: #ffffff;
}
#email{
float:right;
margin-right: 5px;
padding-top: 5px;
font-size: 16px;
font-family: Verdana, sans-serif;
color: #ffffff;
}
.right p {
margin-left: 5px;
margin-right: 5px;
margin-top: -10px;
font-family: Garamond, serif;
color: #000000;
}
a:hover {
font-weight: bold;
}
#objective {
height: 50px;
background-color: #668284;
font-family: Verdana, sans-serif;
font-size: 14px;
text-align: center;
clear:both;
color: #ffffff;
}
.left {
position: relative;
float: left;
margin-top: 50px;
width: 49%;
height: 400px;
background-color: #B9D7D9;
margin-bottom: 10px;
}
.right {
position: relative;
float: right;
margin-top: 50px;
width: 49%;
height: 400px;
background-color: #F4EBC3;
margin-bottom: 10px;
}
#footer {
position: relative;
height: 50px;
background-color: #668284;
clear: both;
font-family: Verdana, sans-serif;
font-size: 14px;
text-align: center;
color: #ffffff;
}
#footer p {
position: relative;
padding-top: 15px;
}
Don't ever forget to add this code
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
So that you won't have empty space on your div
DEMO
I think its easier using bootstrap, here is the link http://getbootstrap.com/css/
What bootstrap does is that it creates containers that wrap the content of your site. It divides the site in rows. To do that you need and . With this bootstrap you can divide your rows in 12 cells.
Here is an example of how I divided my portfolio in 3 columns of 4 spaces
<div class="row">
<div class="col-md-12">
<hr>
</div>
</div>
<div class="row text-center">
<div class="col-md-4">
<h3 class="text-body"><u>Block vs Inline</u>
</h3>
<p class="p-text"><span>Block Elements</span> are those who take the complete line and full width of the page creating a "box".<br>
<span>Inline Elements</span> are those who doesn´t affect the layout, just the element inside the tag.
</p>
</div>
<div class="col-md-4">
<h3 class="text-body"><u>Selectors</u></h3>
<p class="p-text"><span>Class selectors</span> are used to target elements with specific attributes<br>On the other hand, <span>id selectors</span> are just for unique elements.</p>
</div>
<div class="col-md-4">
<h3 class="text-body"><u>Responsive Layout</u></h3>
<p class="p-text"><span>Responsive Layout</span> is the combination of html and css design to make the website look good in terms of enlargement, shrink and width in any screen (<em>computers, laptops, netbooks, tablets, phones</em>). </p>
</div>
</div>

How to get same height in display:table-cell

I have 3 buttons and I want that to be of same height.Also I want that to be of same height in tab resolution as well.I want this to be achieved in css.
Can anyone please tell me how can i achieve that.
HTML:
<div class="content">
<p>It's easy to become a member. </p>
<p> Join today online </p>
<div class="btn-wrap">
<div class="row">
<div class="col">Find Nearest Agent</div>
<div class="col"><a href="" >Join Now</a></div>
<div class="col"><a href="" >Download the App</a> </div>
</div>
</div>
</div>
CSS:
.content {
width:75%; //there is a reason to use 75% here coz I have to place an image for remaining 25%.
}
.btn-wrap {
display:table;
border-collapse: separate;
width:100%;
overflow: hidden;
}
.row {
display:table-row;
}
.col {
display:table-cell;
padding: 0 0.5% 0;
width:32%;
float: left;
}
a {
font-size: 20px;
}
input[type="submit"], a {
border: 0 none;
box-sizing: border-box;
display: block;
font-family: "Lato",Arial,sans-serif;
font-size: 17px;
font-style: normal;
font-weight: 900;
margin: 0;
padding: 20px 10px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
background-color: #ff0;
color: #1d6221
}
JSFiddle:http://jsfiddle.net/qwdduc7z/5/
Add height: 75px; to input[type="submit"], a{. eg. here
HTML
<div class="content">
<p>Easy to become number</p>
<p>Join Now </p>
<div class="btn-wcircle-wrap">
<div class="row">
Find Nearest Agent
Join Now
Download the App
</div>
</div>
</div>
CSS
.content {
width:75%;
}
.btn-wcircle-wrap {
display: table;
height: 100px;
}
.row {
display: table-row;
}
.col {
display: table-cell;
padding: 0 0.5%;
width: 32%;
}
a {
border: none;
box-sizing: border-box;
text-align: center;
vertical-align: middle;
font-family: "Lato",Arial,sans-serif;
font-size: 17px;
line-height: 1.5;
font-style: normal;
font-weight: 900;
text-decoration: none;
text-transform: uppercase;
background-color: #ff0;
color: #1d6221;
}
"to mimic the original example"
.content
{
width:75%;
}
.btn-wcircle-wrap {
display:table;
width:100%;
}
.row {
display:table-row;
}
.col {
display:table-cell;
padding: 20px 0.5%;
width:32%;
text-align: center;
background-color: #ff0;
box-shadow: 5px 0 0 0 white inset;
// or use
// border: 5px solid white;
}
a {
box-sizing: border-box;
vertical-align: text-top;
font-family: "Lato",Arial,sans-serif;
font-size: 17px;
line-height: 1.5;
font-style: normal;
font-weight: 900;
text-decoration: none;
text-transform: uppercase;
color: #1d6221;
}
http://jsfiddle.net/tksek87m/