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>
Related
I wanted the feature-list div on the next lint of image-computer but only at width 768px it doesn't go on the next line. For better understanding I have attached screenshot of desired result an actual result photo for reference. Please give me a better solution for this.
body {
background-image: url("images/bg-header-desktop.png");
background-size: contain;
background-repeat: no-repeat;
font-size: 18px;
font-family: 'Bai Jamjuree', sans-serif;
padding: 9% 0 0 0;
line-height: 1.5;
margin: 0;
}
p {
color: hsl(201, 11%, 66%);
}
h1,
h3,
h5,
h2 {
color: hsl(210, 10%, 33%);
font-weight: 600;
}
button {
margin-top: 1.25rem;
}
.btn-ios {
border: 0;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 25px;
color: #FFFFFF;
font-size: 18px;
font-weight: 100;
padding: 10px 35px;
background-color: #26BAA4;
-webkit-box-shadow: -1px 7px 15px -3px #35D9BD;
-moz-box-shadow: -1px 7px 15px -3px #35D9BD;
box-shadow: -1px 7px 15px -3px #35D9BD;
text-decoration: none;
display: inline-block;
cursor: pointer;
text-align: center;
}
.btn-ios:hover {
background: #35D9BD;
border: solid #35D9BD 0;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 25px;
text-decoration: none;
}
.btn-mac {
border: 0;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 25px;
color: #FFFFFF;
font-size: 18px;
font-weight: 100;
padding: 10px 35px;
background-color: #6173FF;
-webkit-box-shadow: -1px 7px 15px -3px #7585FC;
-moz-box-shadow: -1px 7px 15px -3px #7585FC;
box-shadow: -1px 7px 15px -3px #7585FC;
text-decoration: none;
display: inline-block;
cursor: pointer;
text-align: center;
}
.btn-mac:hover {
background: #7585FC;
border: solid #7585FC 0;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 25px;
text-decoration: none;
}
.ios {
text-align: right;
}
.mac {
text-align: left;
}
.snippets {
margin-top: 5rem;
}
footer {
background-color: #f2f2f2;
margin-top: 5rem;
padding: 0 10%;
}
/* title */
#title {
text-align: center;
}
.para {
padding: 1% 24%;
}
.logo {
margin-bottom: 2.75rem;
}
/* features */
#features {
margin-top: 4rem;
}
.feature-list {
padding-left: 1rem;
padding-right: 17%;
}
.feature-list-div {
}
.center-feature {
text-align: center;
}
.clipboard {
margin-top: 8rem;
}
.image-computer {
position: relative;
right: 30px;
width: 93%;
}
.image-devices {
margin: 6rem auto 0 auto;
display: block;
width: 80%;
}
.feature-second {
text-align: center;
padding: 3% 10% 10% 10%;
}
.sponsers {
text-align: center;
padding: 0 10% 10% 10%;
}
/* cta */
#cta {
text-align: center;
}
/* footer */
.footer-logo {
width: 45%;
}
.footer-row {
padding-top: 3rem;
padding-bottom: 3rem;
}
.link {
text-decoration: none;
color: hsl(210, 10%, 33%);
}
.link:hover {
color: hsl(171, 66%, 44%);
}
.first-footer {
margin-bottom: 1.2rem;
display: block;
}
.social-icon {
text-align: right;
padding-top: 2rem;
}
.fb-icon:hover,
.twitter-icon:hover,
.insta-icon:hover {
color: hsl(171, 66%, 44%);
}
.fb-icon {
margin-right: 1rem;
}
.twitter-icon {
margin-right: 1rem;
}
.attribution {
font-size: 11px;
text-align: center;
margin-bottom: 0;
position: relative;
bottom: 5px;
}
.attribution a {
color: hsl(228, 45%, 44%);
}
#media (max-width: 970px) {
.feature-list{
padding-right: 10%;
}
}
#media (max-width: 768px) {
.feature-list{
text-align: center;
}
.image-computer{
text-align: center;
display: block;
position: static;
margin: auto;
width: 100%;
}
}
#media (max-width: 376px) {
body {
padding: 25% 12% 0 12%;
}
.para {
padding: 1rem 0 0 0;
}
.ios {
text-align: center;
}
.mac {
text-align: center;
}
}
<body>
<section id="title">
<img class="logo" src="images/logo.svg" alt="logo">
<h1 class="heading">A history of everything you copy</h1>
<p class="para">Clipboard allows you to track and organize everything you copy. Instantly access your clipboard on all your devices.</p>
<div class="container-fluid">
<div class="row">
<div class="col ios">
<button class="btn-ios" type="button" name="button">Download for iOS</button>
</div>
<div class="col mac">
<button class="btn-mac" type="button" name="button">Download for Mac</button>
</div>
</div>
</div>
<h1 class="snippets">Keep track of your snippets</h1>
<p class="para">Clipboard instantly stores any item you copy in the cloud,
meaning you can access your snippets immediately on all your devices. Our Mac and iOS apps will help you organize everything.</p>
</section>
<section id="features">
<div class="container-fluid">
<div class="row imac g-0">
<div class="col-xl-6 col-lg-6 col-md-6 col-sm-12">
<img class="image-computer" src="images/image-computer.png" alt="image-computer">
</div>
<div class="col-xl-6 col-lg-6 col-md-6 col-sm-12 feature-list">
<div class="feature-list-div">
<h3>Quick Search</h3>
<p>Easily search your snippets by content, category, web address, application, and more.</p>
<h3>iCloud Sync</h3>
<p>Instantly saves and syncs snippets across all your devices.</p>
<h3>Complete History</h3>
<p>Retrieve any snippets from the first moment you started using the app.</p>
</div>
</div>
</div>
</div>
<h1 class="center-feature clipboard">Access Clipboard anywhere</h1>
<p class="center-feature para">Whether you’re on the go, or at your computer, you can access all your Clipboard snippets in a few simple clicks.</p>
<img class="image-devices" src="images/image-devices.png" alt="image-devices">
<h3 class="center-feature">Supercharge your workflow</h3>
<p class="center-feature para">We’ve got the tools to boost your productivity.</p>
<div class="container-fluid feature-second">
<div class="row">
<div class="col">
<img class="icon-feature" src="images/icon-blacklist.svg" alt="icon-blacklist">
<h5>Create blacklists</h5>
<p>Ensure sensitive information never makes its way to your clipboard by excluding certain sources.</p>
</div>
<div class="col">
<img class="icon-feature" src="images/icon-text.svg" alt="icon-text">
<h5>Plain text snippets</h5>
<p>Remove unwanted formatting from copied text for a consistent look.</p>
</div>
<div class="col">
<img class="icon-feature" src="images/icon-preview.svg" alt="icon-preview">
<h5>Sneak preview</h5>
<p>Quick preview of all snippets on your Clipboard for easy access.</p>
</div>
</div>
</div>
</section>
<div class="container-fluid sponsers">
<div class="row">
<div class="col-sm">
<img class="google" src="images/logo-google.png" alt="logo-google">
</div>
<div class="col-sm">
<img class="ibm" src="images/logo-ibm.png" alt="logo-ibm">
</div>
<div class="col-sm">
<img class="microsoft" src="images/logo-microsoft.png" alt="logo-microsoft">
</div>
<div class="col-sm">
<img class="hp" src="images/logo-hp.png" alt="logo-hp">
</div>
<div class="col-sm">
<img class="vector-graphics" src="images/logo-vector-graphics.png" alt="logo-vector-graphics">
</div>
</div>
</div>
<section id="cta">
<h2>Clipboard for iOS and Mac OS</h2>
<p class="para">Available for free on the App Store. Download for Mac or iOS, sync with iCloud and you’re ready to start adding to your clipboard.</p>
<div class="container-fluid">
<div class="row">
<div class="col ios">
<button class="btn-ios" type="button" name="button">Download for iOS</button>
</div>
<div class="col mac">
<button class="btn-mac" type="button" name="button">Download for Mac</button>
</div>
</div>
</div>
</section>
<footer>
<div class="container-fluid">
<div class="row footer-row">
<div class="col">
<img class="footer-logo" src="images/logo.svg" alt="logo">
</div>
<div class="col">
<a class="first-footer link" href="#">FAQs</a>
<a class="link" href="#">Contact Us</a>
</div>
<div class="col">
<a class="first-footer link" href="#">Privacy Policy</a>
<a class="link" href="#">Press Kit</a>
</div>
<div class="col">
<a class="link" href="#">Install Guide</a>
</div>
<div class="col social-icon">
<i class="fab fa-facebook-square fb-icon fa-2x"></i>
<i class="fab fa-twitter twitter-icon fa-2x"></i>
<i class="fab fa-instagram insta-icon fa-2x"></i>
</div>
</div>
</div>
<p class="attribution">
Challenge by Frontend Mentor.
Coded by Mohak Goel.
</p>
</footer>
</body>
this is actual result screenshot
this is desired result screenshot
If you want your columns on smaller displays to be the full width of the display, use col-12 without a size. Then pick your width to switch to two columns half the width of the display and add the appropriate class as in col-md-6. That will give you one full width column from a smartphone up to a tablet (767px wide). On anything larger (more than 767px wide), you would have two columns, each half the display width.
<div class="container-fluid">
<div class="row imac g-0">
<div class="col-12 col-md-6">
<img class="image-computer" src="images/image-computer.png" alt="image-computer">
</div>
<div class="col-12 col-md-6 feature-list">
<div class="feature-list-div">
<h3>Quick Search</h3>
<p>Easily search your snippets by content, category, web address, application, and more.</p>
<h3>iCloud Sync</h3>
<p>Instantly saves and syncs snippets across all your devices.</p>
<h3>Complete History</h3>
<p>Retrieve any snippets from the first moment you started using the app.</p>
</div>
</div>
</div>
</div>
If you want your columns on smaller displays to be side-by-side and one column on wider (768px or more) displays, then you could use col-6 col-md-12
<div class="container-fluid">
<div class="row imac g-0">
<div class="col-6 col-md-12">
<img class="image-computer" src="images/image-computer.png" alt="image-computer">
</div>
<div class="col-6 col-md-12 feature-list">
<div class="feature-list-div">
<h3>Quick Search</h3>
<p>Easily search your snippets by content, category, web address, application, and more.</p>
<h3>iCloud Sync</h3>
<p>Instantly saves and syncs snippets across all your devices.</p>
<h3>Complete History</h3>
<p>Retrieve any snippets from the first moment you started using the app.</p>
</div>
</div>
</div>
</div>
I'm currently attempting to build a basic website using HTML, CSS and Javascript. However there's a specific part of this website that I'm having difficulty building. Here's what the section is meant to look like, with the part on the left being the part that's tripping me up the most. It's a section which is meant to contain four basic squares next to each other; Image 1 (linked earlier) provides a visual.
Here's an image of what I've currently managed to get: All four squares are present, but they're stacked on top of one another instead. I haven't been able to get much closer to it.
Here's the html code behind it:
<div class="top-large-left">
<h3 id="hot">Interaction</h3>
</div>
<div class="small-top-right">
<h3 id="item">Location</h3>
</div>
<div class="large-left-section">
<div>
<section class="left-section">
<div class="btn-group button">
<div class="button1">
<button type="button1">Display X, Y</button>
</div>
<div class="button2">
<button type="button2">Theme</button>
</div>
<div class="button3">
<button type="button3">Modal</button>
</div>
<div class="button4">
<button type="button4">Swap Image</button>
</div>
</section>
</div>
As well as the CSS:
.btn-group button {
background-color: #428bca;
border-radius: 5px;
font-weight: bold;
font-size: 15px;
color: white;
padding: 32px 19px;
cursor: pointer;
display: inline-block;
margin: 2px 2px;
border: 1px;
text-align: center;
line-height: 25px;
}
.button1 {
width: 130px;
}
.button2 {
width: 130px;
}
.button3 {
width: 130px;
}
.button4 {
width: 130px;
}
How would I be able to achieve what is being shown in the first image? Is the css-grid function what I need to use, or something else? Feel free to say if I need to provide any more information, thanks.
Flex is your solution here. Flex makes your life easier.
Run the snippet on full window. (Full page)
.top-large-left {
background-color: #428bca;
padding: 0 1rem;
}
.top-large-left h3 {
margin:0;
}
.wrapper {
display:flex;
flex-direction:row;
}
.large-left-section,
.large-right-section{
flex: 1 1 50%;
border: 10px solid lightgrey;
text-align: center;
margin:5px;
}
.btn-group button {
background-color: #428bca;
border-radius: 5px;
font-weight: bold;
font-size: 15px;
color: white;
padding: 32px 19px;
cursor: pointer;
display: inline-block;
margin: 2px 2px;
border: 1px;
text-align: center;
line-height: 25px;
}
.large-left-section .left-section .btn-group.button{
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
}
.large-left-section .left-section .btn-group.button .btn {
flex: 0 0 45%;
margin:5px;
}
.large-left-section .left-section .btn-group.button .btn button {
width:100%;
}
<div class="top-large-left">
<h3 id="hot">Interaction</h3>
</div>
<div class="wrapper">
<div class="large-left-section">
<section class="left-section">
<div class="btn-group button">
<div class="btn button1">
<button type="button1">Display X, Y</button>
</div>
<div class="btn button2">
<button type="button2">Theme</button>
</div>
<div class="btn button3">
<button type="button3">Modal</button>
</div>
<div class="btn button4">
<button type="button4">Swap Image</button>
</div>
</div>
</section>
</div>
<div class="large-right-section">
</div>
</div>
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.
In my header I have 4 elements which are:
"Running Days" - "admin#email.com" - "Deposit" - "Paidout".
My 4 elements are separated into 2.
"Deposit" and "Paidout" are in right in my header.
I made a float:right!
Except that the order is inverted namely I have "Paidout" before "Deposit".
header {
width: 100%;
height: 38px;
background-color: #CEECE8;
}
.subtitles {
font-size: 13px;
font-family: 'Roboto Slab', serif;
padding-top: 8px;
padding-left: 80px;
padding-right: 80px;
text-transform: uppercase;
}
.subtile-left {
display: inline-block;
padding-left: 18px;
}
.subtile-right {
display: inline-block;
padding-left: 18px;
float: right;
}
<header>
<div class="subtitles">
<div class="subtile-left"><i class="far fa-calendar"></i> 137 Running Days </div>
<div class="subtile-left"><i class="far fa-envelope"></i> Admin#superbtc.biz </div>
<div class="subtile-right"><i class="fas fa-caret-right"></i> Deposit </div>
<div class="subtile-right"><i class="fas fa-caret-right"></i> Paidout </div>
</div>
</header>
Use float:left with the left elements instead and adjust text-align to align the other to the right:
header {
width: 100%;
height: 38px;
background-color: #CEECE8;
}
.subtitles {
font-size: 13px;
font-family: 'Roboto Slab', serif;
padding-top: 8px;
padding-left: 80px;
padding-right: 80px;
text-transform: uppercase;
text-align:right;
}
.subtile-left {
display: inline-block;
padding-left: 18px;
float: left;
}
.subtile-right {
display: inline-block;
padding-left: 18px;
}
<header>
<div class="subtitles">
<div class="subtile-left"><i class="far fa-calendar"></i> 137 Running Days </div>
<div class="subtile-left"><i class="far fa-envelope"></i> Admin#superbtc.biz </div>
<div class="subtile-right"><i class="fas fa-caret-right"></i> Deposit </div>
<div class="subtile-right"><i class="fas fa-caret-right"></i> Paidout </div>
</div>
</header>
A better way would be to consider flexbox to avoid having the whitespace issue between inline-block elements:
header {
width: 100%;
height: 38px;
background-color: #CEECE8;
}
.subtitles {
font-size: 13px;
font-family: 'Roboto Slab', serif;
padding-top: 8px;
padding-left: 80px;
padding-right: 80px;
text-transform: uppercase;
display:flex;
}
.subtitles :nth-child(2) {
margin-right:auto;
}
.subtile-left {
padding-left: 18px;
}
.subtile-right {
padding-left: 18px;
}
<header>
<div class="subtitles">
<div class="subtile-left"><i class="far fa-calendar"></i> 137 Running Days </div>
<div class="subtile-left"><i class="far fa-envelope"></i> Admin#superbtc.biz </div>
<div class="subtile-right"><i class="fas fa-caret-right"></i> Deposit </div>
<div class="subtile-right"><i class="fas fa-caret-right"></i> Paidout </div>
</div>
</header>
Elements are floated in order of source appearance.
Check this example:
.container {
background-color: #ddd;
}
.container::after { /* clearfix */
display: block;
content: "";
clear: both;
}
[id] {
background-color: #f0f0f0;
border: 3px dotted #999;
text-align: center;
width: 2em;
}
#a {
float: right;
}
<div class="container">
<div id="a">A</div>
<div id="b">B</div>
<div id="c">C</div>
</div>
div#a floats right, which means it is moved as far to the right of its container as possible.
Now let's make div#b float to the right as well:
.container {
background-color: #ddd;
}
.container::after { /* clearfix */
display: block;
content: "";
clear: both;
}
[id] {
background-color: #f0f0f0;
border: 3px dotted #999;
text-align: center;
width: 2em;
}
#a,
#b {
float: right;
}
<div class="container">
<div id="a">A</div>
<div id="b">B</div>
<div id="c">C</div>
</div>
Now when the layout engine parses the layout, the first element that is floated is div#a (because it comes before div#b in the source), moving it to the very right side of div.container.
Next comes div#b, which is now also floated to the right. Since div#a is already taking space at the right side of div.container, div#b can only float until its right border touches the left border of div#a.
This obviously makes it so visual appearance of div#a and div#b is inverted compared to source order.
When the viewport is rendering the HTML it reads the elements from top bottom.
This means the following:
1) 'Deposit' is seen before 'Paidout' and thus is floated to the right part of the container div first
2) Paidout is seen and floats to the right, but bumps into deposit and thus finds its place to the left of it
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;