<div> on same blocks but with spacing - html

I have a footer I am working on called <footer class="site-footer">, inside this footer there is a container <div class="container"> and inside this container, 3 divisions. col-sm-12 col-md-6 and col-xs-6 col-md-3 (2 of col-xs-6 col-md-3).
What I am doing here is making these 3 divisions on the same block. but with spacing.
I used :
.row{
display: flex;
}
row class is the class that contains these 3 divisions.
The picture below shows what I am asking, I need to make distance between the About, Hot Offers and Links sections. On the other hand the social profiles below should be on the right.
The full code of the footer is:
.row {
display: flex;
}
<!-- Bootstrap 4.1.3 -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<!-- Site footer -->
<footer class="site-footer">
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-6">
<h6>About</h6>
<p class="text-justify">Paragraph about us.</p>
</div>
<div class="col-xs-6 col-md-3">
<h6>Hot Offers</h6>
<ul class="footer-links">
<li> Offer 1 </li>
<li> Offer 2 </li>
<li> Offer 3 </li>
</ul>
</div>
<div class="col-xs-6 col-md-3">
<h6>Quick Links</h6>
<ul class="footer-links">
<li>About Us</li>
<li>Contact Us</li>
<li>Refund Policy</li>
<li>Sitemap</li>
</ul>
</div>
</div>
<hr>
</div>
<div class="container">
<div class="row">
<div class="col-md-8 col-sm-6 col-xs-12">
<p class="copyright-text">Copyright © 2021 All Rights Reserved by
-.
</p>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<ul class="social-icons">
<li><a class="facebook" href="#"><i class="fa fa-facebook"></i></a></li>
<li><a class="twitter" href="#"><i class="fa fa-twitter"></i></a></li>
<li><a class="linkedin" href="#"><i class="fa fa-linkedin"></i></a></li>
</ul>
</div>
</div>
</div>
</footer>

If you want to add space between your blocks you can add padding on your element (your 4 columns).
With Bootstrap you can add (for example) the class "px-2" to each of your column. Like :
<div class="col-xs-12 col-md-3 px-2">
This will add 0.5 inner space on right and left of your column.
Using spacing with Bootstrap : https://getbootstrap.com/docs/4.0/utilities/spacing/
If you don't use Bootstrap, just add padding style property to your element, like :
.column{
padding: 0 0.5rem // will add margin on right and left
}
Also, if you want to add your social profils on the same row, on the right, you have to put you DIV element on the same DIV with class "row", like below.
With the class "col-md-3" on each DIV, the columns will be displayed on the same row from medium screens to extra large screen.
Bootstrap grid system : https://getbootstrap.com/docs/4.0/layout/grid/
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<!-- Site footer -->
<footer class="site-footer">
<div class="container">
<!-- One row with the 4 columns -->
<div class="row">
<div class="col-xs-12 col-md-3 px-2">
<!-- "About" content -->
<h6>About</h6>
<p class="text-justify">Paragraph about us.</p>
</div>
<div class="col-xs-6 col-md-3 px-2">
<!-- "Hot Offers" content -->
<h6>Hot Offers</h6>
<ul class="footer-links">
<li> Offer 1 </li>
<li> Offer 2 </li>
<li> Offer 3 </li>
</ul>
</div>
<div class="col-xs-6 col-md-3 px-2">
<h6>Quick Links</h6>
<ul class="footer-links">
<li>About Us</li>
<li>Contact Us</li>
<li>Refund Policy</li>
<li>Sitemap</li>
</ul>
</div>
<div class="col-xs-6 col-md-3 px-2">
<h6>Social profiles</h6>
<ul class="social-icons">
<li><a class="facebook" href="#"><i class="fa fa-facebook"></i>FB</a></li>
<li><a class="twitter" href="#"><i class="fa fa-twitter"></i>Twitter</a></li>
<li><a class="linkedin" href="#"><i class="fa fa-linkedin"></i>LinkedIn</a></li>
</ul>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-8 col-sm-6 col-xs-12">
<p class="copyright-text">Copyright © 2021 All Rights Reserved by
-.
</p>
</div>
</div>
</div>
</footer>
Finally, about your comment on your answer "if I use bootstrap everything works out but some of the text went bold, etc", you can only import bootstrap-grid.css or bootstrap-grid.min.css.
It only includes grid system and flex utilities without all styles on elements.

Related

Html CSS footer alignment

I have developed a site on angular. All things are working fine. Now I want to adjust the footer.
Actual Footer
Expected Footer
Code
<footer>
<div class="row">
<div class="col-12">
<img src="../../assets/img/logo.svg" alt="" class="img-fluid" />
</div>
<div class="col-md-3 col-12">
<p>
<b>Manufactured by:</b>
</p>
</div>
<div class="col-md-2 col-6 mt-lg-0 mt-3">
<ul class="nav-menu">
<li>
<a [routerLink]="['/']">Home</a>
</li>
<li>
About us
</li>
<li>
Faqs
</li>
<li>
<a [routerLink]="['/latest-recipes']">recipes</a>
</li>
<li>
<a [routerLink]="['/stores']">Stores</a>
</li>
<!-- <li>
<a [routerLink]="['/where-to-buy']">where to buy</a>
</li> -->
</ul>
</div>
<div class="col-md-2 col-6 mt-lg-0 mt-3">
<ul class="px-0">
<li>Privacy & Policy</li>
<li>Terms & Condition</li>
</ul>
</div>
<div class="col-md-3 col-12">
<h1>Karachi Office</h1>
<p></p>
<h1>Lahore Office</h1>
<p></p>
<div class="social-icon d-flex align-items-center">
<i class="fab fa-facebook-f"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-instagram"></i>
</div>
</div>
<div class="col-md-2 col-12">
<img src="../../assets/img/ebs.png" class="img-fluif" />
</div>
</div>
</footer>
How can I align the footer? Any help would be highly appreciated.
You've made the image col-12 which will make the image spread across the full container. Remember that in bootstrap each container is split into 12, so saying that the image covers col-12 will cover all of them. From the looks of it you want to try around col-2.
Alternatively you could achieve the same without Bootstrap. Put the logo/manufactured by links in one div and float them left. Place the rest of the content in another div and float them right.
Add and Remover mt-3(margin-top) from the div.

Can't click on links of my footer on mobile version

For my work I had to create a custom homepage for an existing Wordpress website. Since my boss liked my footer I had to implement my own footer in the theme used.
My footer works fine but in mobile version, I can't click on links...
Here is the website: website
Does anyone have an idea ?
<div class="container">
<div class="col-xs-12 col-sm-6 col-md-3 text-left footer-column">
<h3>EB Quad</h3>
<ul>
<li>Accueil</li>
<li>Atelier</li>
<li>Occasions</li>
<li>Contact</li>
<li>Livre d'or</li>
</ul>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 text-left footer-column">
<h3>CF Moto</h3>
<ul>
<li>Quads</li>
<li>Buggys</li>
</ul>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 text-right footer-column">
<h3>Randonnées</h3>
<ul>
<a href="https://www.ebquad.be/randonnees/">
<li>Nos randonnées</li>
</a>
<li>Agenda</li>
<li>Photos</li>
<li>Informations/Tarifs</li>
</ul>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 text-right footer-column">
<h3>Informations</h3>
<ul>
<li><a href="https://www.google.com/maps/place/E.b.+Renove/#50.3840829,4.0316377,15z/data=!4m2!3m1!1s0x0:0xe36a2bfccc6eb3da?ved=2ahUKEwj5r93ciZjfAhVQNOwKHfAYCtQQ_BIwDXoECAYQCA" target="_blank" rel="noopener noreferrer">
Route de Beaumont 10<br>
7041 Givry (Mons)</a></li>
<li>info#eri-renove.be</li>
<li>0495/447.304</li>
</ul>
</div>
<!-- .footer-widget-wrap -->
<div class="col-xs-12 col-sm-12 col-md-12 text-center">
<div style="font-size:12px; margin:auto; text-align:center;">Site réalisé par:</div>
<a href="http://www.mds-digitalagency.be" class="watermark-link" target="_blank"><img src="https://www.ebquad.be/wp-content/uploads/2018/12/mds_logo.png"
style="width: 64px; margin-bottom:30px;" alt=""></a>
</div>
<div class="footer-bottom-wrap col-md-12">
EB QUAD © Tous droits réservés | Conditions générales
</div><!-- .footer-bottom-wrap -->
</div><!-- container -->
Thanks
Your .footer-bottom-wrap covers the whole footer. Add display: inline-block to this element and all works fine.
Add this css inside your stylesheet
.footer-bottom-wrap {float: left;}
Since your links are float elements they aren't displayed as the normal flow, and your .foote-bottom-wrap elemnt is not a float element this is why this element will cover all of your links.. you can fix it using this class..
.footer-bottom-wrap {
...
overflow:hidden;
}
This property fix this behavior.. you can find a good tutorial to understand float behavior here
Add this in your style.css line number 380 "overflow: hidden;"
It's caused by your css code just try to add
via HTML
<div class="clearfix"></div>
<!--before-->
<div class="footer-bottom-wrap col-md-12">
Or via CSS
.footer-bottom-wrap {
color: #787977;
overflow: hidden;
}

listing inside a container - HTML Problem

I am trying to show the screen like in the image
list inside a container
the problem is the whatever I do, the list is on the bottom of the container like here
the HTML:
<div class="container" ng-init="getCartItems()">
<div class="hidden-xs">
<div class="">
<div class="title">סיכום הזמנה</div>
</div>
</div>
<div class="row">
<div ng-include="'templates/cart.html'"></div>
<div class="subTotalTabs">
<div class="col-md-3 col-xs-12">
<ul class="list-unstyled text-center">
<li>הוספת מבצע</li>
<li><a ng-click="addToCart()" class="clickable btn btn-lg borderBox padTop5 padBtm5 f22">הוספת פיצה</a></li>
<li>הוספת שתייה</li>
<li>מוצרים נלווים</li>
<li><a ng-click="clearCart()" class="my-btn-sqr my-btn-sqr-danger padTop5 padBtm5 f22">רוקן עגלה</a></li>
</ul>
</div>
</div>
</div>
</div><!-- /row -->
</div>
How can I fix this? Thanks!
`

three divs side by side which floats to right and responsive

Dropdown1 and Dropdown2 must float to right. Paging must be to the right.
Paging content may reduce and dropdown1 and 2 must adjust accordingly. I tried different ways but unable to get the solution. In mobile device all the three divs must be centered.
We are using bootstrap. Divs are as follows
<div class="row">
<div class="col-md-3 col-lg-3 col-sm-3 col-xs-12 alpha omega">
<!-- Title -->
</div>
<div class="col-md-6 col-lg-6 col-sm-6 col-xs-12 alpha omega">
<div style="float:right">
<ul class="nav">
<li class="dropdown">
Drop Down 2<b class="caret"></b>
<ul class="dropdown-menu " style="text-transform:uppercase;">
<li data-filterkind="$p" data-filtervalue="DESC">
<a href="./" >1</a>
</li>
<li data-filterkind="$p" data-filtervalue="ASC">
<a href="./" >2</a>
</li>
</ul>
</li>
</ul>
</div>
<div class="pull-right">
<!-- Drop down 2 -->
</div>
</div>
</div>
<div class="col-md-3 col-lg-3 col-sm-3 col-xs-12 alpha omega">
<div style="float:right" >
<!-- Pagination -->
</div>
</div>
</div>
Please suggest
So like this?
HTML
<div class="container">
<div class="row">
<div class="col-sm-6 text-center heading1">
<p> Heading </p><!-- Heading -->
</div>
<div class="col-sm-6">
<div class="row">
<div class="float text-center">
<div class="col-sm-4">
<p> DD1</P><!-- Drop down 1 -->
</div>
<div class="col-sm-4">
<p> DD2</P><!-- Drop down 2 -->
</div>
<div class="col-sm-4">
<p> PAGINATION</P><!-- pagination -->
</div>
</div>
</div>
</div>
</div>
</div>
Then add the following additional stuff to your custom CSS:
#media (min-width: 768px)
{
.float
{
float: right;
}
.heading1
{
text-align: left;
}
}
FYI - The above is bootstrap, but the additional classes are needed to get the custom result you want.

Using Bootstrap, insert a vertical line in the middle to separate 3 icons to the left, and 3 icons to the right, and still make it responsive

I'm hoping someone can help solve a problem I've had for the last 2 days. Unfortunately I can't post an image of that here as I'm new, and have no reputation points.
I have a layout with 2 sections.
1st Section
First row: Heading (centered)
Second row: 6 icons spread out across the width of the page, and their relevant 1-2 words description below each of the respective icons.
2nd Section
First row: 2 Headings (one centered on the left, the other centered on the right; separated by a white vertical line in the middle of the page)
Second row: 6 icons spread out across the width of the page as per the 1st section; but this time, the first 3 icons belong to the first Heading, and the last 3 icons belong to the second Heading.... with a vertical line in the middle, to separate out the 1st Heading & 3 icons on the left, and the 2nd Heading & last 3 icons on the right.
I could get the first line (heading, 6 icons and their relevant 1-2 words description) working in CSS. I used container-fluid, row, and the necessary col-sm-2 classes in Twitter-Bootstrap.
But how do I insert a border-right 100% white line (or any other suggestions will be very welcome), and squish it in between the 2nd row's two Headings and divide the icons into 3x3, at the same time?
The code below is what I used for the 1st section:
<div class="container-fluid">
<h5 class="text-center">HEADER 1</h5>
<ul class="row">
<li class="col-xs-4 col-sm-2">
<img src="img/1.png" alt="icon1">
<p class="text-center">2-word description</p>
</li>
<li class="col-xs-4 col-sm-2">
<img src="img/2.png" alt="icon2">
<p class="text-center">2-word description</p>
</li>
<li class="col-xs-4 col-sm-2">
<img src="img/3.png" alt="icon3">
<p class="text-center">2-word description</p>
</li>
<li class="col-xs-4 col-sm-2">
<img src="img/4.png" alt="icon4">
<p class="text-center">2-word description</p>
</li>
<li class="col-xs-4 col-sm-2">
<img src="img/5.png" alt="icon5">
<p class="text-center">2-word description</p>
</li>
<li class="col-xs-4 col-sm-2">
<img src="img/6.png" alt="icon6">
<p class="text-center">2-word description</p>
</li>
</ul>
<hr>
</div><!-- /.container-fluid -->
I need the next section to be somewhat like the 1st section, but have a vertical white line in the middle of the section, separating the 2nd header and 3 icons to the left, and the 3rd header and the last 3 icons to the right.
The code below is for the 2nd section:
<div class="container-fluid">
<ul class="row">
<li class="col-xs-12 col-sm-6">
<h5 class="text-center">HEADER 2</h5>
</li>
<li class="col-xs-12 col-sm-6">
<h5 class="text-center">HEADER 3</h5>
</li>
</ul>
</div><!-- /.container-fluid -->
<div class="container-fluid section2">
<div class="row">
<div class="left col-xs-12 col-sm-6">
<div class="container-fluid">
<ul class="row">
<li class="col-xs-4 col-sm-4">
<img src="img/7.png" alt="icon7">
<p class="text-center">2-word description</p>
</li>
<li class="col-xs-4 col-sm-4">
<img src="img/8.png" alt="icon8">
<p class="text-center">2-word description</p>
</li>
<li class="col-xs-4 col-sm-4">
<img src="img/9.png" alt="icon9">
<p class="text-center">2-word description</p>
</li>
</ul>
</div><!-- /.container-fluid -->
</div><!-- /.left -->
<div class="right col-xs-12 col-sm-6">
<div class="container-fluid">
<ul class="row">
<li class="col-xs-4 col-sm-4">
<img src="img/10.png" alt="icon10">
<p class="text-center">2-word description</p>
</li>
<li class="col-xs-4 col-sm-4">
<img src="img/11.png" alt="icon11">
<p class="text-center">2-word description</p>
</li>
<li class="col-xs-4 col-sm-4">
<img src="img/12.png" alt="icon12">
<p class="text-center">2-word description</p>
</li>
</ul>
</div><!-- /.container-fluid -->
</div><!-- /.right -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
Your invaluable help will be very much appreciated!
Thanks in advance!
new code for the 2nd section
<div class="section2">
<div class="left container-fluid">
<div class="row">
<h5 class="col-xs-12 col-sm-6 text-center">
HEADER2
</h5>
</div>
<ul class="row">
<li class="col-xs-4 col-sm-2">
<img src="img/7.png" alt="icon7">
<p class="text-center"2-word description</p>
</li>
<li class="col-xs-4 col-sm-2">
<img src="img/8.png" alt="icon8">
<p class="text-center">2-word description</p>
</li>
<li class="col-xs-4 col-sm-2">
<img src="img/9.png" alt="icon9">
<p class="text-center">2-word description</p>
</li>
</ul>
</div><!-- /.left .container-fluid -->
<div class="right container-fluid">
<div class="row">
<h5 class="col-xs-12 col-sm-6 text-center">
HEADER3
</h5>
</div>
<ul class="row">
<li class="col-xs-4 col-sm-2">
<img src="img/10.png" alt="icon10">
<p class="text-center">2-word description</p>
</li>
<li class="col-xs-4 col-sm-2">
<img src="img/11.png" alt="icon11">
<p class="text-center">2-word description</p>
</li>
<li class="col-xs-4 col-sm-2">
<img src="img/12.png" alt="icon12">
<p class="text-center">2-word description</p>
</li>
</ul>
</div><!-- /.right .container-fluid -->
</div><!-- /.section2 -->
NEW QUESTION
Hi... I have another small question...
I was working on the big screen and it wasn't obvious to me until now that I've started working on the #mediaqueries, and resizing the screen.
The icons and the the respective 2-word descriptions aren't exactly centered with each other. The 2-word descriptions are slightly to the right of the icons above.
I've tried using the bootstrap class .text-center on the element, it didn't work.
I've also tried giving the a class, and then using "margin: 0 auto" in CSS, and it also did not work.
Where have I gone wrong?
Thanks in advance.
first you should consider .section2 as a row, with two children header1 and header2. so add class="row" to this div, and apply class="col-xs-12 col-sm-6" to each header block.
then consider each header block as a single row, containing 3 images with description. do same action as before.
.container-fluid and .left .right are no longer necessary, as the parent .row and children's .col-* take care of these for you.
Update: sorry for ignoring your problem with the blank in the middle. it is caused by the default style of <ul>, and could be solved by adding ul { padding-left: 0;}.
see this fiddle for example.
In your second section make two main rows, these contain nested rows for your headings and respective icons. On the first row add a border-right.