Is there are any way of making carousel attachment fixed just like we can use to make background-image attachment fixed? Example
https://jsfiddle.net/5c3b56a7/3/
if there are any way of fixing slider background attachment that would be really helpfull for me thanks.
<div id="main-slider" class="owl-carousel owl-theme text-center">
<div class="item text-center">
<div class="position col-lg-12 text-center">
<h1 class="swiper-slide text-center">
<strong>
welcome to the shop
</strong>
</h1>
<p class="subtitle">
<span>
Take your time looking around & don't be shy
</span>
</p>
<p class="top-space">
<button type="button" class="btn btn-default btn-lg button hvr-float-shadow" id="focus">
START BROWSING
</button>
</p>
</div>
<img src="img/front_girl1.jpg">
</div>
<div class="item text-center">
<div class="position col-lg-12 text-center">
<h1 class="swiper-slide">
<strong>
Huge summer sale
</strong>
</h1>
<p class="subtitle">
<span>
All sunglasses 50% off while supplies last
</span>
</p>
<p class="top-space">
<button type="button" class="btn btn-default color-red btn-lg button hvr-float-shadow" id="focus">
SHOP SUNGLASSES
</button>
</p>
</div>
<img src="img/front_girl_3.jpg" style="background-position:fixed">
</div>
<div class="item text-center">
<div class="position col-lg-12 text-center">
<h1 class="swiper-slide">
<strong>
Make a statement
</strong>
</h1>
<p class="subtitle">
<span>
Check the store for more information
</span>
</p>
<p class="top-space">
<button type="button" class="btn btn-default color-green btn-lg button hvr-float-shadow" id="focus">
SHOP COATS
</button>
</p>
</div>
<img src="img/front_girl_2.jpg" style="background-position:fixed">
</div>
</div>
My CSS
/*slider*/
#main-slider .item img{
display: block;
width: 100%;
height:700px;
z-index: -1;
}
.position{
position: absolute;
padding-top: 240px;
}
.swiper-slide{
text-transform: uppercase;
letter-spacing: 3px;
font-size: 60px;
line-height: 79px!important;
color: #fff;
}
.subtitle{
font-family: 'Rouge Script', cursive;
font-size: 40px;
line-height: 39px!important;
font-weight: 400;
color: #fff;
font-style: italic;
}
strong{
font-weight: bold;
}
.btn-default{
background-color: #5cbcf6;;
border-radius: 0px;
color: #fff;
height: 61px;
margin-bottom: 20px;
font-size: 15px;
width: 250px;
float: none;
text-align: center;
border: none;
letter-spacing: 3px;
text-transform: uppercase;
}
.btn-default:hover{
background-color: #5cbcf6;;
border-radius: 0px;
color: #fff;
height: 61px;
margin-bottom: 20px;
font-size: 15px;
width: 250px;
float: none;
text-align: center;
border: none;
letter-spacing: 3px;
text-transform: uppercase;
`enter code here`}
.color-red{
background-color:#ff4f57!important;
}
.color-green{
background-color: #54df92!important;
}
.top-space{
padding-top: 30px;
}
.top-spacing{
padding-top: 60px;
}
.space-from-top{
margin-top: 30px;
}
Related
I have a cart menu that I'm filling with items, on web they show up as 4 columns of items, but on mobile they show up as 3 columns.
Also, when a column isn't full, I want the item/s to be left-aligned, but now they are being centered and look out of place.
How can I set it up like this without redirecting to a separate page for mobile?
Can I achieve it with percentages rather than absolute sizes or some other way?
index.html:
<link rel="stylesheet" href="styles2.css" />
<div class="imgbox">
<img class="center-stretch" src="images/banner.png">
</div>
<section class="container content-section border">
<div class="group-title">
Item Group 1
</div>
<div class="shop-items">
<div class="shop-item">
<img class="shop-item-image" src="images/item1.jpg">
<span class="shop-item-title">Item 1</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item2.jpg">
<span class="shop-item-title">Item 2</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item3.jpg">
<span class="shop-item-title">Item 3</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item4.jpg">
<span class="shop-item-title">Item 4</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item5.jpg">
<span class="shop-item-title">Item 5</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item6.jpg">
<span class="shop-item-title">Item 6</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item7.jpg">
<span class="shop-item-title">Item 7</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
<div class="shop-item">
<img class="shop-item-image" src="images/item8.jpg">
<span class="shop-item-title">Item 8</span>
<div class="shop-item-price">$10</div>
<div class="shop-item-details">
<button class="btn btn-primary btn-addtocart" type="button">ADD TO CART</button>
</div>
</div>
</section>
<footer class="main-footer">
<div class="container main-footer-container">
<img class="center-mini" src="images/banner.jpg">
</div>
</footer>
styles2.css:
#font-face {
font-family: "Courier New";
font-weight: normal;
font-style: normal;
}
* {
letter-spacing: 0.08em;
text-transform: uppercase;
font-weight: bold;
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Courier New", Courier, monospace;
color: white;
}
.imgbox {
display: grid;
height: 100%;
}
.center-stretch {
width: auto;
max-height: 100vh;
margin: auto;
}
.content-section {
margin: 1em;
}
.container {
width: auto;
max-width: 1200px;
margin: 0 auto;
padding: 0 1.5em;
}
.border {
border: 2px solid black;
}
.group-title {
margin-top: 10px;
font-weight: bold;
text-align: center;
color: black;
font-size: 2.5em;
}
.shop-items {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
.shop-item {
margin: 10px;
}
.shop-item-image {
height: 250px;
}
.shop-item-title {
font-size: 1.1em;
display: block;
flex-grow: 1;
color: black;
text-align: center;
margin: 5px
}
.shop-item-price {
display: block;
width: 100%;
text-align: center;
font-weight: bold;
font-size: 1.5em;
color: black;
}
.shop-item-details {
display: flex;
align-items: center;
justify-content: center;
padding: 5px;
}
.btn {
text-align: center;
vertical-align: middle;
padding: .2em .2em;
cursor: pointer;
}
.btn-primary {
color: #52A3FF;
border: 2px solid #52A3FF;
background-color: white;
padding: 0.5em 1.2em;
border-radius: 0em;
}
.btn-primary:hover {
background-color: #52A3FF;
color: white;
}
.btn-addtocart {
}
.main-footer {
background-color: #52A3FF;
color: white;
padding: .25em 0;
}
.main-footer-container {
display: flex;
align-items: center;
}
.center-mini {
width: 40%;
max-height: 100vh;
margin: auto;
}
I have a web page in HTML, with different page having some sections like below image
I need every sections to be of the same height, the first section in the image is perfect with the section only till the screen, but the second section in the 2nd image is a little below the screen like below
I need it to be like the first section, till the screen. My code:
body {
font-family: Montserrat;
}
/*.paddingTB60 {padding:100px 0px 60px 0px;}*/
.gray-bg {
background: #F1F1F1 !important;
margin-top: -11vh;
padding: 19.7vh;
}
p {
overflow: hidden;
color: #0a2240;
text-align: center-left;
font-size: 12pt;
font-weight: 600;
word-spacing: 2px;
}
.para1 {
overflow: hidden;
color: #0a2240;
text-align: center-left;
font-size: 12pt;
font-weight: 600;
word-spacing: 2px;
margin-left: -2.5vh;
}
.paddingTBB {
padding-top: 95px;
padding-bottom: 30px;
}
.paddingTB {
margin-top: 50px;
}
.paddingTBq {
margin-top: 50px;
}
.paddingTBq2 {
margin-top: 100px;
}
<div id="backtop">▲</div>
<div id="zub" class="about-section paddingTB60 gray-bg">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-xs-12">
<div class=" about-title clearfix">
<div class="col-md-5 col-sm-5 how-img text-center">
<img src="img/teamweserve.png" class="img-fluid" alt="" />
</div>
<div class="col-md-7 col-sm-7">
<h1 class="tws">TEAMS WE SERVE</h1><br>
<p class="para1">CEOs face incessant barrage of “go to cloud”, “go digital”.</p>
<p class="para1">CFOs are under tremendous pressure to free-up or find capital in legacy IT to invest in digital, IT modernization.</p>
<p class="para1">CIOs/CTOs are in uneviable position to maintain legacy IT while transforming business for digital, cloud.</p>
<p class="para1">HR is struggling with talent and skills shortage.</p>
<p class="para1">Functional heads are under pressure to show results fast, and unknowingly give out critical information to suppliers.</p>
<p class="para1">Procurement/Sourcing are handed situations after the damage has been done by the organizational silos.</p>
</div>
</div>
</div>
<div class="login" id="theFormID1" action="">
<button type="submit" class="btn btn-warning" id="submit_on1" onclick="window.location.href='setupdiscussion.php'">SET UP A DISCUSSION</button>
</div>
</div>
</div>
</div>
How do I make it like that, can anyone help me?
Change this:
.gray-bg {
background: #F1F1F1 !important;
margin-top: -11vh;
padding: 19.7vh;
}
to
.gray-bg {
background: #F1F1F1 !important;
margin-top: -11vh;
padding: 19.7vh;
height: 900px;
overflow: hidden;
}
If you want to have a different height just change height: 900px; to height: what you want; and make sure that every grey section has the class gray-bg. You also might want to add overflow: hidden; to ensure that no content spills out of the div.
Snippet:
body {
font-family: Montserrat;
}
/*.paddingTB60 {padding:100px 0px 60px 0px;}*/
.gray-bg {
background: #F1F1F1 !important;
margin-top: -11vh;
padding: 19.7vh;
height: 900px;
overflow: hidden;
}
p {
overflow: hidden;
color: #0a2240;
text-align: center-left;
font-size: 12pt;
font-weight: 600;
word-spacing: 2px;
}
.para1 {
overflow: hidden;
color: #0a2240;
text-align: center-left;
font-size: 12pt;
font-weight: 600;
word-spacing: 2px;
margin-left: -2.5vh;
}
.paddingTBB {
padding-top: 95px;
padding-bottom: 30px;
}
.paddingTB {
margin-top: 50px;
}
.paddingTBq {
margin-top: 50px;
}
.paddingTBq2 {
margin-top: 100px;
}
<div id="backtop">▲</div>
<div id="zub" class="about-section paddingTB60 gray-bg">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-xs-12">
<div class=" about-title clearfix">
<div class="col-md-5 col-sm-5 how-img text-center">
<img src="img/teamweserve.png" class="img-fluid" alt="" />
</div>
<div class="col-md-7 col-sm-7">
<h1 class="tws">TEAMS WE SERVE</h1><br>
<p class="para1">CEOs face incessant barrage of “go to cloud”, “go digital”.</p>
<p class="para1">CFOs are under tremendous pressure to free-up or find capital in legacy IT to invest in digital, IT modernization.</p>
<p class="para1">CIOs/CTOs are in uneviable position to maintain legacy IT while transforming business for digital, cloud.</p>
<p class="para1">HR is struggling with talent and skills shortage.</p>
<p class="para1">Functional heads are under pressure to show results fast, and unknowingly give out critical information to suppliers.</p>
<p class="para1">Procurement/Sourcing are handed situations after the damage has been done by the organizational silos.</p>
</div>
</div>
</div>
<div class="login" id="theFormID1" action="">
<button type="submit" class="btn btn-warning" id="submit_on1" onclick="window.location.href='setupdiscussion.php'">SET UP A DISCUSSION</button>
</div>
</div>
</div>
</div>
You can create a common class with the height whatever you want and add that class to all sections.
I have a group of three columns. Inside each column is the following:
A small circular div, which contains a font-awesome icon.
A small heading tag
Another div, which contains some text and a button.
I have been having issues with getting the third item to be an equal height with each other. I also need the buttons to be on the same height as well. I understand how to make divs the same height (shown here!)
However, I cannot get these divs to be of an equal height, and with the button to be in the same position. Here is the HTML code:
<div class="container-fluid">
<div class="row justify-content-center h-100">
<div class="col-3">
<div class="circleAboutUs">
<i class="fas fa-user-astronaut fa-5x" style="color: white; padding-top: 25px; padding-left: 34px;"></i>
</div>
<h1 class="about-us-text">Hackers</h1>
<div class="about-us-content-container">
<div class="about-us-content-text">
The early registration deadline is October 15th and regular registration closes November 3rd.
For more information check out the FAQ!
</div>
<button class="about-us-button" type="button"><h2>Register</h2></button>
</div>
</div>
<div class="col-3">
<div class="circleAboutUs">
<i class="fab fa-reddit-alien fa-5x" style="color: white; padding-top: 30px; padding-left: 28px"></i>
</div>
<h1 class="about-us-text">Mentors</h1>
<div class="about-us-content-container">
<div class="about-us-content-text">
Interested in volunteering to help our hackers the day of the event?
Sign up here to be a mentor for Codestellation.
</div>
<button class="about-us-button" type="button"><h2>Sign Up</h2></button>
</div>
</div>
<div class="col-3">
<div class="circleAboutUs">
<i class="fas fa-space-shuttle fa-rotate-270 fa-5x" style="color: white; padding-right: 27px; padding-top: 14px; padding-bottom: 5px"></i>
</div>
<h1 class="about-us-text">Sponsors</h1>
<div class="about-us-content-container">
<div class="about-us-content-text">
Codestellation can’t take off without our sponsors!
Learn more about what perks you’ll recieve and how your partnership will contribute to the event.
</div>
<button class="about-us-button" type="button"><h2>Sponsor</h2></button>
</div>
</div>
</div>
Here is the CSS:
.circleAboutUs {
border: 3px solid #FAA880;
margin: 0 auto;
border-radius: 100%;
height: 140px;
width: 140px;
background-color: #FAA880;
}
.about-us-content-container {
margin: auto;
border-radius: 10%;
background-color: #FAA880;
text-align: center;
margin-bottom: 60px;
}
.about-us-content-text {
font-family: 'Mina', 'Montserrat', monospace;
padding: 25px 25px;
font-size: 2em;
}
.about-us-text {
text-align: center;
color: #3A318C;
font-family: 'Mina', 'Montserrat', monospace;
font-weight: bold;
padding-top: 10px;
padding-bottom: 10px;
}
.about-us-button {
border-radius: 20%/50%;
border: 1px solid black;
text-align: center;
font-family: 'Mina', 'Montserrat', monospace;
font-weight: bold;
color: #3A318C;
margin-bottom: 10px;
padding-top:10px;
}
.about-us-button:hover {
cursor: pointer;
background-color: white;
}
.col-sm > .about-us-content-container {
height: 55px;
}
It currently looks this: Example
I want it to maintain its responsiveness, so the header and the div still stack nicely on mobile.
This behavior can be easily achieved by using flex box.
First, we create div wrapper for every child of all the columns in bootstrap.
We set the height of those children to 100% in order to make them fill the whole containers.
Then, we set flex-grow: 1 so the about-us-content-container will fill the whole container including spare spaces.
But now about-us-content-container will have an auto margin, which prevents it from filling the whole container. So, we have to set the margin to 0.
The about-us-content-container now fills all the spaces. But the button is still not at the bottom. We can get this by doing the same thing
Setting display to flex.
Setting flex-grow of the about-us-content-text to 1.
The buttons are now filling the whole width of about-us-content-container now. To avoid this, wrap a div around the buttons.
Here is the solution in Codepen: https://codepen.io/anhanhvina/pen/WKmoWQ
Below is the code that works. You can now add more classes to make it responsive.
.col-3 > div {
display: flex;
flex-direction: column;
height: 100%;
}
.about-us-content-container {
flex-grow: 1;
display: flex;
flex-direction: column;
margin: 0 !important;
}
.about-us-content-text {
flex-grow: 1;
}
.circleAboutUs {
border: 3px solid #FAA880;
margin: 0 auto;
border-radius: 100%;
height: 140px;
width: 140px;
background-color: #FAA880;
}
.about-us-content-container {
margin: auto;
border-radius: 10%;
background-color: #FAA880;
text-align: center;
margin-bottom: 60px;
}
.about-us-content-text {
font-family: 'Mina', 'Montserrat', monospace;
padding: 25px 25px;
font-size: 2em;
}
.about-us-text {
text-align: center;
color: #3A318C;
font-family: 'Mina', 'Montserrat', monospace;
font-weight: bold;
padding-top: 10px;
padding-bottom: 10px;
}
.about-us-button {
border-radius: 20%/50%;
border: 1px solid black;
text-align: center;
font-family: 'Mina', 'Montserrat', monospace;
font-weight: bold;
color: #3A318C;
margin-bottom: 10px;
padding-top:10px;
}
.about-us-button:hover {
cursor: pointer;
background-color: white;
}
.col-sm > .about-us-content-container {
height: 55px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.2/css/bootstrap.min.css" rel="stylesheet" />
<div class="container-fluid">
<div class="row justify-content-center h-100">
<div class="col-3">
<div>
<div class="circleAboutUs">
<i class="fas fa-user-astronaut fa-5x" style="color: white; padding-top: 25px; padding-left: 34px;"></i>
</div>
<h1 class="about-us-text">Hackers</h1>
<div class="about-us-content-container">
<div class="about-us-content-text">
The early registration deadline is October 15th and regular registration closes November 3rd. For more information check
out the FAQ!
</div>
<div>
<button class="about-us-button" type="button">
<h2>Register</h2>
</button>
</div>
</div>
</div>
</div>
<div class="col-3">
<div>
<div class="circleAboutUs">
<i class="fab fa-reddit-alien fa-5x" style="color: white; padding-top: 30px; padding-left: 28px"></i>
</div>
<h1 class="about-us-text">Mentors</h1>
<div class="about-us-content-container">
<div class="about-us-content-text">
Interested in volunteering to help our hackers the day of the event? Sign up here to be a mentor for Codestellation.
</div>
<div>
<button class="about-us-button" type="button">
<h2>Sign Up</h2>
</button>
</div>
</div>
</div>
</div>
<div class="col-3">
<div>
<div class="circleAboutUs">
<i class="fas fa-space-shuttle fa-rotate-270 fa-5x" style="color: white; padding-right: 27px; padding-top: 14px; padding-bottom: 5px"></i>
</div>
<h1 class="about-us-text">Sponsors</h1>
<div class="about-us-content-container">
<div class="about-us-content-text">
Codestellation can’t take off without our sponsors! Learn more about what perks you’ll recieve and how your partnership
will contribute to the event.
</div>
<div>
<button class="about-us-button" type="button">
<h2>Sponsor</h2>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
I have an overview page with tiles and I use the matchheight library to dynamically determine the height of a row. Now I would like to align the 'more' buttons at the bottom of the div so that it doesn't look as messy as in the screenshot on smaller screens.
I tried making the button "position: absolute" with "bottom: 20px" and "left: 40%" but that causes problems with responsiveness. On some resolutions that's okay, but on other's the button is too far to the right.
Can I solve this in a nice way without having to use the media attribute for each resolution?
/* Block: Overview */
#overview {
padding-top: 50px;
width: 100%;
}
.overview {
text-align: center;
padding-bottom: 50px;
}
.overview img {
width: 100%;
vertical-align: middle;
padding-bottom: 30px;
}
.card-title {
text-align: center;
letter-spacing: -1px;
font-weight: 600;
font-size: 20px;
}
.card-subtitle {
margin-bottom: 0;
font-style: italic;
font-weight: 400;
font-size: 15px;
font-family: "Lora", serif;
color: #cccccc;
margin-top: -1rem;
line-height: 1.7857;
padding-bottom: 1rem;
text-align: center;
}
.btn-card {
background-color: #cccccc;
border-color: #404040;
color: #404040;
letter-spacing: 2px;
padding: 10px 20px;
horiz-align: center;
position: relative;
margin-bottom: 0;
}
.btn-card:hover {
background-color: #ffffff;
color: #404040;
border-color: #404040;
letter-spacing: 2px;
padding: 10px 20px;
}
<div class="col-sm-3 overview row-eq-height">
<div class="col-sm-12 text-center wow fadeInLeft">
<img alt="Heavy Entertainment Show" src="/images/discography/the-heavy-entertainment-show-1.jpg">
</div>
<h3 class="card-title">Heavy Entertainment Show</h3>
<h4 class="card-subtitle">November 4<sup>th</sup>, 2016</h4>
<a href="/album/the-heavy-entertainment-show/" title="Show details of Heavy Entertainment Show">
<button class="btn btn-card">MORE</button>
</a>
</div>
<div class="col-sm-3 overview row-eq-height">
<div class="col-sm-12 text-center wow fadeInLeft">
<img alt="Under the Radar Vol 1" src="/images/discography/under-the-radar-vol-1-1.jpg">
</div>
<h3 class="card-title">Under the Radar Vol 1</h3>
<h4 class="card-subtitle">December 1<sup>st</sup>, 2014</h4>
<a href="/album/under-the-radar-vol-1/" title="Show details of Under the Radar Vol 1">
<button class="btn btn-card">MORE</button>
</a>
</div>
<div class="col-sm-3 overview row-eq-height">
<div class="col-sm-12 text-center wow fadeInLeft">
<img alt="Swings Both Ways" src="/images/discography/swings-both-ways-1.jpg">
</div>
<h3 class="card-title">Swings Both Ways</h3>
<h4 class="card-subtitle">November 18<sup>th</sup>, 2013</h4>
<a href="/album/swings-both-ways/" title="Show details of Swings Both Ways">
<button class="btn btn-card">MORE</button>
</a>
</div>
<div class="col-sm-3 overview row-eq-height">
<div class="col-sm-12 text-center wow fadeInLeft">
<img alt="Take the Crown" src="/images/discography/take-the-crown-1.jpg">
</div>
<h3 class="card-title">Take the Crown</h3>
<h4 class="card-subtitle">November 2<sup>nd</sup>, 2012</h4>
<a href="/album/take-the-crown/" title="Show details of Take the Crown">
<button class="btn btn-card">MORE</button>
</a>
</div>
This is the correct solution, adding a "transform:translateX(-50%);" for alignment. Thanks for the help!
.btn-card {
background-color: #cccccc;
border-color: #404040;
color: #404040;
letter-spacing: 2px;
padding: 10px 20px;
position: absolute;
bottom: 0;
left: 50%;
transform:translateX(-50%);
margin-bottom: 20px;
I'm currently trying to implement the design you see below:
Everything is working except for the size of the input field and the button. I'm using Boostrap.
HTML:
<div className='jumbotron text-center'>
<div className='container'>
<h1 id='hero-questions-h1'>What’s your name?</h1>
</div>
<div className='container'>
<div class="col-sm-4 text-center">
<div className="form-group input-group-lg">
<input type="text" className="form-control"></input>
</div>
<button type="button" id="continue-btn" className="btn btn-success btn-block">Continue</button>
</div>
</div>
<div className='container'>
<h2 id='tip'>
Tip! You will get motivational playlists, stories, posters and much more
</h2>
</div>
<footer className="footer">
<div className="container">
<p id="social-proof" className="text-center">“Must have for every ambitious athlete!”</p>
<p id="social-proof-tagline" className="text-center">Anders Hasselstrøm, Deca Ironman (10x)</p>
</div>
</footer>
</div>
CSS:
.jumbotron {
height: 100vh;
margin-bottom: 0px !important;
background-image: url("bg-hero-v2.png");
background-size: cover;
}
#hero-h1 {
color: white;
font-family: 'Roboto', sans-serif;
font-weight: 700;
font-size: 60px;
padding-top: 10%;
}
#hero-h2 {
color: #ECECEC;
font-family: 'Roboto', sans-serif;
font-weight: 300;
font-size: 20px;
margin-top: 30px;
line-height: 40px;
padding-bottom: 40px;
}
#hero-questions-h1 {
color: white;
font-family: 'Roboto', sans-serif;
font-weight: 700;
font-size: 60px;
padding-top: 10%;
padding-bottom: 30px;
}
.btn-success {
background-color: #66B878 !important;
}
.form-control {
background-color: transparent !important;
color: white !important;
}
#signup-btn {
padding-left: 40px;
padding-right: 40px;
padding-top: 15px;
padding-bottom: 15px;
}
#continue-btn {
height: 60px;
font-size: 18px;
}
#social-proof {
color: white;
font-family: 'Roboto', sans-serif;
font-weight: 500;
font-size: 18px;
font-style: italic;
}
#social-proof-tagline {
color: white;
font-family: 'Roboto', sans-serif;
font-weight: 100;
font-size: 16px;
}
#tip {
color: #ECECEC;
font-family: 'Roboto', sans-serif;
font-weight: 300;
font-size: 16px;
margin-top: 30px;
}
.footer {
padding-top: 20px;
padding-bottom: 20px;
position: fixed;
bottom: 0;
width: 100%;
background-color: black;
opacity: 0.6;
}
As you can see my current implementation looks like this:
DOM Elements use class instead of className to allocate CSS classes (You may have this confused with the JS .className property). To position the fields how you'd like, i would suggest taking advantage of the bootstrap grid col-x-offset-x options to position the column offset from the left side of the .row
For correct positioning, remember to place a .row element around your columns, and between the .container. Also, input elements are self-closing (ie. you dont need the trailing </input>)
HTML
<div class='jumbotron text-center'>
<div class='container'>
<h1 id='hero-questions-h1'>What’s your name?</h1>
</div>
<div class='container'>
<div class="row">
<div class="col-sm-offset-3 col-sm-6 text-center">
<div class="form-group input-group-lg">
<input type="text" class="form-control" />
</div>
<button type="button" id="continue-btn" class="btn btn-success btn-block">Continue</button>
</div>
</div>
</div>
<div class='container'>
<h2 id='tip'>
Tip! You will get motivational playlists, stories, posters and much more
</h2>
</div>
<footer class="footer">
<div class="container">
<p id="social-proof" class="text-center">“Must have for every ambitious athlete!”</p>
<p id="social-proof-tagline" class="text-center">Anders Hasselstrøm, Deca Ironman (10x)</p>
</div>
</footer>
</div>
JSFIDDLE
I was just working with bootstrap now and I had the same problem. In place of:
<div className='container'>
<div class="col-sm-4 text-center">
<div className="form-group input-group-lg">
<input type="text" className="form-control"></input>
</div>
<button type="button" id="continue-btn" className="btn btn-success btn-block">Continue</button>
</div>
</div>
Try this:
<div className='container'>
<div class="col-sm-4">
</div>
<div class="col-sm-4 text-center">
<div className="form-group input-group-lg">
<input type="text" className="form-control"></input>
</div>
<button type="button" id="continue-btn" className="btn btn-success btn-block">Continue</button>
</div>
<div class="col-sm-4">
</div>
The extra class with col-sm-4 will structure the divs in the correct order.
<div class="col-sm-4">
</div>
The is optional but I found that it helped me.