Have 2 nav buttons created with DIVs, trying to center both within a parent DIV in a responsive layout. The width of the parent DIV is responsive but the width of the buttons are fixed. Both buttons should be next to each other centered within the parent, with even space on both sides.
Looked at a few other posts about this, tried all the solutions including adding: margin:0px auto; - and also tried adding both: margin-left: auto; margin-right: auto - neither option has worked.
Don't know if it's an issue with some of the button style CSS code that's preventing it from being able to center, or if I'm missing something else.
Here's the code:
#head-map {
clear: none;
float: left;
margin-left: 30%;
width: 100%;
display: block;
margin-right: 1%;
text-align: center;
padding-top: 0px;
}
#map-button {
height: 35px;
width: 70px;
background-color: #12A483;
border-color: #9dacc8;
border-style: solid;
border-width: 3px;
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
text-align: center;
padding-top: 7px;
box-shadow: 0px 2px 7px #292929;
-moz-box-shadow: 0px 3px 8px #292929;
-webkit-box-shadow: 0px 3px 8px #292929;
float: left;
display: inline-block;
margin: 0px auto;
}
#espanol-button {
height: 35px;
width: 100px;
background-color: #12A483;
border-color: #9dacc8;
border-style: solid;
border-width: 3px;
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
text-align: center;
padding-top: 7px;
box-shadow: 0px 2px 7px #292929;
-moz-box-shadow: 0px 3px 8px #292929;
-webkit-box-shadow: 0px 3px 8px #292929;
float: left;
display: inline-block;
margin: 0px auto;
}
a.whitelink {
color: white;
}
a.whitelink:hover {
color: #00133e;
text-decoration: none;
}
<div id="head-map">
<div id="map-button"><a class="whitelink" href="#" target="new">Map</a>
</div>
<div id="espanol-button"><a class="whitelink" href="#" target="self">Español</a>
</div>
</div>
Make the inner divs display: inline-block and center them with text-align: center on the parent. Remove the floats.
Simplified example
Note how each inner div has no whitespace between it in the markup. This prevents extra whitespace being displayed between inline elements.
div {
text-align: center;
}
div > div {
display: inline-block;
width: 100px;
background: #F00;
margin: 10px;
}
<div id="head-map">
<div id="map-button"><a class="whitelink" href="#" target="new">Map</a>
</div><div id="espanol-button"><a class="whitelink" href="#" target="self">Español</a>
</div>
</div>
That's because you're using float: left; and causing text-align: center; wont work. Remove the float. Example:
#head-map {
clear: none;
width: 100%;
display: block;
margin-right: 1%;
text-align: center;
padding-top: 0px;
}
#map-button {
height: 35px;
width: 70px;
background-color: #12A483;
border-color: #9dacc8;
border-style: solid;
border-width: 3px;
border-radius: 15px;
-moz-border-radius:15px;
-webkit-border-radius:15px;
text-align: center;
padding-top: 7px;
box-shadow:0px 2px 7px #292929;
-moz-box-shadow: 0px 3px 8px #292929;
-webkit-box-shadow: 0px 3px 8px #292929;
display: inline-block;
margin:0 10px;
}
#espanol-button {
height: 35px;
width: 100px;
background-color: #12A483;
border-color: #9dacc8;
border-style: solid;
border-width: 3px;
border-radius: 15px;
-moz-border-radius:15px;
-webkit-border-radius:15px;
text-align: center;
padding-top: 7px;
box-shadow:0px 2px 7px #292929;
-moz-box-shadow: 0px 3px 8px #292929;
-webkit-box-shadow: 0px 3px 8px #292929;
display: inline-block;
margin:0 10px;
}
a.whitelink {
color: white;
}
a.whitelink:hover {
color: #00133e;
text-decoration: none;
}
<div id="head-map">
<div id="map-button"><a class="whitelink" href="#" target="new">Map</a>
</div>
<div id="espanol-button"><a class="whitelink" href="#" target="self">Español</a>
</div>
</div>
You'll need to add a wrapper div around the two buttons as well as a clear div.
http://codepen.io/anon/pen/mJKagE
<div id="head-map">
<div class="wrapper">
<div id="map-button"><a class="whitelink" href="#" target="new">Map</a>
</div>
<div id="espanol-button"><a class="whitelink" href="#" target="self">Español</a>
</div>
<div class="clear"></div>
</div>
</div>
Here's the CSS. Note the .clear class.
#head-map {
clear: none;
float: left;
margin-left: 30%;
width: 100%;
display: block;
margin-right: 1%;
text-align: center;
padding-top: 0px;
background:blue;
}
.wrapper {
width:182px;
margin:0 auto;
}
#map-button {
height: 35px;
width: 70px;
background-color: #12A483;
border-color: #9dacc8;
border-style: solid;
border-width: 3px;
border-radius: 15px;
-moz-border-radius:15px;
-webkit-border-radius:15px;
text-align: center;
padding-top: 7px;
box-shadow:0px 2px 7px #292929;
-moz-box-shadow: 0px 3px 8px #292929;
-webkit-box-shadow: 0px 3px 8px #292929;
float:left;
display: inline-block;
margin:0px auto;
}
.clear{clear:both}
#espanol-button {
height: 35px;
width: 100px;
background-color: #12A483;
border-color: #9dacc8;
border-style: solid;
border-width: 3px;
border-radius: 15px;
-moz-border-radius:15px;
-webkit-border-radius:15px;
text-align: center;
padding-top: 7px;
box-shadow:0px 2px 7px #292929;
-moz-box-shadow: 0px 3px 8px #292929;
-webkit-box-shadow: 0px 3px 8px #292929;
float:left;
display: inline-block;
margin:0px auto;
}
a.whitelink {
color: white;
}
a.whitelink:hover {
color: #00133e;
text-decoration: none;
}
Of course, flex-box can do this
#head-map {
padding-top: 0px;
display: flex;
justify-content: space-around;
}
#map-button {
height: 35px;
width: 70px;
background-color: #12A483;
border-color: #9dacc8;
border-style: solid;
border-width: 3px;
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
text-align: center;
padding-top: 7px;
box-shadow: 0px 2px 7px #292929;
-moz-box-shadow: 0px 3px 8px #292929;
-webkit-box-shadow: 0px 3px 8px #292929;
}
#espanol-button {
height: 35px;
width: 100px;
background-color: #12A483;
border-color: #9dacc8;
border-style: solid;
border-width: 3px;
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
text-align: center;
padding-top: 7px;
box-shadow: 0px 2px 7px #292929;
-moz-box-shadow: 0px 3px 8px #292929;
-webkit-box-shadow: 0px 3px 8px #292929;
}
a.whitelink {
color: white;
}
a.whitelink:hover {
color: #00133e;
text-decoration: none;
}
<div id="head-map">
<div id="map-button"><a class="whitelink" href="#" target="new">Map</a>
</div>
<div id="espanol-button"><a class="whitelink" href="#" target="self">Español</a>
</div>
</div>
The above example spaces the buttons out across the page.
This FIDDLE shows them centered with some slight left/right margin added.
Related
Need to make lines opposite to each other, now the lines are under each other. Tried a lot of methods but nothing work, please help! Really stuck with that. See the code below and a picture that shows the desired result, idk what to do. Tried to add margin; top; bottom; padding, these methods didn't do anything.
Here's the CSS and HTML:
.crypto-card{
width: 250px;
height: 230px;
background: white;
-webkit-box-shadow: 0px 3px 8px 0px rgba(194,192,194,1);
-moz-box-shadow: 0px 3px 8px 0px rgba(194,192,194,1);
box-shadow: 0px 3px 2px 0px rgba(240,240,240,1);
border-radius: 6px;
transition: .3s;
margin-left: 15px;
margin-right: 25px;
margin-bottom: 20px;
border: 1px solid rgb(245, 245, 245);
}
.crypto-card:hover{
transform: translateY(-1px);
-webkit-box-shadow: 0px 3px 6px 2px rgba(240,240,240,1);
-moz-box-shadow: 0px 3px 6px 2px rgba(240,240,240,1);
box-shadow: 0px 3px 6px 2px rgba(240,240,240,1);
}
.crypto-card .body{
width: 100%;
border-top: 1px solid rgb(240, 240, 240);
padding: 10px;
}
.crypto-card .logo-sprite{
width: 29px;
height: 29px;
margin: 10px;
}
.crypto-symbol{
border-left: 1px solid rgb(220, 220, 220);
padding-left: 10px;
font-size: 1.3rem;
/* font-family: 'Loto', sans-serif; */
letter-spacing: 5px;
text-transform: uppercase;
/* color: #3c3c3c; */
font-weight: 500;
color: rgb(70, 70, 70);
padding-bottom: 4px;
position: relative;
top: 4px;
}
.crypto-card .price-label{
width: 100%;
text-align: left;
color: rgb(190, 190, 190);
font-weight: 500;
font-size: .8rem;
}
.crypto-card .price{
font-size: 1.5rem;
font-weight: 100;
right: -60px;
top: 4px;
text-align: right;
}
<div class="d-flex justify-content-left" style="margin-top: 10px; padding-left: 5%; padding-right: 5%;">
<div class="row" style="">
<div class="crypto-card">
<span>
<img src="https://s2.coinmarketcap.com/static/img/coins/64x64/1.png" class="logo-sprite" width="16" height="16" alt="Bitcoin">
<span class="crypto-symbol">BTC</span>
</span>
<div class="body">
<span class="price">$3865.58</span>
<div class="price-label"><span class="title">Price</span></div>
<span class="volume">$67,585,868,137</span>
</div>
</div>
But I need it similar to this
Using a display: grid would make this super easy.
Here's and example:
* {
box-sizing: border-box;
}
.container {
width: 500px;
margin: auto;
padding: 20px;
}
.card {
display: grid;
grid-template-columns: 50px auto;
grid-template-rows: 50px 200px;
border: 1px solid #eee;
border-radius: 5px;
}
.card .image {
display: block;
align-self: stretch;
justify-self: stretch;
padding: 5px;
border: 1px solid #eee;
border-top: 0;
border-left: 0;
}
.card .header {
padding: 10px;
border-bottom: 1px solid #eee;
}
.card .side {
border-right: 1px solid #eee;
white-space: nowrap;
display: flex;
align-items: center;
}
.card .side .text {
rotate: -90deg;
translate:-12px 0;
}
.card .content {
padding: 10px;
}
<div class="card">
<img
src="https://s2.coinmarketcap.com/static/img/coins/64x64/1.png"
class="image"
alt="Bitcoin"
/>
<div class="header">BTC is a scam</div>
<div class="side">
<div class="text">BIG SCAM</div>
</div>
<div class="content">content in here</div>
</div>
Why wont my css styling of background color ,width, and height work on my last div >gameover ?
this first part is my html code:
<head>
<title>Maths Game</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-
scalable=yes">
<link rel="stylesheet" href="styling.css">
</head>
<body>
<div id="container">
<div id="score">Score: <span id="scoreValue">0</span></div>
<div id="correct">Correct</div>
<div id="wrong">Try Again</div>
<div id="question">7x7</div>
<div id="instructionBox">Click on the correct answer</div>
<div id="choices">
<div id="box1" class="box">1</div>
<div id="box2" class="box">2</div>
<div id="box3" class="box">3</div>
<div id="box4" class="box">4</div>
</div>
<div id="startReset">start Game</div>
Im guessing right here below is where it started getting messed up:
<div id="timeremaining">Time remaining:<span id="timeRemainingValue">
60</span> sec</div>
<div id="gameOver">
<p>Game Over!</p>
<p>Your score is __</p>
</div>
</div>
this second part is my css code and only the last style "game over" isn't working;
html {
height: 100%;
background: radial-gradient(circle, white, grey);
}
#container {
height: 440px;
width: 550px;
background-color: #9DD2EA;
margin: 100px auto;
/* this line directly above centers the container top and bottom 100px and left and
right to auto so that margin keeps getting
bigger and bigger on both sides till the element is center */
padding: 10px;
border-radius: 20px;
/* above line curves corners of element */
box-shadow: 4px 4px 6px 6px purple;
-webkit-box-shadow: 4px 4px 6px 6px purple;
-moz-box-shadow: 4px 4px 6px 6px purple;
/* [horizontal offset] [vertical offset] [blur radius] [optional spread radius] [color]
*/
position: relative;
}
#score {
background-color: yellow;
padding: 10px;
position: absolute;
left: 475px;
box-shadow: 0px 4px purple;
-moz-box-shadow: 0px 4px purple;
-webkit-box-shadow: 0px 4px purple;
}
#correct {
position: absolute;
left: 240px;
background-color: green;
color: white;
padding: 10px;
display: none;
}
#wrong {
/* line 45 makes it to where this element does not interact with other elements and
other elements behave as if it doesent exist*/
position: absolute;
left: 240px;
background-color: red;
color: white;
padding: 10px;
display: none;
}
#question {
margin: 55px auto 10px auto;
height: 150px;
width: 420px;
background-color: rgb(184, 53, 240);
box-shadow: 0px 4px purple;
font-size: 100px;
text-align: center;
font-family: Arial, Helvetica, sans-serif, sans-serif;
line-height: 150px;
color: black;
border-radius: 5px;
position: relative;
}
#question:active {
box-shadow: 0px 0px purple;
-moz-box-shadow: 0px 0px purple;
-webkit-box-shadow: 0px 0px purple;
top: 4px
}
#instructionBox {
height: 60px;
width: 420px;
background-color: blue;
margin: 1px auto 1px auto;
text-align: center;
line-height: 55px;
box-shadow: 0px 4px purple;
-moz-box-shadow: 0px 4px purple;
-webkit-box-shadow: 0px 4px purple;
border-radius: 5px;
position: relative;
/* transition: all 0.2s; line 71 & 72 with line 77 make the transition happen on click
*/
}
#instructionBox:active {
box-shadow: 0px 0px purple;
-moz-box-shadow: 0px 0px purple;
-webkit-box-shadow: 0px 0px purple;
top: 4px;
}
#choices {
/* background-color: sandybrown; */
height: 100px;
width: 420px;
margin: 10px auto;
color: black;
text-align: center;
line-height: -50px;
margin: 10px auto;
border-radius: 5px;
}
.box {
/*these boxes are within a choices div to help them size together*/
margin-right: 26px;
width: 85px;
height: 85px;
background-color: white;
float: left;
border-radius: 5px;
cursor: pointer;
box-shadow: 0px 4px grey;
-moz-box-shadow: 0px 4px grey;
-webkit-box-shadow: 0px 4px grey;
line-height: 80px;
position: relative;
/* with position relative and .box:active { top: 4px; the box moves down 4px}*/
/* transition: all 0.2s;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-o-transition: all 0.2s;
-ms-transition: all 0.2s; */
}
.box:hover,
#startReset:hover {
background-color: grey;
color: white;
box-shadow: 0px 4px purple;
-webkit-box-shadow: 0px 4px purple;
-moz-box-shadow: 0px 4px purple;
}
.box:active,
#startReset:active {
box-shadow: 0px 0px purple;
-webkit-box-shadow: 0px 0px purple;
-moz-box-shadow: 0px 0px purple;
top: 4px;
}
/* #box1{
margin: 10px 10px;
background-color: red;
width: 30px;
height: 30px;
}
#box2{
margin: 10px 10px;
background-color: white;
width: 30px;
height: 30px;
}
#box3{
margin: 10px 10px;
background-color: blue;
width: 30px;
height: 30px;
}*/
#box4 {
margin-right: 0;
}
#startReset {
/*these boxes are within a choices div to help them size together*/
margin-left: 230px;
width: 100px;
height: 45px;
background-color: rgb(255, 255, 255, 0.5);
float: left;
border-radius: 5px;
cursor: pointer;
box-shadow: 0px 4px grey;
-moz-box-shadow: 0px 4px grey;
-webkit-box-shadow: 0px 4px grey;
line-height: 45px;
text-align: center;
position: relative;
}
/* instead of writing these same pargraphs of code just at the element id to the similar
code alrady made like above */
/* #startReset:hover{
background-color: grey;
color: white;
box-shadow: 0px 4px purple;
-webkit-box-shadow: 0px 4px purple;
-moz-box-shadow: 0px 4px purple;
}
#startReset:active{
box-shadow: 0px 0px purple;
-webkit-box-shadow: 0px 0px purple;
-moz-box-shadow: 0px 0px purple;
top: 4px;
} */
#timeremaining {
/*these boxes are within a choices div to help them size together*/
visibility: hidden;
/* display: none; */
margin-left: 10px;
width: 200px;
height: 45px;
background-color: greenyellow;
float: left;
border-radius: 5px;
cursor: pointer;
box-shadow: 0px 4px grey;
-moz-box-shadow: 0px 4px grey;
-webkit-box-shadow: 0px 4px grey;
line-height: 45px;
text-align: center;
position: relative;
}
this below is the broken part with the >gameover style or gameOver div:
#gameOver {
height: 200px;
width: 500px;
background-color: linear-gradient(blue, green);
font-size: 1.0em;
}
I have this page which is a page for showing a product and what I'm trying to do is to have the image of the product on the right side and on the left side having the name, price and add to cart button. I use vertical align on img so the text goes to top but doing this means I have to use display inline-block so I can't use block to make the texts go one every line. I also tried to use <br> but it makes the text go under the image.
* {
margin: 0;
font-family: Iransans;
box-sizing: border-box;
}
* a:link {
text-decoration: none;
}
body {
background-color: #f5f5f5;
height: 100%;
min-height: 100%;
}
article{
background-color: #ffffff;
width: 85%;
padding: 20px 20px;
text-align: right;
direction: rtl;
border-radius: 3px;
margin: 20px auto;
-webkit-box-shadow: 0px 0px 4px -1px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 4px -1px rgba(0,0,0,0.75);
box-shadow: 0px 0px 4px -1px rgba(0,0,0,0.75);
}
img{
border: 1px solid #d9d9d9;
display: inline-block;
vertical-align: top;
}
.name{
display: inline-block;
font-size: 20px;
font-weight: bold;
margin: 5px 50px;
padding: 0 10px;
border-right: 5px solid #13bf19;
}
.price{
display: inline-block;
}
<body>
<article>
<img src="https://images.food52.com/8yjdBI07757aOjYnJJNPiI7XsPA=/375x0/fca306c8-d23b-46b6-8ce0-c0744830f596--2018-0716_sin_porcelain-paper-mug_silo_ty-mecham_001_1-.jpg" width="100" height="100">
<div class="name">name of product</div><br>
<div class="price">$59.99</div>
</article>
</body>
And this is what I'm trying to make:
.image{
margin: 0 50px;
float: right;
border: 1px solid black;
width: 100px;
height: 100px;
}
.text{
float: right;
}
<body>
<span class="image">IMAGE</span>
<span class="text">text</span><br>
<span class="text">text</span>
</body>
instead of adding outside div , add it inside.
* {
margin: 0;
font-family: Iransans;
box-sizing: border-box;
}
* a:link {
text-decoration: none;
}
body {
background-color: #f5f5f5;
height: 100%;
min-height: 100%;
}
article{
background-color: #ffffff;
width: 85%;
padding: 20px 20px;
text-align: right;
direction: rtl;
border-radius: 3px;
margin: 20px auto;
-webkit-box-shadow: 0px 0px 4px -1px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 4px -1px rgba(0,0,0,0.75);
box-shadow: 0px 0px 4px -1px rgba(0,0,0,0.75);
}
img{
border: 1px solid #d9d9d9;
display: inline-block;
vertical-align: top;
}
.name{
display: inline-block;
font-size: 20px;
font-weight: bold;
margin: 5px 50px;
padding: 0 10px;
border-right: 5px solid #13bf19;
}
.price{
display: inline-block;
}
<article>
<img src="https://images.food52.com/8yjdBI07757aOjYnJJNPiI7XsPA=/375x0/fca306c8-d23b-46b6-8ce0-c0744830f596--2018-0716_sin_porcelain-paper-mug_silo_ty-mecham_001_1-.jpg" width="100" height="100">
<div class="name">name of product<br><div class="price">$59.99</div></div><br>
</article>
just style it
* {
margin: 0;
font-family: Iransans;
box-sizing: border-box;
}
* a:link {
text-decoration: none;
}
body {
background-color: #f5f5f5;
height: 100%;
min-height: 100%;
}
article{
background-color: #ffffff;
width: 85%;
padding: 20px 20px;
text-align: right;
direction: rtl;
border-radius: 3px;
margin: 20px auto;
-webkit-box-shadow: 0px 0px 4px -1px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 4px -1px rgba(0,0,0,0.75);
box-shadow: 0px 0px 4px -1px rgba(0,0,0,0.75);
}
img{
border: 1px solid #d9d9d9;
display: inline-block;
vertical-align: top;
}
.name{
display: inline-block;
font-size: 20px;
font-weight: bold;
margin: 5px 50px;
padding: 0 10px;
border-right: 5px solid #13bf19;
}
.price{
font-size: 15px;
font-weight: normal;
}
<body>
<article>
<img src="https://images.food52.com/8yjdBI07757aOjYnJJNPiI7XsPA=/375x0/fca306c8-d23b-46b6-8ce0-c0744830f596--2018-0716_sin_porcelain-paper-mug_silo_ty-mecham_001_1-.jpg" width="100" height="100">
<div class="name"><h2>name of product</h2><h3 class="price">$59.99</h3></div>
</article>
</body>
Created a wrapper div called top div, got a p tag called Title aligned to the left and another div called buttonCP containing 4 p tags, aligned to the center with margin 0 auto. Now I want a final p tag called Button5 aligned to the right within top div, just cant seem to do it. Inspecting element shows that buttonCP margin auto could be pushing the final p tag out of the wrapper div. Any idea how I can have Button5 on the same line as Title and buttonCP? Thanks in advance!
Here is jsfiddle link:
https://jsfiddle.net/6r6jzypy/
<style> #topdiv {
background-color: #F0F0F0;
height: 40px;
width: 100%;
border: 2px solid #D8D8D8;
float:left;
}
p[name=heading] {
margin: 0;
font-weight: bold;
padding: 10px 8px 6px 8px;
float:left;
font-size: 1.0em;
}
#Result {
margin: 0;
float: right;
}
.button1 {
background-color: #D8D8D8;
margin-top: 3px;
float: left;
padding: 6px 8px 6px 8px;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
border: 2px solid #D8D8D8;
border-right: 1px;
}
.button2 {
background-color: #D8D8D8;
margin-top: 3px;
float: left;
padding: 6px 8px 6px 8px;
border: 2px solid #D8D8D8;
border-right: 1px;
}
.button3 {
background-color: #D8D8D8;
margin-top: 3px;
float: left;
padding: 6px 8px 6px 8px;
border: 2px solid #D8D8D8;
border-right: 1px;
}
.button4 {
background-color: #D8D8D8;
margin-top: 3px;
float: left;
padding: 6px 8px 6px 8px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
border: 2px solid #D8D8D8;
}
#buttonCP {
height: 34px;
width: 290px;
margin: 0 auto;
}
</style>
<body>
<div id="topdiv">
<p name="heading">Title</p>
<div id="buttonCP">
<p class="button1">Button1</p>
<p class="button2">Button2</p>
<p class="button3">Button3</p>
<p class="button4">Button4</p>
</div>
<p id="Result">Button5</p>
</div>
</body>
try this :
<div id="topdiv">
<p name="heading">Title</p>
<p id="Result">Button5</p>
<div id="buttonCP">
<p class="button1">Button1</p>
<p class="button2">Button2</p>
<p class="button3">Button3</p>
<p class="button4">Button4</p>
</div>
</div>
Live demo
Have a look at this fiddle
http://jsfiddle.net/ArvindSadasivam/v8dtj2ke/1/
divs:
<button class="typeBtn" id="">
<img class="iconTick" src="images/buttons/iconTick.png" alt="tickIcon" />Flatfront</button>
<button class="typeBtn" id="">Flatfront TWICE
<img class="iconTick" src="images/buttons/iconTick.png" alt="tickIcon" />
</button>
CSS:
.typeDiv {
position : relative;
margin : 20px 0 0 20px;
font-family : OpenSans-Regular;
}
.typeBtn {
position: relative;
width: 110px;
height: 40px;
box-shadow: 0 1px 3px #424242;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
border: 1px solid #D7D7D7;
color: #000000;
text-align: right;
font-family: OpenSans-Regular;
font-size: 0.7em;
padding: 0px 40px;
margin: 15px 10px 0px 0px;
}
.iconTick {
position : absolute;
width : 25px;
left : 5%;
top : 20%;
}
I want the Flatfront twice to be on the same position vertically.
Basically align them properly.
How do I do it?
Add
vertical-align: top;
Into your .typeBtn Class
Your Class should looks like this
.typeBtn {
position: relative;
width: 110px;
height: 40px;
box-shadow: 0 1px 3px #424242;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
border: 1px solid #D7D7D7;
color: #000000;
text-align: right;
font-family: OpenSans-Regular;
font-size: 0.7em;
padding: 0px 40px;
margin: 15px 10px 0px 0px;
vertical-align: top; /*Changed this */
}
Change the following styles in .typeBtn like
padding:0px;
text-align:center;