I'm not a good developer since I'm only a student. I'm trying to make a website for me but I can't align-items on my rows in bootstrap. I'm trying to do this:
1 but I'm stuck on this:
<div class="container-fluid">
<div class="row align-items-start">
<div class="col">
<div class="title">
Lorem Ipsum —<br>Interactive Media<br>Designer
</div>
</div>
</div>
<div class="row align-items-center">
<div class="col">
<ul class="link">
<li>About</li>
<li>Work</li>
<li>Experiments</li>
<li>Contact</li>
<li>Instagram</li>
<li>Behance</li>
</ul>
</div>
</div>
<div class="row align-items-end">
<div class="col">
<div class="footer">
All rights reserved© 1998—2019
</div>
</div>
</div>
</div>
Can someone help me?
The items just don't align like i want them to
For this to work you need to put every element in single row. You have 3 rows.
Imagine row like this
Every line represent single row. If you put content in one row element it will be displayed in single line. If you put in more rows content will be displayed in more rows.
So your code should look like this
<div class="container-fluid">
<div class="row align-items-start">
<div class="col">
<div class="title">
Lorem Ipsum —<br>Interactive Media<br>Designer
</div>
</div>
<div class="col">
<ul class="link">
<li>About</li>
<li>Work</li>
<li>Experiments</li>
<li>Contact</li>
<li>Instagram</li>
<li>Behance</li>
</ul>
</div>
<div class="col">
<div class="footer">
All rights reserved© 1998—2019
</div>
</div>
</div>
</div>
If this doesn't help then I didn't understood you correctly so come back here so we can fix it :)
UPDATE
Based on new info I got this should be new solution
<div class="container-fluid top">
<div class="row align-items-start">
<div class="col">
<div class="title">
Lorem Ipsum —<br>Interactive Media<br>Designer
</div>
</div>
</div>
</div>
<div class="container-fluid center">
<div class="row align-items-center">
<div class="col">
<ul class="link">
<li>About</li>
<li>Work</li>
<li>Experiments</li>
<li>Contact</li>
<li>Instagram</li>
<li>Behance</li>
</ul>
</div>
</div>
</div>
<div class="container-fluid bottom">
<div class="row align-items-end">
<div class="col">
<div class="footer">
All rights reserved© 1998—2019
</div>
</div>
</div>
</div>
.top {
position: aboslute;
top: 0;
}
.center {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.bottom {
position: absolute;
bottom: 0;
}
align-items property depends on the height row. For this you can set height for row
Related
Thanks in advance for your help!
I work in bootstrap 4 building websites, I'm trying to build the following design:
I can't get my head round how it will work! At the moment I have the whole box set to container-fluid so there isn't any padding/margins applied but I don't understand how I can structure the columns to get it to work.
Here's my HTML for what I have tried so far:
<div class="container-fluid">
<div class="row">
<div class="col-12">
<h3 class="mega-menu-heading">About</h3>
</div>
<div class="col-sm-3 g-pa-0">
<ul class="list-unstyled style-list">
<li class="serviceAbout">[insert] </li>
<li class="serviceAbout">[insert]</li>
</ul>
</div>
<div class="col-sm-3 g-pa-0">
<ul class="list-unstyled style-list">
<li class="serviceAbout">[insert] </li>
<li class="serviceAbout">[insert] </li>
</ul>
</div>
<div class="col-sm-3 g-pa-0">
<ul class="list-unstyled style-list">
<li class="serviceAbout">[insert] </li>
<li class="serviceAbout">[insert] </li>
</ul>
</div>
<div class="col-sm-3 g-pa-0">
<img class="img-responsive g-pa-0 g-ma-0" src="/assets/images/misc/nav-image.jpg">
</div>
<!--/end row-->
</div>
</div>
I understand that the col-12 is taking up all the available space in the container so I cannot have an image full height of the container but I'm not sure what other way I can do it.
Any help would be appreciated, this must be possible I'm probably just missing something!
Thanks,
You could create a first row having 2 columns : col-sm-9 and col-sm-3.
Then create another row in the col-sm-9 to list your services and use the col-sm-3 to display your image.
div {
text-align: center;
background-color: rgba(86,61,124,.15);
border: 1px solid rgba(86,61,124,.2);
}
.bgimg {
background-image: url('https://mdn.mozillademos.org/files/7693/catfront.png');
background-size: contain;
background-repeat: no-repeat;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="container-fluid">
<div class="row">
<div class="col-sm-9">
<div class="row">
<div class="col-sm-12">Our services</div>
<div class="col-sm-4">Service 1</div>
<div class="col-sm-4">Service 2</div>
<div class="col-sm-4">Service 3</div>
<div class="col-sm-4">Service 4</div>
<div class="col-sm-4">Service 5</div>
<div class="col-sm-4">Service 6</div>
</div>
</div>
<div class="col-sm-3 bgimg">
Image full-height
</div>
</div>
</div>
You can use bootstrap grid systems. Use container, row and col pattern.
To understand it better go to this link.
Try this code structure:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.1/dist/css/bootstrap.min.css">
<div class="container text-center">
<div class="row">
<div class="col-9">
<div class="row">Our Services</div>
<div class="row">
<div class="col-4">Service 1</div>
<div class="col-4">Service 2</div>
<div class="col-4">Service 3</div>
</div>
<div class="row">
<div class="col-4">Service 4</div>
<div class="col-4">Service 5</div>
<div class="col-4">Service 6</div>
</div>
</div>
<div class="col-3">
<img src="https://source.unsplash.com/100x100/?documents" class="img" alt="img">
</div>
</div>
</div>
This question already has answers here:
How to place div side by side
(7 answers)
Closed 1 year ago.
<div class="container-fluid gradient">
<div class="row">
<div class="col-12 justify-content-start text-white">
<div class="footer mt-5">
<img
src="images/Vector Smart Object (Double Click to Edit).png"
class="img-fluid footer-logo"
alt=""
/>
<div class="left">
<ul class="mt-5">
<li>TEAM</li>
<li>COMPETITION</li>
<li>ABOUT US</li>
<li>CONTACT</li>
</ul>
</div>
<div class="right">
<ul>
<li>FAQ</li>
<li>POLICY PRIVACY</li>
<li>COOKIES</li>
</ul>
</div>
</div>
<div class="border-pink"></div>
<h4 class="mt-4 copy">COPYRIGHT</h4>
</div>
</div>
</div>
I want to put the ul next to each other so that they are side by side. I tried using inline-block and float left, but it looks messy.
.left{
position:absolute;
padding-left:200px;
}
<div class="container-fluid gradient">
<div class="row">
<div class="col-12 justify-content-start text-white">
<div class="footer mt-5">
<img
src="images/Vector Smart Object (Double Click to Edit).png"
class="img-fluid footer-logo"
alt=""
/>
<div class="left">
<ul class="mt-5">
<li>TEAM</li>
<li>COMPETITION</li>
<li>ABOUT US</li>
<li>CONTACT</li>
</ul>
</div>
<div class="right">
<ul>
<li>FAQ</li>
<li>POLICY PRIVACY</li>
<li>COOKIES</li>
</ul>
</div>
</div>
<div class="border-pink"></div>
<h4 class="mt-4 copy">COPYRIGHT</h4>
</div>
</div>
</div>
You can do it like this. This is one way.
i pretend to make this first column fixed, but when i add position:fixed, the columns overlap each other, how to fix this?
If its not possible, i want to know a sample that gives me a
side navbar fixed and responsive with bulma
<section class="main-content columns is-fullheight">
<aside class="column is-2 is-narrow-mobile is-fullheight section is-hidden-mobile">
<p class="menu-label is-hidden-touch">Header</p>
<ul class="menu-list">
<li>
CIT
<ul><li>Items</li><li>Items</li>
</ul>
</li>
<li>
Other
<ul>
<li>other</li>
</ul>
</li>
</ul>
</aside>
<div class="container column is-10">
<div class="section">
<div class="card">
<div class="card-header" id="go-first">
<p class="card-header-title">CIT</p>
</div>
<div class="card-content">
<div class="content">
header
</div>
<div class="columns">
<div class="column">
...
</div>
</div>
</div>
</div>
</div>
</div>
</section>
```
As I understood, your sidebar disappears on mobile, right?
Have you tried removing is-hidden-mobile class from aside element?
<section class="main-content columns is-fullheight">
<aside class="column is-2 is-narrow-mobile is-fullheight section">
<p class="menu-label is-hidden-touch">Header</p>
<ul class="menu-list">
<li>
CIT
<ul><li>Items</li><li>Items</li>
</ul>
</li>
<li>
Other
<ul>
<li>other</li>
</ul>
</li>
</ul>
</aside>
<div class="container column is-10">
<div class="section">
<div class="card">
<div class="card-header" id="go-first">
<p class="card-header-title">CIT</p>
</div>
<div class="card-content">
<div class="content">
header
</div>
<div class="columns">
<div class="column">
...
</div>
</div>
</div>
</div>
</div>
</div>
</section>
I'm working on a new site (Wordpress with a premium bought template). The template developer hasn't been able to solve this problem, so I'm hoping someone here might be able to help.
If you look at http://test.one.za.com/wp-test/?page_id=112 at the bottom of the page in Chrome, the 3 contact div's aren't aligned correctly. But if you look at this same page in IE or Firefox, it displays just fine.
For the life of me, I cannot figure out what this is or how to fix it.
Here's the CSS:
Main container for the footer:
.main-footer {
position: relative;
background-color: #303030;
overflow: hidden;
}
Here's the container for the "info section":
.main-footer .footer-info-section {
position: relative;
margin-top: -5px;
background-color: #303030;
border-top: 1px solid rgba(255,255,255,0.10);
border-left: 1px solid rgba(255,255,255,0.10);
border-right: 1px solid rgba(255,255,255,0.10);
}
Finally, the code for the divs inside the "info-section":
.main-footer .footer-info-section .info-block {
position: relative;
}
The HTML for the entire footer section:
<footer class="main-footer">
<!--Widgets Section-->
<div class="auto-container">
<div class="widgets-section">
<div class="row clearfix">
<div class="widget_text footer-column col-md-4 col-sm-6 col-xs-12">
<div class="widget_text footer-widget widget_custom_html" id="custom_html-2">
<h2>Test 1</h2>
<div class="textwidget custom-html-widget">sdgsfhdfgg sdfgs dfg sfg fgdgsdfg sdfg sdfg sdf</div>
</div>
</div>
<div class="footer-column col-md-4 col-sm-6 col-xs-12">
<div class="footer-widget widget_categories" id="categories-2">
<h2>Test 2</h2>
<ul>
<li class="cat-item cat-item-16">Home 2</li>
<li class="cat-item cat-item-1">Uncategorized</li>
</ul>
</div>
</div>
<div class="footer-column col-md-4 col-sm-6 col-xs-12">
<div class="footer-widget widget_recent_entries" id="recent-posts-2">
<h2>Test 3</h2>
<ul>
<li>1996</li>
<li>Hello world!</li>
</ul>
</div>
</div>
</div>
</div>
<!--Footer Info Section-->
<div class="footer-info-section">
<div class="row clearfix">
<!--Info Block-->
<div class="info-block col-md-4 col-sm-6 col-xs-12">
<div class="inner">
<div class="icon fa fa-glass"></div>
<h4>Contact 1</h4>
<div class="text">Contact 1</div>
</div>
</div>
<!--Info Block-->
<div class="info-block col-md-4 col-sm-6 col-xs-12">
<div class="inner">
<div class="icon fa fa-music"></div>
<h4>Contact 2</h4>
<div class="text">Contact 2</div>
</div>
</div>
<!--Info Block-->
<div class="info-block col-md-4 col-sm-6 col-xs-12">
<div class="inner">
<div class="icon fa fa-heart"></div>
<h4>Contact 3</h4>
<div class="text">Contact 3</div>
</div>
</div>
</div>
</div>
</div>
<!--Footer Bottom-->
<div class="footer-bottom">
<div class="auto-container">
<div class="row clearfix">
<div class="column col-md-6 col-sm-12 col-xs-12">
<div class="copyright">
ONE Insurance Underwriting Managers (PTY) LTD Reg No. 1996/008987/07 Authorised Financial Services Provider FSP8783 VAT No. 4370160501
</div>
</div>
<div class="nav-column col-md-6 col-sm-12 col-xs-12">
<ul class="footer-nav">
<!-- This is just where the foot-nav is located. Redacted this because the links and class names for those links are tediously long and makes this even harder to read -->
<li>Footer-nav 1</li>
<li>Footer-nav 2</li>
<li>Footer-nav 3</li>
</ul>
</div>
</div>
</div>
</div>
<!--End Footer Bottom-->
</footer>
I've attached a couple of snips showing how it's displayed in the respective browsers.
add clear:both to your code here:
.main-footer .footer-info-section{
clear:both;
}
My codepen: http://codepen.io/helloworld/pen/razoxg?editors=110
I have 3 rows with each 3 columns.
How can I give each row or all 3 columns the same fixed height so one tile is not larger than the other?
<div class="container-fluid">
<!-- Page Header -->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Electronics
</h1>
</div>
</div>
<!-- /.row -->
<!-- 1st Row -->
<div class="row">
<div class="col-xs-4">
<div class="panel industry-tile-medium">
<div class="panel-body">
<header>Customer</header>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-xs-6">
<img class="img-responsive" src="http://s16.postimg.org/tqs90puwl/customer.png"></img>
</div>
<div class="col-xs-6 col-bottom">
<ul class="list-group">
<li class="list-group-item ">Intel</li>
<li class="list-group-item ">Micron</li>
<li class="list-group-item ">Infineon</li>
<li class="list-group-item ">First Solar</li>
</ul>
</div>
</div>
</div>
</div>
<!-- /.panel -->
</div>
<div class="col-xs-4">
<div class="panel special-tile">
<div class="panel-body special-tile">
</div>
<div class="panel-footer special-tile">
<div class="row">
<div class="col-xs-3">
<img class="img-responsive" src="http://s7.postimg.org/agarkavmj/whoiswho.png"></img>
</div>
<div class="col-xs-9" >
<div class="row">
<div id="page-header" class="page-header">
<h4>Who is who
<p>
<small>Organization & Processes</small>
</p>
</h4>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<ul class="list-group">
<li class="list-group-item ">Org Charts </li>
<li class="list-group-item ">GAM / KAM Charts</li>
<li class="list-group-item ">Process flow</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.panel -->
</div>
<!-- /.col -->
<div class="col-xs-4">
<div class="panel industry-tile-medium">
<div class="panel-body">
<header>CEO Blog</header>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-xs-3">
<i style="color:orange;" class="fa fa-rss-square fa-5x"></i>
</div>
<div class="col-xs-9">
Lorem ipsum dolor sit amet, consetetur sadipscetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
</div>
</div>
</div>
</div>
<!-- /.panel -->
</div>
<!-- column -->
</div>
<!-- /.row -->
<!-- 2nd Row -->
<div class="row">
<div class="col-xs-4">
<div class="panel industry-tile-medium">
<div class="panel-body">
<header>On-going Projects & Webcam</header>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-xs-6">
<img class="img-responsive" src="http://s16.postimg.org/tqs90puwl/customer.png"></img>
</div>
<div class="col-xs-6 col-bottom">
<ul class="list-group">
<li class="list-group-item ">GF Project Malta</li>
<li class="list-group-item ">Intel Israel</li>
</ul>
</div>
</div>
</div>
</div>
<!-- /.panel -->
</div>
<!-- /.col -->
<div class="col-xs-4">
<div class="panel personal-tile-medium">
<div class="panel-body">
<header> Personal Links </header>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-xs-12">
<ul class="list-group">
<li class="list-group-item ">Org Charts</li>
<li class="list-group-item ">GAM / KAM Charts</li>
<li class="list-group-item ">Process flow</li>
</ul>
</div>
</div>
</div>
</div>
<!-- /.panel -->
</div>
<div class="col-xs-4">
<div class="row half-tile half-tile-top">
<div class="col-xs-6">
<img class="img-responsive" src="http://s16.postimg.org/tqs90puwl/customer.png"></img>
</div>
<div class="col-xs-6">
Presentations
</div>
</div>
<!-- ./row -->
<div class="row half-tile">
<div class="col-xs-6">
<img class="img-responsive" src="http://s16.postimg.org/tqs90puwl/customer.png"></img>
</div>
<div class="col-xs-6">
Events, Trade Shows & Conferences
</div>
</div>
<!-- ./row -->
</div>
</div>
<!-- 3rd Row -->
<div class="row">
<div class="col-xs-4 portfolio-item">
<div class="panel industry-tile-medium">
<div class="panel-body">
<header>Project Library and References</header>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-xs-6">
<img class="img-responsive" src="http://s1.postimg.org/go41exp63/Reports.png"></img>
</div>
<div class="col-xs-6">
<ul class="list-group">
<li class="list-group-item">GF Project Malta</li>
<li class="list-group-item">Intel Israel</li>
</ul>
</div>
</div>
</div>
</div>
<!-- /.panel -->
</div>
<div class="col-xs-4">
<div class="panel branch-tile-medium">
<div class="panel-body">
<header>Industry Links</header>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-xs-12">
<ul class="list-group">
<li class="list-group-item"> www.semi.org</li>
<li class="list-group-item">www.vdma.org</li>
<li class="list-group-item">www.visi.org</li>
</ul>
</div>
</div>
</div>
</div>
<!-- /.panel -->
</div>
<div class="col-xs-4 portfolio-item">
<div class="panel branch-tile-medium">
<div class="panel-body">
<header>Competition</header>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-xs-12">
<ul class="list-group">
<li class="list-group-item"> CH2MHill</li>
<li class="list-group-item">Bechtel</li>
<li class="list-group-item">Jacobs Engineering</li>
</ul>
</div>
</div>
</div>
</div>
<!-- /.panel -->
</div>
</div>
<!-- /.row -->
<hr>
<!-- News -->
<div class="row">
<!-- Electronic news -->
<div class="col-xs-6">
<div class="panel industry-tile-medium">
<div class="panel-body">
<header>Electronic News</header>
</div>
<div class="panel-footer">
<div class="row">
<div>
<ul>
<li>05-Dec ATF in-house news channel</li>
<li>06-Dec ATF in-house news channel</li>
<li>07-Dec ATF in-house news channel</li>
</ul>
</div>
</div>
</div>
</div>
<!-- /.panel -->
</div>
<!-- Industry News -->
<div class="col-xs-6">
<div class="panel branch-tile-medium">
<div class="panel-body">
<header>Industry News</header>
</div>
<div class="panel-footer">
<div class="row">
<div>
<ul>
<li>05-Dec links to global news</li>
<li>06-Dec links to global news</li>
<li>07-Dec links to global news</li>
</ul>
</div>
</div>
</div>
</div>
<!-- /.panel -->
</div>
</div>
<!-- /.row -->
<hr>
<!-- Copyright -->
<footer>
<div class="row">
<div class="col-lg-12">
<p>Copyright © XXX</p>
</div>
</div>
<!-- /.row -->
</footer>
</div>
* {
Box-sizing: Border-box;
border-radius: 0 !important; /* Remove rounded borders from whole layout */
}
.special-tile{
background:#006AB3;
}
.special-tile h4, .special-tile small, .special-tile {
color:white;
}
.special-tile .panel-body{
padding:0;
}
.special-tile .panel-footer{
border:0;
}
.half-tile{
background:#006AB3;
color:white;
}
.half-tile-top{
margin-bottom:10px;
}
.industry-tile-medium{
background: #006AB3;
border: 1px solid #006AB3;
}
.industry-tile-medium .panel-footer{
background: #F0F8FF;
color:#006AB3;
}
.branch-tile-medium{
background: #006B66;
border: 1px solid #006B66;;
}
.branch-tile-medium .panel-footer{
background: #EFFDFC;
}
.branch-tile-medium .panel-footer a{
color: #006B66;
}
.personal-tile-medium{
background: #5E9629;
border: 1px solid #5E9629;
}
.personal-tile-medium .panel-footer{
background: #F2FEE7;
color: #5E9629;
}
ul
{
list-style-type:none;
}
ul li a{
text-decoration:underline;
}
.panel .panel-body header
{
color:white;
font-weight:bold;
font-size:1.2em;
}
.list-group-item {
background:transparent;
padding:5px 5px;
}
.panel-body{
padding:6px;
}
If the height of the panels is unknown, or you don't want to set a min height, you can have each panel assume the height of the tallest panel in each row using CSS flexbox. Just add this CSS..
.row, .row > div[class*='col-'] {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex:1 0 auto;
}
.panel {
width:100%;
}
Demo: http://bootply.com/yTIGMotDkp
Here is a working Fiddle.
While using bootstrap, you need to always need to make some changes according to your need. You can override the bootstrap style by applying your own styles through classes to DOM elements.
You need to define panel height in your css so that your tiles will get the same height.
As you have already written a lot of css in your page, so I use all or your 'css' and made some changes in it.
There are a number of ways you can do this. You could apply a height to your columns
.col-xs-4 {
height: 150px;
}
However this wont' work very well if the content is dynamic because if the length exceeds 150px it will be hidden or you'll get scrolling depending on your CSS rules. You could use min-height which will work better but not ideal.
Alternatively you could apply display: flex to your row container element
.row {
display: flex;`
....
}
Here is a working example of that