I am new here so apologies if anything wrong I mention.
I want to make my bootstrap buttons mobile responsive. but, I am new to CSS. i want to display my buttons and text in middle of screen for small devices after video.so please tell me how to do it.
Here is my HTML code:
<div class="row" style="margin-top: 5%">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 ">
<p style="float: right; color: black;">I'm Ready to get my risk free <br /> membership today! <br /> (Limited Time and Quantities) </p>
</div>
</div>
<div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 ">
<a href="#">
<button class="btn btn-theme btn-sm" style="background: white;color: #404040">
My Email Address
</button> </a>
<a href="#">
<button class="btn btn-theme btn-sm" style="background: #404040; border-radius: 10px; color: white">
Keep me on your email list
</button> </a>
<a href="#">
<button class="btn btn-theme btn-sm" style="background: yellow; border-radius: 10px; float: right; color: black">
Get My Risk <br /> Free Membership today
</button> </a>
</div>
</div>
Here is the code. Hope it will Help you. I have added some of classes into p and a tag. Even i put css for mobile view. If any changes please let me know.
#media screen and (max-width: 767px) {
.email-wrap {
display: block;
margin-bottom: 20px;
text-align: center;
}
.text-wrap {
text-align: center;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="main-wrapper">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12">
<p class="text-wrap">I'm Ready to get my risk free <br /> membership today! <br />
(Limited Time and Quantities) </p>
</div>
</div>
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12">
<a href="#" class="email-wrap"><button class="btn btn-theme btn-sm" style="background: white;color: #404040">
My Email Address
</button> </a>
<a href="#" class="email-wrap"><button class="btn btn-theme btn-sm" style="background: #404040; border-radius: 10px; color: white">
Keep me on your email list
</button> </a>
<a href="#" class="email-wrap"><button class="btn btn-theme btn-sm" style="background: yellow; border-radius: 10px;color: black">
Get My Risk <br /> Free Membership today
</button> </a>
</div>
You can use media query for it or bootstrap 4 classes.
here is link for bootstrap class:
https://getbootstrap.com/docs/4.0/utilities/display/
#media (max-width: 575px){
p{
text-align: center;
float: unset !important;
}
a {
display: flex;
justify-content: center;
margin-bottom: 15px;
}
}
<div class="row" style="margin-top: 5%">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 ">
<p style="float: right; color: black;">I'm Ready to get my risk free <br /> membership today! <br />
(Limited Time and Quantities) </p>
</div>
</div>
<div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12">
<a href="#"><button class="btn btn-theme btn-sm" style="background: white;color: #404040">
My Email Address
</button> </a>
<a href="#"><button class="btn btn-theme btn-sm" style="background: #404040; border-radius: 10px; color: white">
Keep me on your email list
</button> </a>
<a href="#"><button class="btn btn-theme btn-sm" style="background: yellow; border-radius: 10px; float: right; color: black">
Get My Risk <br /> Free Membership today
</button> </a>
</div>
</div>
Related
This question already has answers here:
a href links not clickable
(3 answers)
HTML/CSS: link not clickable
(9 answers)
A href links not clickable or highlightable
(1 answer)
CSS - Link not clickable when using absolute position
(2 answers)
Closed 1 year ago.
Whenever I click on the button it doesn't lead to the hyperlink, it just go up and down after I click on it. I've tried re-linking or using other links to solve this issue but to no avail. It seems my html code is correct but I could be missing a small error in the code.
This is my code:
.btn {
background-color:transparent;
border-radius:28px;
border:1px solid #702F8A;
display:inline-block;
cursor:pointer;
color:#702F8A;
font-family:Tahoma;
font-size:14px;
padding:4px 13px;
text-decoration:none;
position: absolute;
bottom: 4.5%
}
.btn:hover {
background-color:#702F8A;
border-color:#702F8A;
}
.btn:active {
position:relative;
top:1px;
}
.flex-container {
display: flex;
justify-content: center;
}
<section class="px-4 cards_invitations">
<div class="container">
<div class="row">
<div class="col-12 col-md-6 col-lg-4 py-3 text-center border"><img class="img-fluid" font-family:lucida="" sans="" src="/images/contentimages/images/Accessories_Collage - Copy 2.png" />
<p class="my-3" style="font-size:18px;"> </p>
<div class="flex-container"><a class="btn btn-info btn-sm edatalayer order-1" data-list="product-listing-page" data-position="1" data-purl="custom-business-forms" href="https://www.example.com/">Accessories <i class="far fa-chevron-right pl-1"></i></a></div>
</div>
<div class="col-12 col-md-6 col-lg-4 py-3 text-center border"><img class="img-fluid" src="/images/contentimages/images/Activewear - Copy 1.png" />
<p class="my-3" style="font-size:18px;"> </p>
<div class="flex-container"><a class="btn btn-info btn-sm edatalayer order-1" data-list="product-listing-page" data-position="1" data-purl="custom-business-forms" href="https://www.example.com/">Active Wear <i class="far fa-chevron-right pl-1"></i></a></div>
</div>
<div class="col-12 col-md-6 col-lg-4 py-3 text-center border"><img class="img-fluid" font-family:lucida="" sans="" src="/images/contentimages/images/Bags_Backpacks_ - Copy 1.png" />
<p class="my-3" style="font-size:18px;"> </p>
<div class="flex-container"><a class="btn btn-info btn-sm edatalayer order-1" data-list="product-listing-page" data-position="1" data-purl="custom-business-forms" href="https://www.example.com/">Bags <i class="far fa-chevron-right pl-1"></i></a></div>
</div>
Remove the part in your CSS code where you write bottom: 4.5%
What this does is that it puts all elements with that class you made (btn), and puts them all on top of each other. When this happens, the browser doesn’t know where to redirect the user, which is why it was glitching a little as you have said. When you remove this, all the links should be working again.
Also this doesn’t really fix the problem you have, but at the end, you are missing 2 closing div tags and 1 closing section tag.
Full Correct Code:
<style type="text/css">
.btn {
background-color:transparent;
border-radius:28px;
border:1px solid #702F8A;
display:inline-block;
cursor:pointer;
color:#702F8A;
font-family:Tahoma;
font-size:14px;
padding:4px 13px;
text-decoration:none;
position: absolute;
}
.btn:hover {
background-color:#702F8A;
border-color:#702F8A;
}
.btn:active {
position:relative;
top:1px;
}
.flex-container {
display: flex;
justify-content: center;
}
</style>
<section class="px-4 cards_invitations">
<div class="container">
<div class="row">
<div class="col-12 col-md-6 col-lg-4 py-3 text-center border">
<img class="img-fluid" font-family:lucida="" sans="" src="/images/contentimages/images/Accessories_Collage - Copy 2.png" />
<p class="my-3" style="font-size:18px;"> </p>
<div class="flex-container"><a class="btn btn-info btn-sm edatalayer order-1" data-list="product-listing-page" data-position="1" data-purl="custom-business-forms" href="https://www.example.com/">Accessories <i class="far fa-chevron-right pl-1"></i></a></div>
</div>
<div class="col-12 col-md-6 col-lg-4 py-3 text-center border">
<img class="img-fluid" src="/images/contentimages/images/Activewear - Copy 1.png" />
<p class="my-3" style="font-size:18px;"> </p>
<div class="flex-container"><a class="btn btn-info btn-sm edatalayer order-1" data-list="product-listing-page" data-position="1" data-purl="custom-business-forms" href="https://www.example.com/">Active Wear <i class="far fa-chevron-right pl-1"></i></a></div>
</div>
<div class="col-12 col-md-6 col-lg-4 py-3 text-center border">
<img class="img-fluid" font-family:lucida="" sans="" src="/images/contentimages/images/Bags_Backpacks_ - Copy 1.png" />
<p class="my-3" style="font-size:18px;"> </p>
<div class="flex-container"><a class="btn btn-info btn-sm edatalayer order-1" data-list="product-listing-page" data-position="1" data-purl="custom-business-forms" href="https://www.example.com/">Bags <i class="far fa-chevron-right pl-1"></i></a></div>
</div>
</div>
</div>
</section>
When I use display:block it doesn't want to work which was working before. When I inspect it shows me strike through on display:block. Now the buttons are positioned on the right side of the col, I'd need them to be positioned in the middle under the image.
html
<div class="sectionLight">
<div class="row">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-12 col-lg-4">
<img class="img-fluid imgCenter" src="images/square.png">
<div class="row">
<div class="col-sm-12">
<button type="button" class="btn btn-danger btn-lg btnCenter" data-toggle="modal" data-target=".square-modal-lg">Prime</button>
</div>
</div>
</div>
<div class="col-sm-12 col-lg-4">
<img class="img-fluid imgCenter" src="images/fibo.png">
<div class="row">
<div class="col-sm-12">
<button type="button" class="btn btn-danger btn-lg btnCenter" data-toggle="modal" data-target=".fibo-modal-lg">Fibo</button>
</div>
</div>
</div>
<div class="col-sm-12 col-lg-4">
<img class="img-fluid imgCenter" src="images/square_copy.png">
<div class="row">
<div class="col-sm-12">
<button type="button" class="btn btn-danger btn-lg btnCenter" data-toggle="modal" data-target=".prime-modal-lg">Square</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
CSS
.btnCenter {
display: block;
margin: auto;
margin-top: 15px;
margin-bottom: 20px;
width: 50%;
}
You probably have included another css script that overwrites your current one.
You can try to make it !important. If that doesnt work, you might have to make your selector more spesific than the one currently overwriting it.
.btnCenter {
display: block !important;
margin: auto;
margin-top: 15px;
margin-bottom: 20px;
width: 50%;
}
You can debug this in the dev-tools. See the example image below:
In this example, primary.css is higher in the css hierarchy (meaning the file primary.css is included later than stacks.css) Therefore, it will overwrite the selector.
My current problem is that rows are overlapping each other when the screen is shrinked (responsive). I've tried adding containers without success. Also, I've noticed that rows are not "pushing" the content below them when in mobile screen sizes... What am I doing wrong here?
Everything looks very well on desktop and tablet, but once I reach mobile screen sizes it gets hairy.
Here's the live code: Codepen - Bootstrap rows overlapping
Here's my current HTML:
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.2/css/bootstrap.css" rel="stylesheet" />
<body>
<div class="container-fluid">
<nav class="navbar navbar-expand-md bg-light navbar-dark fixed-top">
<a class="navbar-brand text-dark" href="#">
<img src="img/logo-gp.png" height="40" width="40" alt="" />
</a>
<button class="navbar-toggler bg-dark" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link text-dark" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" href="#">Solutions</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" href="#">Contact Us</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" href="#">About Us</a>
</li>
</ul>
</div>
</nav>
<div class="row v-align position-static">
<div class="col-sm-6 col-md-8 fl-row">
<div class="f-row">
<p class="text-center txt-wrap text-light lead">A PARAGRAPH GOES HERE, I WILL FILL IT LATER ON.</p>
</div>
</div>
<div class="col-sm-6 col-md-4 fl-row">
<i id="animationItem-image--bigCloud" class="animationItem material-icons">cloud</i>
<i id="animationItem-image--smallCloud" class="animationItem material-icons">cloud</i>
<i id="animationItem-image--smallCloud" class="animationItem material-icons smallCloud-two">cloud</i>
</div>
</div>
<div class="row v-align">
<div class="col-md-4 s-row s-row-box">
<i class="fas fa-box-open fa-10x" style="color:#FFFFFF;"></i>
</div>
<div class="col-md-8 s-row text-center">
<h1> Welcome to WEBSITE</h1>
<p class="text-center txt-wrap text-light lead">ANOTHER PARAGRAPH WITH BRIEFING GOES HERE. WILL FILL IT LATER ON.</p>
<button type="button" class="btn btn-info">Learn About Us</button>
</div>
</div>
<div class="row v-align">
<div class="col-md-12">
<h2> Solutions</h2>
</div>
</div>
<div class="row v-align text-center">
<div class="col-md-4">
<i class="material-icons sol-icons">cloud_done</i>
<div class="sol-icons-cap">
<h3>Solutions</h3>
<p>SOLUTION DESCRIPTION GOES HERE.</p>
</div>
</div>
<div class="col-md-4">
<i class="material-icons sol-icons">wifi</i>
<div class="sol-icons-cap">
<h3>Solutions</h3>
<p>SOLUTION DESCRIPTION GOES HERE.</p>
</div>
</div>
<div class="col-md-4">
<i class="material-icons sol-icons">code</i>
<div class="sol-icons-cap">
<h3>Solutions</h3>
<p>SOLUTION DESCRIPTION GOES HERE.</p>
</div>
</div>
</div>
<div class="row v-align text-center">
<div class="col-md-4">
<i class="material-icons sol-icons">touch_app</i>
<div class="sol-icons-cap">
<h3>Solutions</h3>
<p>SOLUTION DESCRIPTION GOES HERE.</p>
</div>
</div>
<div class="col-md-4">
<i class="material-icons sol-icons">security</i>
<div class="sol-icons-cap">
<h3>Solutions</h3>
<p>SOLUTION DESCRIPTION GOES HERE.</p>
</div>
</div>
<div class="col-md-4">
<i class="material-icons sol-icons">local_phone</i>
<div class="sol-icons-cap">
<h3>Solutions</h3>
<p>SOLUTION DESCRIPTION GOES HERE.</p>
</div>
</div>
</div>
<div class="row v-align">
<div class="col-12">
Animated background (xterra solution reference)
</div>
</div>
<div class="row v-align2 text-light">
<div class="col-sm-6 t-row">
<h2>| Contact Us</h2>
<form>
<div class="form-group">
<input type="text" class="form-control form-ctrl" id="formGroupExampleInput" placeholder="Name">
</div>
<div class="form-group">
<input type="text" class="form-control form-ctrl" id="formGroupExampleInput2" placeholder="Email">
</div>
<div class="form-group">
<input type="text" class="form-control form-ctrl" id="formGroupExampleInput2" placeholder="Message">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
<div class="col-sm-6 t-row text-light">
<div class="contact-box">
<i class="material-icons">local_phone</i>PHONE NUMBER HERE<br />
<i class="material-icons">email</i>CONTACT EMAIL HERE
</div>
</div>
</div>
<div class="row v-align">
<div class="col-sm-4 fl-row text-light">
Services
</div>
<div class="col-sm-4 fl-row text-light">
Company
</div>
<div class="col-sm-4 fl-row text-light">
Address
</div>
</div>
</div>
</body>
Any guidence would be helpful!
Change height from vh to %
.v-align{
height:30%;
}
#import url('https://fonts.googleapis.com/css?family=Maven+Pro|Roboto');
body {
background-color: ;
padding-top: 70px;
}
#full-h {
height: 100%;
width: 100%;
}
.txt-wrap {
word-wrap: break-word;
}
.v-align {
height: 30%;
}
.v-align2 {
height: 40%;
}
.fl-row {
background-color: #314d74;
}
.f-row {
margin-top: 6vh;
width: 400px;
margin-left: auto;
margin-right: auto;
}
.s-row {
background-color: #b3bdc7;
}
.s-row-box {
padding: 5vh;
text-align: center;
}
.t-row {
background-color: #697fa4;
}
h1 {
color: #FFE082;
text-align: center;
margin-top: 2vh;
}
h2 {
border-left: 4px solid #FFB300;
}
.sol-icons {
font-size: 72px;
}
.sol-icons-cap {
width: 300px;
margin-left: auto;
margin-right: auto;
}
.form-ctrl {
display: block;
margin-top: 5vh;
width: 400px;
margin-left: auto;
margin-right: auto;
}
.contact.s-row-box {
display: block;
margin-top: 5vh;
width: 400px;
margin-left: auto;
margin-right: auto;
}
.contact-ctrl {
display: block;
margin-top: 5vh;
width: 400px;
margin-left: auto;
margin-right: auto;
}
#media (min-width: 576px) {
/* ... */
}
#media (min-width: 768px) {
/* ... */
}
/****** Canvas Animation ******/
/***** Animation CSS Code *****/
.project-title--container,
.project-link--container {
width: 100%;
text-align: center;
}
.project-title,
.project-link {
color: #fff;
font-weight: bold;
text-transform: uppercase;
}
.project-title {
font-size: 18px;
margin-top: 10px;
}
.project-link,
.project-link a {
color: #fff;
font-size: 14px;
margin-top: 10px;
margin-bottom: 10px;
}
.fa {
font-size: 22px !important;
padding: 0 5px;
color: #fff;
}
.container-animation--flexbox {
height: 100%;
padding: 0;
margin: 0;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: center;
}
.animationItem {
position: absolute;
margin-right: 35px;
}
#animationItem-image--bigCloud {
animation: bobble 2s infinite;
margin-top: 3vh;
margin-left: 12vh;
font-size: 170px;
color: #7ec0ee;
}
#animationItem-image--smallCloud {
animation: bobble 4s infinite;
margin-top: 12vh;
margin-left: 20vh;
font-size: 145px;
color: #e9e9e9;
}
.smallCloud-two {
margin-bottom: 5px;
margin-right: 320px;
font-size: 145px;
z-index: -1;
color: #d9d9d9 !important;
animation: bobble 2.5s infinite !important;
}
#keyframes bobble {
0% {
transform: translate3d(0px, -25px, 0px);
animation-timing-function: ease-in;
}
50% {
transform: translate3d(0px, -35px, 0px);
animation-timing-function: ease-out;
}
100% {
transform: translate3d(0px, -25px, 0px);
}
}
<!DOCTYPE html>
<html>
<head>
<title>Network Technology</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, maximum-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script defer src="https://use.fontawesome.com/releases/v5.0.10/js/all.js" integrity="sha384-slN8GvtUJGnv6ca26v8EzVaR9DC58QEwsIk9q1QXdCU8Yu8ck/tL/5szYlBbqmS+" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="css/style.css" />
<script src="js/script.js"></script>
</head>
<body>
<div class="container-fluid">
<nav class="navbar navbar-expand-md bg-light navbar-dark fixed-top">
<a class="navbar-brand text-dark" href="#">
<img src="img/logo-gp.png" height="40" width="40" alt="" /> TEST WEB
</a>
<button class="navbar-toggler bg-dark" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link text-dark" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" href="#">Solutions</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" href="#">Contact Us</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" href="#">About Us</a>
</li>
</ul>
</div>
</nav>
<div class="row v-align position-static">
<div class="col-sm-6 col-md-8 fl-row">
<div class="f-row">
<p class="text-center txt-wrap text-light lead">A PARAGRAPH GOES HERE, I WILL FILL IT LATER ON.</p>
</div>
</div>
<div class="col-sm-6 col-md-4 fl-row">
<i id="animationItem-image--bigCloud" class="animationItem material-icons">cloud</i>
<i id="animationItem-image--smallCloud" class="animationItem material-icons">cloud</i>
<i id="animationItem-image--smallCloud1" class="animationItem material-icons smallCloud-two">cloud</i>
</div>
</div>
<div class="row v-align">
<div class="col-md-4 s-row s-row-box">
<i class="fas fa-box-open fa-10x" style="color:#FFFFFF;"></i>
</div>
<div class="col-md-8 s-row text-center">
<h1> Welcome to WEBSITE</h1>
<p class="text-center txt-wrap text-light lead">ANOTHER PARAGRAPH WITH BRIEFING GOES HERE. WILL FILL IT LATER ON.</p>
<button type="button" class="btn btn-info">Learn About Us</button>
</div>
</div>
<div class="row v-align">
<div class="col-md-12">
<h2> Solutions</h2>
</div>
</div>
<div class="row v-align text-center">
<div class="col-md-4">
<i class="material-icons sol-icons">cloud_done</i>
<div class="sol-icons-cap">
<h3>Solutions</h3>
<p>SOLUTION DESCRIPTION GOES HERE.</p>
</div>
</div>
<div class="col-md-4">
<i class="material-icons sol-icons">wifi</i>
<div class="sol-icons-cap">
<h3>Solutions</h3>
<p>SOLUTION DESCRIPTION GOES HERE.</p>
</div>
</div>
<div class="col-md-4">
<i class="material-icons sol-icons">code</i>
<div class="sol-icons-cap">
<h3>Solutions</h3>
<p>SOLUTION DESCRIPTION GOES HERE.</p>
</div>
</div>
</div>
<div class="row v-align text-center">
<div class="col-md-4">
<i class="material-icons sol-icons">touch_app</i>
<div class="sol-icons-cap">
<h3>Solutions</h3>
<p>SOLUTION DESCRIPTION GOES HERE.</p>
</div>
</div>
<div class="col-md-4">
<i class="material-icons sol-icons">security</i>
<div class="sol-icons-cap">
<h3>Solutions</h3>
<p>SOLUTION DESCRIPTION GOES HERE.</p>
</div>
</div>
<div class="col-md-4">
<i class="material-icons sol-icons">local_phone</i>
<div class="sol-icons-cap">
<h3>Solutions</h3>
<p>SOLUTION DESCRIPTION GOES HERE.</p>
</div>
</div>
</div>
<div class="row v-align">
<div class="col-12">
Animated background (xterra solution reference)
</div>
</div>
<div class="row v-align2 text-light">
<div class="col-sm-6 t-row">
<h2>| Contact Us</h2>
<form>
<div class="form-group">
<input type="text" class="form-control form-ctrl" id="formGroupExampleInput" placeholder="Name">
</div>
<div class="form-group">
<input type="text" class="form-control form-ctrl" id="formGroupExampleInput2" placeholder="Email">
</div>
<div class="form-group">
<input type="text" class="form-control form-ctrl" id="formGroupExampleInput2" placeholder="Message">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
<div class="col-sm-6 t-row text-light">
<div class="contact-box">
<i class="material-icons">local_phone</i>PHONE NUMBER HERE<br />
<i class="material-icons">email</i>CONTACT EMAIL HERE
</div>
</div>
</div>
<div class="row v-align">
<div class="col-sm-4 fl-row text-light">
Services
</div>
<div class="col-sm-4 fl-row text-light">
Company
</div>
<div class="col-sm-4 fl-row text-light">
Address
</div>
</div>
</div>
</body>
</html>
<div class="container">
<div class="row">
<div class="col-lg-4 col-sm-6"><div class="text-center"><a class="btn btn-default btn-lg" href="#" role="button">Sell</a></div></div>
<div class="col-lg-4 col-sm-6"><div></div></div>
<div class="col-lg-4 col-sm-12"><div class="text-center"><a class="btn btn-default btn-lg" href="#" role="button">Buy</a></div></div>
</div>
</div>
Ok so iam wanting the 2 buttons next to eachother as they are but want them both in the middle of the screen (Vertically)
Hey try setting the columns text-align left and right like this:
This will make 2 columns and format the left column as text-right and the right column as text left, which will bring them together in the center of the screen:
<div class="container">
<div class="row">
<div class="col-xs-6 text-right">
<a class="btn btn-default btn-lg" href="#" role="button">Sell</a>
</div>
<div class="col-xs-6 text-left">
<a class="btn btn-default btn-lg" href="#" role="button">Buy</a>
</div>
</div>
</div>
From this refference, you can check this out:
<div class="outer">
<div class="middle">
<div class="inner">
<a class="btn btn-default btn-lg" href="#" role="button">Sell</a>
<a class="btn btn-default btn-lg" href="#" role="button">Buy</a>
</div>
</div>
</div>
CSS:
.outer {
display: table;
position: absolute;
height: 100%;
width: 100%;
}
.middle {
display: table-cell;
vertical-align: middle;
}
.inner {
text-align:center;
margin-left: auto;
margin-right: auto;
}
Codepen link: http://codepen.io/anon/pen/zGmagX
a.cr-button {
border: solid blue;
}
.job-entry a {
height: 65px;
margin: 5px;
display: block;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="btn-group-vertical col-md-offset-3 col-md-6 col-sm-offset-2 col-sm-8 col-xs-12" style="display:table;">
<div class="job-entry row large-text" style="display:table-row;">
<div style="display:table-cell;width:75px;">
<a class="btn cr-button pad">
<img src="http://dummyimage.com/64x64/000/fff" width="50">
</a>
</div>
<div style="display:table-cell">
<a class="btn cr-button pad-lg" href="#">Test Job 1</a>
</div>
<div style="display:table-cell;width:75px;">
<a href="/Builder/DeleteJob" class="btn cr-button pad">
<img src="http://dummyimage.com/64x64/000/fff" width="50">
</a>
</div>
</div>
</div>
So how do I line these three anchors? I've tried vertical-align in every tag that makes sense with every value that makes sense.
JsFiddle version
You need to give your div elements a vertical-align set to top, not the a elements contained within them:
<div style="vertical-align:top; display:table-cell">
<a class="btn cr-button pad-lg" href="#">Test Job 1</a>
</div>
Do like this
.cr-button {
border: solid blue;
}
.job-entry a {
height: 65px;
margin: 5px;
display: block;
}
.block{vertical-align: top;}
<div class="btn-group-vertical col-md-offset-3 col-md-6 col-sm-offset-2 col-sm-8 col-xs-12" style="display:table;">
<div class="job-entry row large-text" style="display:table-row;">
<div class="block" style="display:table-cell;width:75px;">
<a class="btn cr-button pad">
<img src="http://dummyimage.com/64x64/000/fff" width="50">
</a>
</div>
<div class="block" style="display:table-cell">
<a class="btn cr-button pad-lg" href="#">Test Job 1</a>
</div>
<div class="block" style="display:table-cell;width:75px;">
<a href="/Builder/DeleteJob" class="btn cr-button pad">
<img src="http://dummyimage.com/64x64/000/fff" width="50">
</a>
</div>
</div>
</div>