safari not displaying header background images - html

In my website the top header background and the "Kreation Team" Div background are not displaying in safari on ipads and iphones but it is visible on imacs and macbooks. I mean in small devices the background images are not visible.
If you go in Chrome and safari separately you can see the difference...
Please help how to solve this?`
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="jumbotron">
<div class="container-fluid">
<nav class="row pull-right hidden-xs" style="padding:20px 20px 0 0;">
<ul style="font-size: 15px;">
<li>Home</li>
<li>About Us</li>
<li>Branches</li>
<li>Gallery</li>
</ul>
</nav>
<div class="row-fluid">
<div class="col-sm-7 col-xs-7">
<h1>KREATION <br>House of Cotton</h1>
<h2 style="font-weight: bold;padding-bottom: 30px;">Srilankan Quality Handloom Manufacturer</h2>
<button class="jumbo-btn hidden-xs" onclick="
location.href='http://kreationhandlooms.com/aboutus';" alt="Kreation House of Cotton about us page">About Us</button>
</div>
<div class="col-sm-5 col-xs-5">
</div>
</div>
</div>
</div>
CSS
.jumbotron{
background-image: url("images/silk saree.jpg");
background-size: cover;
background-position: center 10%;
background-repeat: no-repeat;
background-attachment: fixed;
height: 720px;
width: 100%;
font-family: nexabold;
margin: 0;
padding: 0;
}
#media only screen and (min-width: 510px) and (max-width: 2000px){
.jumbotron .container-fluid .row-fluid{
padding:160px 0 0 10px;
}
}
#media only screen and (min-width: 100px) and (max-width: 510px){
.jumbotron .container-fluid .row-fluid{
padding-top: 80px;
}
}
.jumbo-btn{
padding:10px 20px;
border: 3px solid white;
border-radius: 5px;
font-size: 18px;
background:transparent;
transition: all 0.4s;
}
.jumbotron h1{
font-weight: bold;
}
.jumbo-btn:hover{
background-color: grey;
color: white;
border:3px solid white;
}
#media only screen and (min-width: 200px) and (max-width: 760px){
.jumbotron .row-fluid h1{
margin:0 0 30px 0;
font-size: 45px;
font-weight: bold;
}
there was an error in console too
Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3

Your console error is due to the fact that you are not loading jQuery in your HTML. You need to add something along the lines of:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
This may also be what's causing problems with your images. If you're still experiencing issues, it helps to have a working example. Try creating a CodePen or JSFiddle with your code, and append the link to your original post.
Edit: I just took a look at your code, and the image isn't loading on Safari mobile because of background-attachment: fixed on line 214 of stylesheet.css for the CSS class .jumbotron. If you remove that from your code, the image works fine. If you need to keep the CSS for the desktop, just use a simple media query to target mobile devices.

Related

Position Absolute/Relative Nightmare

I'm almost crying. Okay, not that much. But I spent almost three days trying to find a solution for this problem and I can't find anywhere.
I'm using Bootstrap, so only a part of the CSS is available as the main classes I use the default from Bootstrap.
This is what I want to achieve:
This is what it's looking like right now (both mobile and desktop)
The live website: http://acessogestaocontabil.com.br/
And this is the code:
HTML
<!-- navHeader -->
<div class="container-fluid" id="header">
<div class="container d-xl-none">
<img src="img/footerLogo.png" class="img-fluid" alt="">
</div>
<div class="midias d-none d-xl-block">
<nav>
<i class="fab fa-instagram"></i> | <i class="fab fa-facebook-f"></i>
</nav>
</div>
<div class="container d-none d-xl-block">
<div class="row">
<div class="col-9">
<nav class="nav">
<li class="nav-item"><i class="fas fa-home"></i></li>
<li class="nav-item">Sobre</li>
<li class="nav-item dropdown">
Consultoria e Assessoria
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
Assessoria Contábil
Pessoas
Fiscal
Tributária
</div>
</li>
<li class="nav-item">Blog</li>
<li class="nav-item">Contato</li>
</nav>
</div>
</div>
</div>
</div>
CSS/SASS
#header {
background-image: url('../img/bg-topo-desk.png');
background-repeat: no-repeat;
background-position: top center;
background-size: cover;
min-height: 195px;
}
#header .nav {
background: url('../img/bgHeaderMenu.jpg') no-repeat #13165f;
position: absolute;
transform: none;
width: 100%;
top: 133px;
right: -184px;
overflow: hidden;
padding: 0px 20px;
}
#menuHeader {
position: relative;
right: 210px;
}
#header .nav a {
color: #FFF;
text-transform: uppercase;
}
#header .nav .nav-item {
border-right: 1px solid #3249b7;
}
#header .midias {
background: url('../img/bgSocialHeader.jpg') no-repeat #3d5cc7;
height: 40px;
position: absolute;
top: 133px;
right: 0px;
z-index: 1;
padding: 6px 180px 5px 60px;
}
#header .midias a {
color: #FFF;
}
// Small devices (landscape phones, less than 768px)
#media (max-width: 767.98px) {
#header .midias {
display: none;
}
}
// Large devices (desktops, less than 1200px)
#media (max-width: 1199.98px) {
#header .nav {
display: none;
}
}
The logo is inserted into the image, so it will show as a normal background in desktop. In mobile, I change to the a inserted image, with a link. I know is not the best scenario but it's what I was capable to do.
The navigation menu is the main problem. It looks okay in some resolution, but when I try to resize, it just breaks. I tried everything: two divs, two backgrounds, flexbox, position absolute, position relative and everything just fails.
Does anyone knows how to solve it? :(
For what I can suggest is - move the background to its own element, then you can remove all position: absolute declarations, as the other elements will neatly fall below it. As the image should, as I understand, displayed whole, the easiest way is to just use <img src="/img/bg-topo-desk.png" alt="header" style="width:100%"/>. (of course you should move the width declaration to css).

Bootstrap 4 fullscreen image

.ava-block {
width: 220px;
min-height: 155px;
background: url(../images/no-banner.png) no-repeat;
border-right: 1px solid #e8e8e8;
}
#media (max-width: 992px) {
.ava-block {
width: 100%;
background-size: cover;
}
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<div class="row">
<div class="col-md-3">
<div class="ava-block" style="background-image: url(https://www.dean.ngo/wp-content/uploads/2018/12/projectElimu-220x155.png);">
</div>
</div>
</div>
I do cover, but image become with bad quality. How I can do it correctly? I need on tablets and mobile devices do fullscreen image, without quality loss and show full image. Width of image can be only 220px and height 155px.
You can't get the a small image to scale while maintaining image quality unless you make use of scalable image type such as vectors.
To solve the image going out of the ratio you could assign and max value for your inner block to ensure it doesn't exceed the maximum size which you had specified width:220 and height:155 or you can just make the size static. If my interpretation of the question is right, you may try something like the following:
.ava-block {
width: 220px;
height: 155px;
border-right: 1px solid #e8e8e8;
color: black;
}
#media (max-width: 992px) {
.ava-block {
width: 100%;
}
}
HTML
<div class="row">
<div class="col-md-3">
<div class="ava-block">
<img style='height: 100%; width: 100%; object-fit: contain' src='https://www.dean.ngo/wp-content/uploads/2018/12/projectElimu-220x155.png' />
</div>
</div>
</div>

#media image fails to load on reduced screen

I have a similar issue to one of my previous questions.
when i reduce to below 975px my picture should change to a differet jpg
it seems to work locally when i redue the size of the screen but when i check on online the new image doesnt show.
As this happened previously i played with it for several hours first for fear of looking stupid, but i give up now, ill take it on the chin if any one can assist:)
HTML:
<!-- load this image on big screen -->
<div class=" jumbotron jumbotron-fluid jumbotronbrejos hideformob">
<div class="container-fluid relspan">
<img class="brejosimg" src="resources\images\brejosHouse.jpg">
<div class="jumbospan">
<h4 id="fontI">Albufeira, Algarve Portugal</h4>
</div>
</div>
</div>
<!-- load this image on smaller screens -->
<div class="container-fluid navpad">
<div class="row">
<div class="farmhouseimg farmhouse"></div>
</div>
</div> <!-- end of container -->
CSS:
/* on screens that are less than 975px */
.farmhouseimg {
background-image: url("../images/farmhouse.jpg");
background-repeat: no-repeat;
background-position: center;
background-size: cover;
margin-left:0px;
margin-right: 0px;
width:100%;
display: none;
min-height: 600px;
}
.farmhouse {
margin-bottom: 30px;
min-height: 600px;
width:100%
}
#media only screen and (max-width: 975px) {
.farmhouseimg {
display: block;
}
}
.hideformob {
display: block;
}
#media only screen and (max-width: 975px) {
.hideformob {
display: none;
}
}

Is there a way to disable Jumbotron only on mobile in Bootstrap 4?

I have used jumbotron to have a full height page on the desktop version on my website, but I want to have the normal layout (disable jumbotron) on the mobile version. Because on the mobile version, content inside the jumbotron div is going outside as it is not enough space. And below div content is overlapping those content. I'm using Bootstrap 4. My code as below,
<section class="jumbotron">
<div class="container">
<div class="content row">
<div class="col-12 jumbotron">
<div class="single-work">
<h2>Title here</h2>
<p>Text here</p>
</div>
</div>
</div>
</div>
</section>
You can use a media query like the following:
#media only screen and (max-width: 875px) {
.jumbotron {
width: 100%;
}
}
You can change the max-width on the query to the one that suits you better and the css is just placeholder there, You can hide it, change the width, remove a property or whatever. Try Playing in developer tools to find which properties should be modified and how, and then add these modifications to the media query.
Islam Elshobokshy has already answered this in his comment, I just elaborated a little.
Yes! you can hide only for mobile devices.
All you go to do is to add .d-none .d-sm-block classes to get them hidden only for mobile (xs) devices.
<section class="jumbotron d-none d-sm-block">
<div class="container">
<div class="content row">
<div class="col-12 jumbotron">
<div class="single-work">
<h2>Title here</h2>
<p>Text here</p>
</div>
</div>
</div>
</div>
</section>
For more details on hiding elements for particular devices, please
refer the bootstrap documentation:
http://getbootstrap.com/docs/4.1/utilities/display/
if you are using Bootstrap 4, you should use it's features too, like breakpoints. In the bootstar_config file you can set up your breakpoints (screen width in pixels) and accordingly style your classes.
Using media breakpoints in Bootstrap 4-alpha
For: example:
.something {
#include media-breakpoint-up(sm) { // from small resolutions
padding: 20px;
}
#include media-breakpoint-down(md) { // under medium resolutions
padding: 40px;
}
#include media-breakpoint-only(md) { // only on medium resolution
padding: 40px;
}
}
this is the css for class jumbotron from here, alter accordingly using your media query as https://stackoverflow.com/users/8505314/giwrgos-lampadaridis says.
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.css
.jumbotron {
padding-top: 30px;
padding-bottom: 30px;
margin-bottom: 30px;
color: inherit;
background-color: #eee;
}
.jumbotron h1,
.jumbotron .h1 {
color: inherit;
}
.jumbotron p {
margin-bottom: 15px;
font-size: 21px;
font-weight: 200;
}
.jumbotron > hr {
border-top-color: #d5d5d5;
}
.container .jumbotron,
.container-fluid .jumbotron {
padding-right: 15px;
padding-left: 15px;
border-radius: 6px;
}
.jumbotron .container {
max-width: 100%;
}
#media screen and (min-width: 768px) {
.jumbotron {
padding-top: 48px;
padding-bottom: 48px;
}
.container .jumbotron,
.container-fluid .jumbotron {
padding-right: 60px;
padding-left: 60px;
}
.jumbotron h1,
.jumbotron .h1 {
font-size: 63px;
}
}

How to change font size at breakpoints bootstrap 3

I have a page title <h1> MY JOB </h1> with a font size of 70px. I want to automatically change the size of the title to font size 36px when the page reaches a small breakpoint (mobile phone).
How can I achieve this?
Here is what I have done so far:
.title-extra-large-5 {
font-size: 70px !important;
line-height: 80px;
}
#media (max-width: 767px){
.xs-title-extra-large-4{
font-size: 36px !important;
line-height: 42px !important;
}
}
<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-lg-7 col-md-8 col-sm-12 col-xs-12">
<h2 class="title-extra-large-5 md-title-extra-large-3 xs-title-extra-large-4">MY JOB.</h2>
</div>
</div>
</div>
In your question, you mention that your title is h1, but, in your example, you use h2.
Apart from that, you are on the right track. You just need to change couple of things:
h2 {
font-size: 70px !important;
line-height: 80px !important;
}
#media (max-width: 767px){
h2{
font-size: 36px !important;
line-height: 42px !important;
}
}
<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-lg-7 col-md-8">
<h2>MY JOB.</h2>
</div>
</div>
</div>
You do not need to refer to col-sm-12 and col-xs-12 as bootstrap will render into them by default. And you do not need to have extra classes title-extra-large-5 md-title-extra-large-3 xs-title-extra-large-4 you can just refer to h2 or h1.
I'm assuming by certain screen size, you want to change it, right?
ACCORDING TO W3SCHOOLS.COM
You can use the #media property to display a certain set of styles in a certain situation.
body{
background-color: blue; /*For screens with more than 480px screen width.*/
}
p{
font-size:72px;
}
#media screen and (max-width: 480px) { /*Same but for less*/
body {
background-color: lightgreen;
}
p{
font-size:36px;
}
}
Comparing this to your code, I'd say you've got it mostly correct, but be leniant on !important. This can conflict with other styles, so only use it when you do NOT want it to change, or the style won't be applied otherwise.EDIT: It seems you have two classes which do the exact same thing, but conflict with each other due to !important. I'd say just keep one of the classes and change the styles with #media so you're gauranteed it'll work and that it won't conflict with other styles.