Overflow hidden not working for hover - css

I have an issue wherein I am using a div with 50% border radius and overflow hidden property. In this div, There is another div with hover event. The hover event is called even when the cursor is outside the circular div.
CODE:
.check {
border-radius: 50%;
height: 100%;
overflow: hidden;
}
.pad {
padding: 2%;
}
.bl {
background: black;
height: 100%;
width: 50%;
position: relative;
float: left;
text-align: center;
padding-top: 3.5%;
line-height: 8;
}
.gr {
background: gray;
height: 100%;
width: 50%;
position: relative;
float: left;
padding-top: 10%;
text-align: center;
font-weight: 600;
}
.out {
height: 100%;
width: 200%;
position: relative;
}
#media only screen and (min-width: 900px) {
.gr {
font-size: 6vh;
}
}
#media only screen and (max-width: 900px) {
.gr {
font-size: 4vh;
}
}
#media only screen and (max-width: 399px) {
.gr {
font-size: 3vh;
}
}
.out {
transition: all 1s ease-in-out;
}
.out:hover {
margin-left: -100%;
}
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 pad">
<div class="check">
<div class="out">
<div class="gr">Technology</div>
<div class="bl">
<button type="button" class="btn btn-lg btn-primary">Start Quiz</button>
<br>
<button type="button" class="btn btn-lg btn-primary">Read Post</button>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 pad">
<div class="check">
<div class="out">
<div class="gr">General Knowldege</div>
<div class="bl">
<button type="button" class="btn btn-lg btn-primary">Start Quiz</button>
<br>
<button type="button" class="btn btn-lg btn-primary">Read Post</button>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 pad">
<div class="check">
<div class="out">
<div class="gr">Sports</div>
<div class="bl">
<button type="button" class="btn btn-lg btn-primary">Start Quiz</button>
<br>
<button type="button" class="btn btn-lg btn-primary">Read Post</button>
</div>
</div>
</div>
</div>
</div>
I want to call hover event inside the circular div only

Remove all the position:relative you defined, they are creating the issue:
.check {
border-radius: 50%;
height: 100%;
overflow: hidden;
}
.pad {
padding: 2%;
}
.bl {
background: black;
height: 100%;
width: 50%;
float: left;
text-align: center;
padding-top: 3.5%;
line-height: 8;
}
.gr {
background: gray;
height: 100%;
width: 50%;
float: left;
padding-top: 10%;
text-align: center;
font-weight: 600;
}
.out {
height: 100%;
width: 200%;
overflow:hidden;
}
#media only screen and (min-width: 900px) {
.gr {
font-size: 6vh;
}
}
#media only screen and (max-width: 900px) {
.gr {
font-size: 4vh;
}
}
#media only screen and (max-width: 399px) {
.gr {
font-size: 3vh;
}
}
.out {
transition: all 1s ease-in-out;
}
.out:hover {
margin-left: -100%;
}
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 pad">
<div class="check">
<div class="out">
<div class="gr">Technology</div>
<div class="bl">
<button type="button" class="btn btn-lg btn-primary">Start Quiz</button>
<br>
<button type="button" class="btn btn-lg btn-primary">Read Post</button>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 pad">
<div class="check">
<div class="out">
<div class="gr">General Knowldege</div>
<div class="bl">
<button type="button" class="btn btn-lg btn-primary">Start Quiz</button>
<br>
<button type="button" class="btn btn-lg btn-primary">Read Post</button>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 pad">
<div class="check">
<div class="out">
<div class="gr">Sports</div>
<div class="bl">
<button type="button" class="btn btn-lg btn-primary">Start Quiz</button>
<br>
<button type="button" class="btn btn-lg btn-primary">Read Post</button>
</div>
</div>
</div>
</div>
</div>

Related

How do I align my border animation in the center with the text

I'm using this border animation https://codepen.io/FlorinCornea/pen/KKpvRYo but I'm trying to make it responsive by wrapping it in bootstrap however now its sticking to the left and I cant seem to center it
This is my DEMO:
.circle-wrapper {
position: relative;
width: 110px;
height: 110px;
}
.icon {
position: absolute;
color: #fff;
font-size: 55px;
top: 55px;
left: 55px;
transform: translate(-50%, -50%);
}
.circle {
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
padding: 2.5px;
background-clip: content-box;
animation: spin 10s linear infinite;
}
.circle-wrapper:active .circle {
animation: spin 2s linear infinite;
}
.success {
background-color: #2e3192;
border: 2.5px dashed #2e3192;
}
.error {
background-color: #CA0B00;
border: 2.5px dashed #CA0B00;
}
.warning {
background-color: #F0D500;
border: 2.5px dashed #F0D500;
}
#keyframes spin {
100% {
transform: rotateZ(360deg);
}
}
.page-wrapper {
background-color: #eee;
align-items: center;
justify-content: center;
}
<link rel="stylesheet" id="bootstrap-css" href="https://cdn.jsdelivr.net/npm/bootstrap#3.3.7/dist/css/bootstrap.min.css?ver=6.0" type="text/css" media="all">
<div class="our-process center-align tinted-bg">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>Our Process</h2>
</div>
<div class="row">
<div class="page-wrapper d-md-flex">
<div class="col-md-3 text-center">
<div class="circle-wrapper mx-auto">
<div class="success circle"></div>
<div class="icon">
<span class="glyphicon glyphicon-user"></span>
</div>
</div>
<h5>Assessor's Visit</h5>
</div>
<div class="col-md-3 text-center">
<div class="circle-wrapper mx-auto">
<div class="success circle"></div>
<div class="icon">
<span class="glyphicon glyphicon-user"></span>
</div>
</div>
<h5>Surveyor's Visit</h5>
</div>
<div class="col-md-3 text-center">
<div class="circle-wrapper mx-auto">
<div class="success circle"></div>
<div class="icon">
<span class="glyphicon glyphicon-user"></span>
</div>
</div>
<h5>installation</h5>
</div>
<div class="col-md-3 text-center">
<div class="circle-wrapper mx-auto">
<div class="success circle"></div>
<div class="icon">
<span class="glyphicon glyphicon-user"></span>
</div>
</div>
<h5>Post Inspection Visit</h5>
</div>
</div>
</div>
</div>
</div>
</div>
I have bootstrap linked to my site so that's not the issue
Here's an image of what it looks like now i am trying to center align the blue circles with the text that's below them:
For Bootstrap 4:
As you use bootstrap, I add 3 bootstrap classes:
d-md-flex (= display:flex on medium screen) on your page-wrapper
text-center on your col-md-3
mx-center (= margin horizontal auto) on your circle-wrapper
The d-md-flex could be replace by row mx-0
For bootstrap 3:
You just need to create the missing css classes:
#media (min-width: 768px){
.d-md-flex {
display: -webkit-box!important;
display: -ms-flexbox!important;
display: flex!important;
}
}
.mx-auto{
margin-right:auto !important;
margin-left:auto !important;
}
Check that on large screen and it should be centered.
.circle-wrapper {
position: relative;
width: 110px;
height: 110px;
}
.icon {
position: absolute;
color: #fff;
font-size: 55px;
top: 55px;
left: 55px;
transform: translate(-50%, -50%);
}
.circle {
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
padding: 2.5px;
background-clip: content-box;
animation: spin 10s linear infinite;
}
.circle-wrapper:active .circle {
animation: spin 2s linear infinite;
}
.success {
background-color: #2e3192;
border: 2.5px dashed #2e3192;
}
.error {
background-color: #CA0B00;
border: 2.5px dashed #CA0B00;
}
.warning {
background-color: #F0D500;
border: 2.5px dashed #F0D500;
}
#keyframes spin {
100% {
transform: rotateZ(360deg);
}
}
.page-wrapper {
background-color: #eee;
align-items: center;
justify-content: center;
}
/************************************/
/** BOOTSTRAP 4 CSS ADDED **/
/************************************/
#media (min-width: 768px){
.d-md-flex {
display: -webkit-box!important;
display: -ms-flexbox!important;
display: flex!important;
}
}
.mx-auto{
margin-right:auto !important;
margin-left:auto !important;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha512-6MXa8B6uaO18Hid6blRMetEIoPqHf7Ux1tnyIQdpt9qI5OACx7C+O3IVTr98vwGnlcg0LOLa02i9Y1HpVhlfiw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<div class="page-wrapper d-md-flex">
<div class="col-md-3 text-center">
<div class="circle-wrapper mx-auto">
<div class="success circle"></div>
<div class="icon">
<span class="glyphicon glyphicon-user"></span>
</div>
</div>
<h5>Assessor's Visit</h5>
</div>
<div class="col-md-3 text-center">
<div class="circle-wrapper mx-auto">
<div class="success circle"></div>
<div class="icon">
<span class="glyphicon glyphicon-user"></span>
</div>
</div>
<h5>Surveyor's Visit</h5>
</div>
<div class="col-md-3 text-center">
<div class="circle-wrapper mx-auto">
<div class="success circle"></div>
<div class="icon">
<span class="glyphicon glyphicon-user"></span>
</div>
</div>
<h5>installation</h5>
</div>
<div class="col-md-3 text-center">
<div class="circle-wrapper mx-auto">
<div class="success circle"></div>
<div class="icon">
<span class="glyphicon glyphicon-user"></span>
</div>
</div>
<h5>Post Inspection Visit</h5>
</div>
</div>

Hero section zoomed in on IOS

IOS displays hero images really pixeladed and zoomed in, while other os and browsers other than safari are fine... help!
Not sure how to go about it... Can I fix it through css or just not have a hero slider in the site in order to keep the UX/UI up?
This is my html
<section id="hero">
<div class="container-fluid hero-container">
<div id="heroCarousel" class="carousel slide carousel-fade" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#heroCarousel" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#heroCarousel" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#heroCarousel" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active" data-bs-interval="5000" style="background-image: url(/assets/img/hero/clouds.jpg); background-position: center bottom">
<div class="carousel-container">
<div class="carousel-caption dark">
<div class="hero-content-container">
<div class="carousel-header animate__animated animate__fadeInDown">I am an explorer</div>
<div class="carousel-content animate__animated animate__fadeInUp animate__delay-1s">I love to explore and discover new skills, like a new programming language, or a new real language!</div>
</div>
</div>
</div>
</div>
<div class="carousel-item" data-bs-interval="5000" style="background-image: url(/assets/img/hero/buildings-bottom.jpg); background-position: center bottom">
<div class="carousel-container">
<div class="carousel-caption dark">
<div class="carousel-header animate__animated animate__fadeInDown">I am a problem solver</div>
<div class="carousel-content animate__animated animate__fadeInUp animate__delay-1s">From software and hardware to welding up a new design, I love solving problems that come along with creating</div>
</div>
</div>
</div>
<div class="carousel-item" data-bs-interval="5000" style="background-image: url(/assets/img/hero/printer-hero.jpg); background-position: center top">
<div class="carousel-container">
<div class="carousel-caption">
<div class="carousel-header animate__animated animate__fadeInDown">I love to create</div>
<div class="carousel-content animate__animated animate__fadeInUp animate__delay-1s">Designing and creating new and clever things has been a passion for me all my life</div>
</div>
</div>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#heroCarousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#heroCarousel" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</div>
<div id="about"></div>
</section>
And this is the Css
.hero-container {
width: 100%;
height: 100vh;
padding: 0;
overflow: hidden;
margin-top: 0;
}
.carousel-container {
display: flex;
justify-content: center;
}
.carousel-item {
/* width: 100%; */
height: 100vh;
background-size: cover;
background-repeat: no-repeat;
/* position: relative; */
transition: 0.5s;
background-attachment: fixed;
}
.hero-content-container {
margin: 0;
}
.carousel-caption {
top: 50%;
transform: translateY(-50%);
margin: 0px;
padding: 0px;
}
.dark {
color: #313131;
}
.carousel-header {
font-family: "Oxygen", sans-serif;
font-size: 70px;
top: 50%;
transform: translateY(-50%);
margin-bottom: 0px;
}
.carousel-content {
font-family: "Oxygen", sans-serif;
font-size: 25px;
margin-top: 0px;
}
#media (max-width: 500px) {
.carousel-header {
font-size: 40px !important;
}
.carousel-content {
font-size: 15px !important;
}
}
#media (max-width: 800px) {
.carousel-header {
font-size: 55px;
}
.carousel-content {
font-size: 25px;
}
}
What it should look like
What it looks like on safari / IOS (apple)

Buttons inside three divs won't center

What I am trying to do is when the max width of a screen is 750px I want the buttons inside of my side-bar to be centered both vertically and horizontally using flexbox. Here is what I have tried:
.side-bar {
height: calc(100vh - 55px);
width: 18.5%;
background-color: #F5F5F5;
overflow: auto;
}
.side-bar .content {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
padding-top: 30px;
box-sizing: border-box;
}
.side-bar .button {
margin-bottom: 5px;
}
.side-bar .button:hover i {
color: dodgerblue;
}
.side-bar .button div {
text-align: left;
}
.side-bar .button form {
display: flex;
}
.side-bar .button a {
align-self: center;
margin-left: 12%;
margin-right: 5%;
}
.side-bar .button a i {
color: black;
font-size: 18px;
transition: 0.3s;
}
.side-bar .button input {
border: none;
font-size: 15px;
background-color: Transparent;
}
.side-bar .button input:active {
color: black;
}
.side-bar .sub-title {
margin-left: 12%;
}
.side-bar .sub-title p {
color: #6C6C6D;
font-weight: bold;
font-size: 14px;
}
#media (max-width: 750px) {
.side-bar .content {
justify-content: center;
}
.side-bar .button input {
display: none;
}
.side-bar .sub-title {
display: none;
}
}
<div class="side-bar">
<div class="content">
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-tachometer-alt"></i>
<input type="submit" value="Dashboard">
</form>
</div>
</div>
<div class="sub-title">
<p>TOOLS</p>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-minus-circle"></i>
<input type="submit" value="Ban Panel">
</form>
</div>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-exclamation-circle"></i>
<input type="submit" value="Warn Panel">
</form>
</div>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-gift"></i>
<input type="submit" value="Gift Panel">
</form>
</div>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-user"></i>
<input type="submit" value="User Info">
</form>
</div>
</div>
<div class="sub-title">
<p>NEWS</p>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-newspaper"></i>
<input type="submit" value="News Panel">
</form>
</div>
</div>
</div>
</div>
When when I use justify-content on my content div the children of the content div aren't centered. I would like the buttons centered both vertically and horizontally.
Note on potential duplicates
Before anyone marks this a duplicate, it's not. I looked at the solutions to my last post about it being a duplicate for the same reason and it's not.
How my post is different from my previous post: My previous post I was trying to center a div inside a div, that didn't work out so I tried a different approach and got my result that I wanted. Now, I am trying to center my div inside three other divs but do not understand what it is not centering after using flexbox to center it.
I believe below solution fixes your issue. Content was a little off to the bottom, because .content had only padding-top: 30px, which I changed to padding: 30px 0. I also removed display: none rules, because then, well, nothing was inside this sidebar.
Key part
.side-bar .content {
...
padding: 30px 0;
...
}
Snippet
.side-bar {
height: calc(100vh - 55px);
width: 18.5%;
background-color: #F5F5F5;
overflow: auto;
}
.side-bar .content {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
padding: 30px 0;
box-sizing: border-box;
}
.side-bar .button {
margin-bottom: 5px;
}
.side-bar .button:hover i {
color: dodgerblue;
}
.side-bar .button div {
text-align: left;
}
.side-bar .button form {
display: flex;
}
.side-bar .button a {
align-self: center;
margin-left: 12%;
margin-right: 5%;
}
.side-bar .button a i {
color: black;
font-size: 18px;
transition: 0.3s;
}
.side-bar .button input {
border: none;
font-size: 15px;
background-color: Transparent;
}
.side-bar .button input:active {
color: black;
}
.side-bar .sub-title {
margin-left: 12%;
}
.side-bar .sub-title p {
color: #6C6C6D;
font-weight: bold;
font-size: 14px;
}
#media (max-width: 750px) {
.side-bar .content {
justify-content: center;
}
.side-bar .button input
}
.side-bar .sub-title {
}
}
<div class="side-bar">
<div class="content">
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-tachometer-alt"></i>
<input type="submit" value="Dashboard">
</form>
</div>
</div>
<div class="sub-title">
<p>TOOLS</p>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-minus-circle"></i>
<input type="submit" value="Ban Panel">
</form>
</div>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-exclamation-circle"></i>
<input type="submit" value="Warn Panel">
</form>
</div>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-gift"></i>
<input type="submit" value="Gift Panel">
</form>
</div>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-user"></i>
<input type="submit" value="User Info">
</form>
</div>
</div>
<div class="sub-title">
<p>NEWS</p>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-newspaper"></i>
<input type="submit" value="News Panel">
</form>
</div>
</div>
</div>
</div>

How to get sidebar to take up 90% of the page when top bar is using pixels?

I've got a difficult question and have spent a good half-hour researching on what to do to fix this problem but have had no luck.
As you can see the in the below, there is a small gap on the bottom left of the picture. The gap is between the side bar and the bottom of the page. The side bar uses a percentage of 90% for it's height while the top bar using a height of 60px. The reason why I am using pixels for the top bar is because I do not want it to resize when resizing the window vertically. I have highlighted the problem in a red box, here is the screenshot...
HTML
<div class="wrapper">
<div class="top-bar">
<div class="left">
<div class="title">
<p>Cold Ops</p>
</div>
</div>
<div class="right">
</div>
</div>
<div class="side-bar">
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-tachometer-alt fa-lg"></i>
<input type="submit" value="Dashboard">
</form>
</div>
</div>
<div class="sub-title">
<p>TOOLS</p>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-ban fa-lg"></i>
<input type="submit" value="Ban Panel">
</form>
</div>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-exclamation-circle fa-lg"></i>
<input type="submit" value="Warn Panel">
</form>
</div>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-gift fa-lg"></i>
<input type="submit" value="Gift Panel">
</form>
</div>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-user fa-lg"></i>
<input type="submit" value="User Info">
</form>
</div>
</div>
<div class="sub-title">
<p>NEWS</p>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-file fa-lg"></i>
<input type="submit" value="New Post">
</form>
</div>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-trash fa-lg"></i>
<input type="submit" value="Remove Post">
</form>
</div>
</div>
<div class="sub-title">
<p>OTHER</p>
</div>
<div class="button">
<div>
<form action="http://google.com">
<i class="fas fa-chart-pie fa-lg"></i>
<input type="submit" value="Game Statistics">
</form>
</div>
</div>
</div>
</div>
CSS
body {
margin: 0;
padding: 0;
background-color: #FAFAFA;
font-family: sans-serif;
}
.wrapper {
height: 100vh;
}
.top-bar {
display: flex;
width: 100%;
height: 60px;
background-color: white;
box-shadow: 0 5px 5px -5px rgba(169,169,169,0.5);
}
.top-bar .left {
flex: 2.195;
}
.top-bar .left .title {
display: flex;
justify-content: center;
height: 100%;
}
.top-bar .left .title p {
align-self: center;
font-weight: lighter;
font-size: 18px;
}
.top-bar .right {
flex: 10;
background-color: white;
}
.side-bar {
display: flex;
flex-direction: column;
overflow: auto;
width: 18%;
margin-top: 1px;
height: 89.9%;
background-color: white;
box-shadow: 3px 0 10px -5px rgba(169,169,169,0.5);
}
.side-bar > div:first-of-type {
margin-top: 25px;
margin-left: 12%;
}
.side-bar .button {
position: relative;
margin-left: 12%;
margin-bottom: 3px;
}
.side-bar .button div {
text-align: left;
}
.button form input {
margin-left: 40px;
background-color: Transparent;
border: none;
font-size: 14px;
}
.button form input:active {
color: black;
}
.button form i {
color: black;
font-size: 16px;
transition: 0.3s;
position: absolute;
left: 0px;
top: 2.5px;
padding: 5px 0px;
}
.button:hover form i {
color: dodgerblue;
}
.sub-title {
margin-top: 12px;
margin-left: 12%;
}
.sub-title p {
font-size: 13px;
font-weight: bold;
color: #7A8B92;
}
Note: When the window is not in full-screen mode this issue does not occur.
If you have extra time: what do you think of the theme and my CSS code? Can it be improved? Is it good?

Centering bootstrap 3 buttons

I have three buttons, two of which only appear on mobile sized screens. I would like all three buttons to remain centered on various mobile size screens however two of them (email & call), do not remain centered.
These two adjust according to the screen yet apply now does not. How do I keep them centered?
Here is my code pen: codepen
here is the relevant html:
<div id="directions" class="container–fluid">
<div class="container">
<!-- Example row of columns -->
<div class="row" id="ab">
<div class="col-md-6">
<h2><img class="img–responsive" src="img/logo1_03.png"></h2>
<div id="dd">
<a class="btn btn-success btn-lg myButton" href="#" role="button">Apply Now »</a>
<div id="dd">
<a class="btn btn-info visible-xs btn-lg myButton" href="#" role="button">Email »</a>
</div>
<div id="dd"><a class="btn btn-success visible-xs btn-lg myButton" href="#" role="button">Call »</a>
</div>
<br>
<br>
<br>
<div class="row" id="cb">
<div class="col-md-10 hidden-xs">
<p id="shop">Shop Smart</p>
<p id="save">Save Smart</p>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<form class="hidden-sm hidden-xs well" id="contact" role="form">
<h1>Contact us</h1>
<div class="form-group">
<input type="text" class="form-control" id="firstname" placeholder="First Name">
</div>
<div class="form-group">
<input type="text" class="form-control" id="lastname" placeholder="Last Name">
</div>
<div class="form-group">
<input type="text" class="form-control" id="companyname" placeholder="Company Name">
</div>
<div class="form-group">
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
</div>
<div class="form-group">
<input type="tel" class="form-control" id="exampleInputtel1" placeholder="Phone">
</div>
<button type="submit" class="btn btn-default"> Submit</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
Here is my CSS (not the bootstrap):
#directions{
height: 500px;
background-image: url("../img/terminals-body2feather.jpg");
background-repeat: no-repeat;
background-position:center;
background-color: white;
border: 5px solid black;
}
/*.jumbotron {
background-image: url("../img/terminals-body2feather.jpg");
height: 500px;
background-repeat: no-repeat;
background-position:center;
background-color: white;
line-height: 0;
border: 2px solid black;
}*/
#logo{
margin-top: 1em;
border: 2px solid black;
}
#contact{
border: 2px solid black;
width: 300px;
padding-top: 10px;
margin-top: 20px;
}
#contact h1{
text-align: center;
margin-bottom: 5px;
margin-top: 0px;
}
#ab{
border: 2px solid black;
}
#cb{
height: 250px;
}
.col–md–5{
}
.col–md–4{
height: 160px;
border: 2px solid black;
text-align: center;
margin-top: 1em;
}
#head {
line-height: 0;
}
#shop {
background-color: rgba(0, 0, 0, 0.498);
font: 64px 'roboto';
color: #FFF;
margin-bottom: 0px;
margin-top: 20px;
text-align: center;
}
#save {
background-color: rgba(0, 0, 0, 0.498);
font: 78px/70px 'roboto';
color: #1A8AF7;
margin-bottom: 0px;
padding-bottom: 5px;
text-align: center;
}
#adv {
text-align: center;
border: 2px solid black;
}
.myButton {
width: 150px;
}
#media (min-width: 768px) and (max-width: 1160px) {
.nav > li > a {
font-size: 12px;
padding-left: 10px;
padding-right: 10px; }
#top {
padding-right:0px;
padding-left:0px;
}
h2{
text-align:center;
}
#dd {
margin:0 auto;
width:50%;
text-align: center;
}
#shop {
font: 44px 'roboto';}
#save {
font: 58px/55px 'roboto';
}
}
#media (max-width: 767px) {
#directions{
height: 300px;
}
h2{
text-align:center;
}
#dd {
margin:15px auto;
width:50%;
text-align: center;
I can't identify the css differences between "apply now" and the other two buttons.
You're missing a </div>
<div id="dd">
<a class="btn btn-success btn-lg myButton" href="#" role="button">Apply Now »</a>
</div> <!-- You're missing this close DIV! -->
<div id="dd">
<a class="btn btn-info visible-xs btn-lg myButton" href="#" role="button">Email »</a>
</div>
<div id="dd">
<a class="btn btn-success visible-xs btn-lg myButton" href="#" role="button">Call »</a>
</div>
The difference is that the two other buttons is wrapped inside another #dd.
Know that it is not valid html to have multiple id's with the same name on one page. Instead use classes.
The bootstrap classes visible-xs made the two buttons display:block. When I changed their display to display:inline-block my centering method of text-align:center worked.

Resources