Site OK on computer but not in smartphone - css

My site appears correctly on computer screens, but not on smartphones.
Like you can see, the main title (Phytothérapie) is cut and and the three buttons are not centered.
My code :
<div class="col-12">
<div class="row">
<div class="col-12">
<h1 class="mg-md h1-welcome-to-style tc-black">Bienvenue à la</h1>
<h1 class="mg-md h1-bloc-0-style tc-black"><span style="font-size: 2rem !important;">FACULTÉ DE PHARMACIE DE L'ULB</span></h1>
<h1 class="mg-sm tc-black h1-3-style"><span style="font-size: 70px !important;">PHYTOTHÉRAPIE</span></h1>
<h2 class="mg-md tc-black h2-1-style"></h2>
</div>
</div>
and for the 3 blocks :
<div class="phyto-container" onclick="location.href='{{$route}}';">
<div class="phyto-front" style="background-image: url({{$bgImage}})">
<div class="phyto-inner">
<p>{{ $titleFront }}</p>
</div>
</div>
<div class="phyto-back">
<div class="phyto-inner">
<div>
#foreach($paragraphs as $p)
<p style="font-size: 1.1rem;margin-top:-10px !important; margin-left:-1px !important;">{{ $p }}</p>
#endforeach
</div>
</div>
</div>
The URL of the site is https://overlap.ulb.be/public/
Thank you in advance for help.

Have you tried margin-right: 10px; on the title?

In your style.css add this:
#unsets {
width: unset !important;
position: unset !important;
padding: unset !important;
margin: 10px;
}
and add to all of this divs above id:
<div class="col-sm-4 col-md-2 col-lg-2 col-xl-2 align-self-center" id="unsets">
Refresh page or clean cache to see changes.

You need to make your site responsive, you can either use frameworks, columns, rows, containers, or media screens.

Related

Display flex and any other HTML tag

Suppose this very simple case:
.header-top .custom-html {
display: flex;
align-items: center;
}
<div class="header-top header-has-center-sm">
<div class="header-row container-fluid">
<div class="header-col header-left hidden-for-sm">
<div class="custom-html"><i class="porto-icon-shipping me-2" style="font-size: 2em; vertical-align: middle;"></i>Shipping to all states, <span style="font-weight: bold;">FREE</span> shipping to orders above $50</div>
</div>
<div class="header-col visible-for-sm header-center">
<div class="custom-html"> </div>
</div>
<div class="header-col header-right hidden-for-sm">
<div class="custom-html"><i class="Simple-Line-Icons-badge me-2" style="font-size: 2em; vertical-align: middle;"></i>All our products are <b>GENUINE</b></div>
</div>
</div>
</div>
As you can see, the content of the <b> tag gets next to the surrounding words, as if there is no whitespace around it.
Can someone explain why this is happening and how to remedy it? It's the first time I notice this happening...
Basically, I set the content's display to flex, as I need to vertically align to the middle the text. But this side-effect was totally unexpected...
The issue is your text grouping. I know it sounds strange but text wrapped in div is not really grouped. You would need to wrap it in a <span> or <p> tag. I have used a <span> just to let the browser know that this text belongs together. You can use a <p> tag which obviously comes with more preset styles like margins on the top and bottom.
.header-top .custom-html {
display: flex;
align-items: center;
}
<div class="header-top header-has-center-sm">
<div class="header-row container-fluid">
<div class="header-col header-left hidden-for-sm">
<div class="custom-html"><span><i class="porto-icon-shipping me-2" style="font-size: 2em; vertical-align: middle;"></i>Shipping to all states, <span style="font-weight: bold;">FREE</span> shipping to orders above $50</span>
</div>
</div>
<div class="header-col visible-for-sm header-center">
<div class="custom-html"> </div>
</div>
<div class="header-col header-right hidden-for-sm">
<div class="custom-html"><span><i class="Simple-Line-Icons-badge me-2" style="font-size: 2em; vertical-align: middle;"></i>All our products are <b>GENUINE</b></span></div>
</div>
</div>
</div>

Bootstrap 4 Vertically align footer while respecting columns and rows

I'm trying to find a solution how to vertically align the 2 rows in the footer which are placed with a Bootstrap grid.
I've already tried to make a wrapper for the content and apply the regular flexbox solution:
display: flex; align-items: center. But this moves both rows to be on the same row.
Fiddle here https://codepen.io/pen/WNNPdxv
HTML
<footer class="footer">
<div class="footer-wrapper">
<div class="container">
<div class="row row">
<div class="col-sm-8 footer-credit">
<h6>GetMove</h6>
<p>Copyright &copy 2019 GetMove All Rights Reserved</p>
</div>
<div class="col-sm-2 footer-contact">
<h6>Contact</h6>
hola#getmove.net
</div>
<div class="col-sm-2 footer-social-icons">
<h6>Follow us</h6>
<a class="social-icon" target="_blank" href="https://www.facebook.com/pg/GetMove.Official/"
><i class="fab fa-facebook-square"></i
></a>
<a class="social-icon" target="_blank" href="https://www.instagram.com/getmovemx/"
><i class="fab fa-instagram"></i
></a>
<a class="social-icon" target="_blank" href="https://soundcloud.com/getmove"
><i class="fab fa-soundcloud"></i
></a>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-8 text-center"></div>
<div class="col-sm-4 footer-newsletter">
<h6>Subscribe</h6>
<div class="input-group input-group-sm mb-3">
<input
type="text"
class="form-control shadow-none"
id="subscribe"
placeholder="# Enter your email adress"
aria-label="Sizing example input"
aria-describedby="inputGroup-sizing-sm"
/>
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" id="button-addon1">
Submit
</button>
</div>
</div>
</div>
</div>
</div>
<div class="container footer-credit">
<div class="row">
<div class="col-sm-8"></div>
<div class="col-sm-4 footer-credit"></div>
</div>
</div>
</div>
</footer>
CSS
.footer {
width: 100%;
height: 24em; /* Set the fixed height of the footer here */
background-color: #f4f2f0;
margin-top: 4em;
}
.footer-social-icons {
list-style-type: none;
}
.footer h6 {
text-transform: uppercase;
font-size: 16px;
}
.footer-credit {
font-size: 11px;
}
.social-icon {
/* display: block; */
margin: 0;
font-size: 16px;
}
.form-control:focus {
border-color: black;
}
The idea of a wrapper to vertically center content is correct, however you already have a wrapper in place => container.
No need to have multiple containers inside a single section (footer). You use rows for this.
So to clean-up your structure a bit, as suggested in the comments, is key to understand what's going on.
container is your wrapper
row row is redundant
empty columns as placeholder are not required with flexbox (bootstrap 4), not sure if that's what's going on... => m-auto, ml-auto, mr-auto
place custom classes inside columns (these blocks might change places someday, especially when designing for a CMS)
keep the structure clean and decorate with utility classes if needed (padding, margin, ...)
HTML Structure
<footer role="contentinfo">
<div class="container">
<div class="row">
<div class="col-sm-7"></div>
<div class="col-sm-3"></div>
<div class="col-sm-2"></div>
</div>
<div class="row">
<div class="col-sm-5 ml-auto"></div>
</div>
<div class="row">
<div class="col-sm-5 ml-auto"></div>
</div>
</div>
</footer>
Solution
Now your height is set on the footer, your container is simply taking the required height inside the space. This means you should now be able to move it vertically with flexbox.
footer[role="contentinfo"] {
display: flex;
flex-flow: column wrap;
justify-content: center; /* content of the footer is the container */
}
DEMO

How does Bootstrap Pull and push work

I am trying to fix a page which wasn't bootstrapped like the illustration. But my col-2, col-3, col-4 don't align with the col 1 and 2. I cannot really understand how pull and push work. I have worked on my mobile layout and it seem fine, but as it goes to desktop, it messing the layout.
My layout becomes this, when I make it go desktop. Misaligned headings and columns under it.
You need to include yellow div-s into row so they won't jump over next line.
.left-box {
height: 290px;
width: 100%;
background: #e66;
margin: 3px;
}
.right-box {
height: 70px;
background: #ee6;
margin: 3px;
}
#media screen and (min-width: 992px) {
.left-box, .right-box {
height: 200px;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-md-2 col-xs-5">
<div class="left-box"></div>
</div>
<div class="col-md-10 col-xs-7">
<div class="row">
<div class="col-md-3"><div class="right-box"></div></div>
<div class="col-md-3"><div class="right-box"></div></div>
<div class="col-md-3"><div class="right-box"></div></div>
<div class="col-md-3"><div class="right-box"></div></div>
</div>
</div>
</div>
</div>
Note: according to bootstrap rules, the statement class="col-md-2 col-sm-5" is the same that class="col-lg-2 col-md-2 col-sm-5 col-xs-12".
Actually you don't need push-pull classes I think. You could use a markup like this:
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="left-box"></div>
</div>
<div class="col-md-6">
<div class="right-box"></div>
<div class="right-box"></div>
<div class="right-box">etc...</div>
</div>
</div>
</div>
Pen: http://codepen.io/anon/pen/yVKgwG

Reordering 3 Columns in Bootstrap for SEO

I need help reordering columns in Bootstrap for SEO purposes using push and pull. The final output would be like the image below. Right now I only need to switch the Left Sidebar and Main Content on desktop view. I managed to do this using a bunch of divs and floats but I decided to give bootstrap a try. Thanks!
HTML
<div class="container">
<div class="row">
<div class="col-sm-4 col-1 my-col">
Main Content (Middle)
</div>
<div class="col-sm-4 col-2 my-col">
Left Sidebar
</div>
<div class="col-sm-4 col-3 my-col">
Right Sidebar
</div>
</div>
</div>
CSS
.my-col{
line-height: 40px;
color:white;
text-align:center;
font-size: 20px;
}
.col-1{background:red}
.col-2{background:blue}
.col-3{background:green}
#media (min-width: 768px) {
.my-col{
line-height: 80px;
}
}
Bootply http://www.bootply.com/slW117V1oH#
Column ordering is the inbulit feature of bootstrap framework. For more information visit here
<div class="row">
<div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div>
<div class="col-md-3 col-md-pull-9">.col-md-3 .col-md-pull-9</div>
</div>
example here codepen
enjoy :)

My container or row is in the middle of the page content and not sticking at the bottom of the page like footer widgets are supposed to

This is the code I've pulled. I don't know how to push the footer widget down to the bottom of the page. The footer sits at the bottom for other pages because there isn't a lot of content but on one page, it sits in the middle of the content.
<footer id="colophon" class="site-footer" role="contentinfo">
<div class="container">
<div class="row">
<div id="footer-widget-area" class="row">
<div class="footer-widgets-1 col-md-12"></div>
</div>
<aside id="black-studio-tinymce-4" class="widget_black_studio_tinymce widget well">
<div class="textwidget">
<h6 style="text-align: center;">
<span style="color: #000000;">© 2016 xxxx LLC | Location| Phone Number | email#gmail.com</span>
<br>
<em>
<span style="color: #000000;"> All photos, designs, layouts, and content on this website, including blog, are under copyright, unless otherwise noted. If you would like to borrow an image and/or content, kindly request for permission.</span>
</em>
</h6>
</div>
</aside>
<div class="col-md-9">
<div class="site-info"></div>
<div class="attribution">
<span class="attribution-theme-mods">
Special Thanks
</span>
</div>
</div>
<div class="col-md-3"></div>
</div>
</div>
</footer>
</div>
<div style="display:none"></div>
The attribution, display none is for WordPress attribution that I don't want to display.
Here's a working version:
http://jsbin.com/qepuxay/edit?html,css,output
Critical CSS:
html {
height: 100%;
}
body {
min-height: 100%;
padding-bottom: 140px;
}
footer {
position: fixed;
bottom: 0;
width: 100%;
height: 140px;
border-top: 1px solid red;
}
Note: this requires that the height of the footer is 'known' - I have set it to 140px, with 140px added as padding to body. I have also added a red border-top for visual purposes.

Resources