I have a two-column layout in a bootstrap modal. There should be a bootstrap dropdown button as the content. Firefox renders it correctly but webkit based browsers fail to display the button correctly. The button does not get hover or click events since its position is rendered wrong.
The question is: Am I doing something wrong? And is there a way to avoid this problem?
The jsfiddle is here: http://jsfiddle.net/cenap/mtpj8god/4/
Full screen: http://jsfiddle.net/cenap/mtpj8god/4/embedded/result/
.multicolumn-container {
width: 250px;
height: 300px;
-webkit-column-count: 2;
/* Chrome, Safari, Opera */
-moz-column-count: 2;
/* Firefox */
column-count: 2;
-webkit-column-rule: 1px outset #CCC;
/* Chrome, Safari, Opera */
-moz-column-rule: 1px outset #CCC;
/* Firefox */
column-rule: 1px outset #CCC;
overflow: auto;
}
.box {
display: inline-block;
width: 100px;
min-height: 60px;
text-align: center;
border: 3px solid #666;
padding: 10px;
margin: 10px;
}
.err {
font-size: 8px;
color: red;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" />
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<div class="container">
<div class="hero-unit">
<h1>Multicolumn in Bootstrap modal</h1>
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
</div>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span>
</button>
<h4 class="modal-title">Modal title</h4>
<div class='btn-group'>
<button class='btn btn-default btn-sm dropdown-toggle' data-toggle='dropdown'><span class='caret'></span>
</button>
<ul class='dropdown-menu' role='menu' aria-labelledby='dLabel'>
<li><a href='#'>Some Action</a>
</li>
<li class='divider'></li>
<li><a href='#'>Some Other Action</a>
</li>
</ul>
</div>
<--- This works but the ones in columns below do not render correctly in webkit. </div>
<div class="modal-body">
<div class="multicolumn-container">
<div class="box">1
<div class='btn-group'>
<button class='btn btn-default btn-sm dropdown-toggle' data-toggle='dropdown'><span class='caret'></span>
</button>
<ul class='dropdown-menu' role='menu' aria-labelledby='dLabel'>
<li><a href='#'>Some Action</a>
</li>
<li class='divider'></li>
<li><a href='#'>Some Other Action</a>
</li>
</ul>
</div>
<span class="err">This is rendered wrong in webkit browsers</span>
</div>
<div class="box">2
<div class='btn-group'>
<button class='btn btn-default btn-sm dropdown-toggle' data-toggle='dropdown'><span class='caret'></span>
</button>
<ul class='dropdown-menu' role='menu' aria-labelledby='dLabel'>
<li><a href='#'>Some Action</a>
</li>
<li class='divider'></li>
<li><a href='#'>Some Other Action</a>
</li>
</ul>
</div>
<span class="err">This is rendered wrong in webkit browsers</span>
</div>
<div class="box">3</div>
<div class="box">4</div>
<div class="box">5</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
its working fine on Mac OSX webkit browsers - Chrome 37+ and Safari 7+, as on Firefox 30+. Please specify the browser version.
It seems like there is a bug in Webkit and columns have been disabled for printing by its developer (Dave Hyatt) because page breaking couldn't be implemented properly. So the WebKit implementation have CSS3 columns turned off, but Firefox renders them correctly. I’ve tried making columns work for printing in Chrome, but still getting better results from Firefox. Also there are some posts by Dave Hyatt and one of them stating that “Columns are using the new pagination model, but printing isn't using it yet.”(https://bugs.webkit.org/show_bug.cgi?id=45993)
I know the question was asked over a year ago, but I found this worked for me.
-webkit-perspective: 1;
See http://jsfiddle.net/mtpj8god/6/
More about it (from http://caniuse.com/#search=column-count, in known issues):
Chrome is reported to incorrectly calculate the container height, and
often breaks on margins, padding, and can display 1px of the next
column at the bottom of the previous column. Part of these issues can
be solved by adding -webkit-perspective:1; to the column container.
This creates a new stacking context for the container, and apparently
causes chrome to (re)calculate column layout.
Related
I only can see the tab which is I made active by default. But when I click on other tabs, I can't see anything. They just won't open. What's my mistake here? Need your help.
I tried to find the solution on bootstrap documentation, but I didnt come across with something like this.
By the way I am just learning bootstrap. But it's like I am just copying and pasting, is this wrong? How should I learn this? It seems a bit harder than just css. Cause there are many classes that are written by default.. I don't want to memorize. So is it good that I copy and paste when I need?
body .container-fluid {
padding: 0; /* the left and right side of body was a bit empty. When i did margin:0 padding:0 for the body it didn't work, but on google developer tools I saw that container-fluid had padding right, and left. So making them 0.*/
}
body {
text-align: center;
}
.title-image {
width:100%;
}
.download-button {
margin: 15px 13px;
}
.big-heading {
font-family: "Montserrat", "sans-serif";
font-weight: bold;
font-size: 2.2rem;
line-height:1.5;
margin-top: 70px;
}
.first_part {
color: white;
background-color: #F27E48;
text-align: left;
}
.container-fluid {
padding: 3% 3% 6% 5% !important;
}
.navbar-brand {
font-family: 'Ubuntu', sans-serif;
}
#courses {
padding:50px 100px 50px;
background-color: azure;
}
#courses>p{ /*only for child p of courses id, not grandchild etc */
width:60%;
margin: 18px auto 24px;
}
.card-body p{
text-align: left;
}
#how {
padding:50px 70px 50px;
background-color: rgb(243, 243, 178);
}
#how img {
height:280px;
width:330px;
}
.row div {
margin-top:10px;
}
.outcome {
width:70%;
margin:20px auto;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Science Course Web Page</title>
<link rel="stylesheet" href="styles.css">
<!-- Font Awesome CDN -->
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Montserrat&family=Noto+Serif&family=Ubuntu&display=swap" rel="stylesheet">
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
</head>
<body>
<section class="first_part" >
<div class="container-fluid">
<!--all of element appeared when i wrote navbar-expand-lg-->
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="#">
<i class="fab fa-python"> Python Bootcamp</i>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="#courses">Courses</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#how">How We Work</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#outcomes">Outcomes</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
</div>
</nav>
<!-- Title -->
<div class="row">
<div class="col-lg-6"> <!-- so it will fill 50% of width on screen of laptops, and bigger screens-->
<h1 class="big-heading">Download the best Python bootcamp on your device, and start to study now.</h1>
<button type="button" class="btn btn-lg btn-outline-danger download-button"><i class="fab fa-apple"></i> Download</button>
<button type="button" class="btn btn-lg btn-light btn-outline-primary download-button"><i class="fab fa-google-play"></i> Download</button>
</div>
<div class="col-lg-6">
<img class="title-image" src="image.jpg" alt="classroom-image">
</div>
</div>
</div>
</section>
<!-- Courses -->
<section id="courses">
<h2>Our Course Options</h2>
<p>All of our programs provide job guarantee. No matter where you live, and what nationality you are. Our proven system works all around the world.</p>
<div class="row">
<!-- for laptops and bigger screens one row takes 33.3% of total width, for small screens it takes 50% -->
<div class="col-lg-4 col-sm-6">
<div class="card">
<div class="card-header">
<h3>Online Program</h3>
</div>
<div class="card-body">
<h4>100$ / mo</h4>
<p>Unlimited watch time for the saved videos</p>
<p>5 mins talking to the instructor per day on skype</p>
<p>Unlimited limit of asking questions on the app</p>
<p>Must be finished in 6 months</p>
<button class="btn btn-lg btn-outline-dark col-12">Sign Up</button>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-6">
<div class="card">
<div class="card-header">
<h3>Full Time Program</h3>
</div>
<div class="card-body">
<h4>250$ / mo</h4>
<p>Unlimited watch time for the saved videos</p>
<p>20 mins talking to the instructor per day on skype</p>
<p>Unlimited limit of asking questions on the app</p>
<p>2 months</p>
<button class="btn btn-lg btn-outline-secondary col-12">Sign Up</button>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h3>Part Time Program</h3>
</div>
<div class="card-body">
<h4>175$ / mo</h4>
<p>Unlimited watch time for the saved videos</p>
<p>10 mins talking to the instructor per day on skype</p>
<p>Unlimited limit of asking questions on the app</p>
<p>4 months</p>
<button class="btn btn-lg btn-outline-dark col-12">Sign Up</button>
</div>
</div>
</div>
</div>
</section>
<!-- How we work -->
<section id="how">
<h2>How We Work</h2>
<div class="row">
<div class="col-lg-4 col-sm-6">
<p>One-on-one mentorship and guidance.</p>
<img src="coding.jpg" alt="coding-image">
</div>
<div class="col-lg-4 col-sm-6">
<p>Study schedules that fit with your life.</p>
<img src="clock.jpg" alt="coding-image">
</div>
<div class="col-lg-4">
<p>In-person meetups, workshops.</p>
<img src="meetup.jpg" alt="meetup-image">
</div>
</div>
</section>
<!-- Outcomes -->
<section id="outcomes">
<div class="outcome">
<!-- Tabs navs -->
<ul class="nav nav-tabs nav-justified" id="ex1" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" id="ex3-tab-1" data-mdb-toggle="tab" href="#ex3-tabs-1" role="tab" aria-controls="ex3-tabs-1" aria-selected="true">Full Time Program</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="ex3-tab-2" data-mdb-toggle="tab" href="#ex3-tabs-2" role="tab" aria-controls="ex3-tabs-2" aria-selected="false">Part Time Program</a>
</li>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="ex3-tab-3" data-mdb-toggle="tab" href="#ex3-tabs-3" role="tab" aria-controls="ex3-tabs-3" aria-selected="false">Online Program</a>
</li>
</ul>
<!-- Tabs Content-->
<div class="tab-content" id="ex2-content">
<div
class="tab-pane fade show active"
id="ex3-tabs-1"
role="tabpanel"
aria-labelledby="ex3-tab-1"
>
<p>$70,000</p>
<p>Median pay rate graduates reported earning.</p>
<p>80%</p>
<p>Employed in-field within 90 days of graduation.</p>
</div>
<div
class="tab-pane fade"
id="ex3-tabs-2"
role="tabpanel"
aria-labelledby="ex3-tab-2"
>
<p>$60,000</p>
<p>Median pay rate graduates reported earning.</p>
<p>75%</p>
<p>Employed in-field within 110 days of graduation.</p>
</div>
<div
class="tab-pane fade"
id="ex3-tabs-3"
role="tabpanel"
aria-labelledby="ex3-tab-3"
>
<p>$40,000</p>
<p>Median pay rate graduates reported earning.</p>
<p>65%</p>
<p>Employed in-field within 150 days of graduation.</p>
</div>
</div>
</div>
</section>
</body>
</html>
Example in Bootstrap5 docs says to use: data-bs-toggle, you have data-mdb-toggle. That should fix it for all your nav-links.
<a class="nav-link active" id="ex3-tab-1" data-bs-toggle="tab" href="#ex3-tabs-1" role="tab" aria-controls="ex3-tabs-1" aria-selected="true">Full Time Program</a>
https://getbootstrap.com/docs/5.0/components/navs-tabs/#base-nav
You have not added the javascript to do so.
Add this javascript to your code.
var triggerTabList = [].slice.call(document.querySelectorAll("#ex1 li a"));
triggerTabList.forEach(function (triggerEl) {
var tabTrigger = new bootstrap.Tab(triggerEl);
triggerEl.addEventListener("click", function (event) {
event.preventDefault();
tabTrigger.show();
});
});
Documentation: https://getbootstrap.com/docs/5.0/components/navs-tabs/#javascript-behavior
Codepen: https://codepen.io/manaskhandelwal1/pen/eYdLYdN
The script tag for bootstrap javascript should be added after the body tag and not in the head tag, sometimes this will also create problems.
And you don't have to learn any bootstrap classes, gradually you will learn them automatically.
If you want any other help comment it here I will help you as soon as possible 😃.
Everything is going great, but I don't see this right and left arrors in my slide show. What should I do to fix it? I did the exactly what is in bootstrap documentation. I tried to look at on google, but couldn't find anything related to this issue. I need your help with this issue, please.
(it still doesnt upload my post, so filling the blanks)
body .container-fluid {
padding: 0; /* the left and right side of body was a bit empty. When i did margin:0 padding:0 for the body it didn't work, but on google developer tools I saw that container-fluid had padding right, and left. So making them 0.*/
}
body {
text-align: center;
}
.title-image {
width:100%;
}
.download-button {
margin: 15px 13px;
}
.big-heading {
font-family: "Montserrat", "sans-serif";
font-weight: bold;
font-size: 2.2rem;
line-height:1.5;
margin-top: 70px;
}
.first_part {
color: white;
background-color: #F27E48;
text-align: left;
}
.container-fluid {
padding: 3% 3% 6% 5% !important;
}
.navbar-brand {
font-family: 'Ubuntu', sans-serif;
}
#courses {
padding:50px 100px 50px;
background-color: azure;
}
#courses>p{ /*only for child p of courses id, not grandchild etc */
width:60%;
margin: 18px auto 24px;
}
.card-body p{
text-align: left;
}
#how {
padding:50px 70px 50px;
background-color: rgb(243, 243, 178);
}
#how img {
height:280px;
width:330px;
}
.row div {
margin-top:10px;
}
.outcome {
width:70%;
margin:20px auto;
background-color: rgb(236, 223, 223) ;
border-radius: 8px;
}
.big {
font-weight: bold;
font-size: 2rem;
font-family: 'Noto Serif', serif;
}
#outcomes {
padding:50px 70px 50px;
}
#outcomes a{
border:1px solid black;
border-radius: 10px;
}
#outcomes a:hover {
color: white;
background-color: gray;
}
.student-image {
height: 350px;
width: 450px;
}
#comments {
padding: 50px 70px 50px;
background-color: azure;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Science Course Web Page</title>
<link rel="stylesheet" href="styles.css">
<!-- Font Awesome CDN -->
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Montserrat&family=Noto+Serif&family=Ubuntu&display=swap" rel="stylesheet">
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
</head>
<body>
<section class="first_part" >
<div class="container-fluid">
<!--all of element appeared when i wrote navbar-expand-lg-->
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="#">
<i class="fab fa-python"> Python Bootcamp</i>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="#courses">Courses</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#how">How We Work</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#outcomes">Outcomes</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#comments">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact</a>
</li>
</ul>
</div>
</nav>
<!-- Title -->
<div class="row">
<div class="col-lg-6"> <!-- so it will fill 50% of width on screen of laptops, and bigger screens-->
<h1 class="big-heading">Download the best Python bootcamp on your device, and start to study now.</h1>
<button type="button" class="btn btn-lg btn-outline-danger download-button"><i class="fab fa-apple"></i> Download</button>
<button type="button" class="btn btn-lg btn-light btn-outline-primary download-button"><i class="fab fa-google-play"></i> Download</button>
</div>
<div class="col-lg-6">
<img class="title-image" src="image.jpg" alt="classroom-image">
</div>
</div>
</div>
</section>
<!-- Courses -->
<section id="courses">
<h2>Our Course Options</h2>
<p>All of our programs provide job guarantee. No matter where you live, and what nationality you are. Our proven system works all around the world.</p>
<div class="row">
<!-- for laptops and bigger screens one row takes 33.3% of total width, for small screens it takes 50% -->
<div class="col-lg-4 col-sm-6">
<div class="card">
<div class="card-header">
<h3>Online Program</h3>
</div>
<div class="card-body">
<h4>400$ / mo</h4>
<p>Unlimited watch time for the saved videos</p>
<p>5 mins talking to the instructor per day on skype</p>
<p>Unlimited limit of asking questions on the app</p>
<p>6 months</p>
<button class="btn btn-lg btn-outline-dark col-12">Sign Up</button>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-6">
<div class="card">
<div class="card-header">
<h3>Full Time Program</h3>
</div>
<div class="card-body">
<h4>1300$ / mo</h4>
<p>Unlimited watch time for the saved videos</p>
<p>20 mins talking to the instructor per day on skype</p>
<p>Unlimited limit of asking questions on the app</p>
<p>2 months</p>
<button class="btn btn-lg btn-outline-secondary col-12">Sign Up</button>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h3>Part Time Program</h3>
</div>
<div class="card-body">
<h4>700$ / mo</h4>
<p>Unlimited watch time for the saved videos</p>
<p>10 mins talking to the instructor per day on skype</p>
<p>Unlimited limit of asking questions on the app</p>
<p>4 months</p>
<button class="btn btn-lg btn-outline-dark col-12">Sign Up</button>
</div>
</div>
</div>
</div>
</section>
<!-- How we work -->
<section id="how">
<h2>How We Work</h2>
<div class="row">
<div class="col-lg-4 col-sm-6">
<p>One-on-one mentorship and guidance.</p>
<img src="coding.jpg" alt="coding-image">
</div>
<div class="col-lg-4 col-sm-6">
<p>Study schedules that fit with your life.</p>
<img src="clock.jpg" alt="coding-image">
</div>
<div class="col-lg-4">
<p>In-person meetups, workshops.</p>
<img src="meetup.jpg" alt="meetup-image">
</div>
</div>
</section>
<!-- Outcomes -->
<section id="outcomes">
<div class="outcome">
<!-- Tabs navs -->
<ul class="nav nav-tabs nav-justified" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" id="fulltime-tab" data-bs-toggle="tab" href="#fulltime" role="tab" aria-controls="fulltime" aria-selected="true">Full Time Program</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="parttime-tab" data-bs-toggle="tab" href="#parttime" role="tab" aria-controls="parttime" aria-selected="false">Part Time Program</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="online-tab" data-bs-toggle="tab" href="#online" role="tab" aria-controls="online" aria-selected="false">Online Program</a>
</li>
</ul>
<!-- Tabs Content-->
<div class="tab-content" id="myTab-content">
<div
class="tab-pane fade show active"
id="fulltime"
role="tabpanel"
aria-labelledby="fulltime-tab"
>
<p class="big">$70,000</p>
<p class="small">Median pay rate graduates reported earning.</p>
<p class="big">80%</p>
<p class="small">Employed in-field within 90 days of graduation.</p>
</div>
<div
class="tab-pane fade"
id="parttime"
role="tabpanel"
aria-labelledby="parttime-tab"
>
<p class="big">$60,000</p>
<p class="small">Median pay rate graduates reported earning.</p>
<p class="big">75%</p>
<p class="small">Employed in-field within 110 days of graduation.</p>
</div>
<div
class="tab-pane fade"
id="online"
role="tabpanel"
aria-labelledby="online-tab"
>
<p class="big">$40,000</p>
<p class="small">Median pay rate graduates reported earning.</p>
<p class="big">65%</p>
<p class="small">Employed in-field within 150 days of graduation.</p>
</div>
</div>
</div>
</section>
<!-- Comments -->
<section id="comments">
<div id="carouselExampleControls" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<p>I took the fulltime program course. It was amazing. Up to date curriculum, and the best instructors in their field</p>
<img src="student1.jpg" class="student-image" alt="student-photo">
<em>Selena, Miami</em>
</div>
<div class="carousel-item">
<p>I took the part time program course, and I got full stack python developer job only in 20 days within graduation.</p>
<img src="student2.jpg" class="student-image" alt="student-photo">
<em>Anna, Moscow</em>
</div>
<div class="carousel-item">
<p>This course made me job ready. Don't waste time with other time wasting courses. This is what you have been looking for!</p>
<img src="student3.jpg" class="student-image" alt="student-photo">
<em>Taylor, Paris</em>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</a>
</div>
</section>
</body>
</html>
Background colour and button colour are white.
Either add a background color, like this:
#comments {
background-color: #ff0000;
}
Codepen: https://codepen.io/manaskhandelwal1/pen/yLaxyyV
or change the colour of the buttons, like this:
.carousel-control-prev-icon {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ff0000' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E") !important;
}
.carousel-control-next-icon {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ff0000' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E") !important;
}
For more info: https://stackoverflow.com/a/49017805/11171286
Codepen: https://codepen.io/manaskhandelwal1/pen/qBaMEdK
I have a materialize css web app with a side-nav.
In the side-nav there are two "sub-menus" as dropdown-content.
It works perfectly fine on all browsers except Safari/iOS, where a click in the sub-menu will open another link than the one clicked. Looks a little random, but maybe it selects the link below in the sidenav menu.
The really weird thing is, that it works on iPhone 5.
It also works on iPhone 7 but here comes the weird part: only if you make long-click (tap and hold) on the menu item, then it displays a preview of the link and you can select open. In that case it is the correct menu item from the drop-down content that is displayed.
I am very puzzled and is excited to see if anyone can see through this...
I have tried a few different css options besided the standard materialize css, they are included in the code.
(Version 1.0.0 of materialize)
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<style>
header, main, footer {
padding-left: 300px;
}
.hide-on-menu-out {
display: none;
}
/*https://github.com/Dogfalo/materialize/issues/1123 */
.navbar-fixed nav {
position: fixed;
/* width is 100% minus the fixed left navbar (240px) */
width: -moz-calc(100% - 300px); /* Firefox */
width: -webkit-calc(100% - 300px); /* Chrome, Safari */
width: calc(100% - 300px); /* IE9+ and future browsers */
}
.dropdown-content a {
/*background-color:red;*/
position:relative;
z-index: 10000 !important;
}
#media only screen and (max-width : 992px) {
header, main, footer {
padding-left: 0;
}
.show-on-menu-out {
display: block;
}
.hide-on-menu-out {
display: block;
}
/* https://github.com/Dogfalo/materialize/issues/1123 */
.navbar-fixed nav {
width: 100%;
}
}
</style>
<asp:ContentPlaceHolder ID="header" runat="server"></asp:ContentPlaceHolder>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FormBody" runat="server">
<ul id="langdrops" class="dropdown-content">
<asp:Literal ID="litLangs" runat="server"></asp:Literal>
</ul>
<ul id="dropFriends" class="dropdown-content">
<li><i class="material-icons blue-text">map</i><%=Resources.KSLab.KS2020WithMenu_menuFriendRadar%></li>
<li><i class="material-icons blue-text">people</i><%=Resources.KSLab.KS2020WithMenu_menuFriends%></li>
<li><i class="material-icons blue-text">search</i><%=Resources.KSLab.KS2020WithMenu_menuSearchFriends%></li>
<li><i class="material-icons blue-text">clear_all</i><%=Resources.KSLab.KS2020WithMenu_menuFriendReq%></li>
</ul>
<ul id="dropMore" class="dropdown-content">
<li><i class="material-icons blue-text">flag</i><%=Resources.KSLab.KS2020WithMenu_menuMultitrack%></li>
<li><i class="material-icons blue-text">supervised_user_circle</i><%=Resources.KSLab.KS2020WithMenu_menuGroups%></li>
<li><i class="material-icons blue-text">star</i><%=Resources.KSLab.KS2020WithMenu_menuChallenges%></li>
<li><i class="material-icons blue-text">timeline</i><%=Resources.KSLab.KS2020WithMenu_menuRouteMeas%></li>
</ul>
<header>
<div class="navbar-fixed">
<nav>
<div class="nav-wrapper blue">
<ul id="nav-mobile" class="left">
<!-- show-on-large show-on-extra-large -->
<li><i class="material-icons">menu</i></li>
<%--<li><i class="material-icons">language</i></li>--%>
</ul>
<span data-target="slide-out" style="cursor: pointer" id="navbarBoatName" class="sidenav-trigger center hide-on-menu-out"></span>
<a href="/" style="margin-top: 4px; margin-right: 5px;" class="right brand-logo">
<img style="height: 50px;" src="/Public/Images/LogoWhite150x57.png" /></a>
</div>
</nav>
</div>
<ul id="slide-out" class="sidenav sidenav-fixed blue">
<li>
<div class="user-view">
<div class="background">
<img src="/Public/Images/ocean.jpg">
</div>
<div id="notifyAlert" class="notifyAlert">
<a href="/notifications" class="btn-floating btn-large waves-effect pulse waves-light alert-red">
<i class="fa large fa-bell"></i></a>
</div>
<img id="menuBoatImage" class="circle" src="/Public/Images/noimage.png">
<div style="clear: both"></div>
<div id="menuBoatName" class="white-text name"></div>
<div id="menuBoatType" class="white-text email"> </div>
</div>
</li>
<li><i class="material-icons white-text">home</i><%=Resources.KSLab.KS2020WithMenu_menuHome%></li>
<li><i class="material-icons white-text">map</i><%=Resources.KSLab.KS2020WithMenu_menuMyLog%></li>
<li><i class="material-icons white-text">share</i><%=Resources.KSLab.KS2020WithMenu_menuShare%></li>
<li><i class="material-icons white-text">people</i><%=Resources.KSLab.KS2020WithMenu_menuSubFriends%></li>
<li><i class="material-icons white-text">filter_9_plus</i><%=Resources.KSLab.KS2020WithMenu_menuMore%></li>
<li><i class="material-icons white-text">settings</i><%=Resources.KSLab.KS2020WithMenu_menuMyProfile%></li>
<li>
<div class="divider"></div>
</li>
<li><i class="material-icons white-text">language</i><%=Resources.KSLab.generalSelectLanguage%></li>
<li><i class="material-icons white-text">help_outline</i><%=Resources.KSLab.KS2020WithMenu_menuHelp%></li>
<li><i class="material-icons white-text">info</i><%=Resources.KSLab.KS2020WithMenu_menuAbout%></li>
<li><i class="material-icons white-text">close</i><%=Resources.KSLab.KS2020WithMenu_menuLogOff%></li>
</ul>
</header>
<main>
<asp:ContentPlaceHolder ID="BelowMenu" runat="server"></asp:ContentPlaceHolder>
</main>
<asp:ContentPlaceHolder ID="OutsideMain" runat="server"></asp:ContentPlaceHolder>
</asp:Content>
I added inDuration, outDuration and closeOnClick options to fix this. Here are all my options for this particular example.
var dropdownOptionsMobile = {
coverTrigger: false,
inDuration: 0,
outDuration: 0,
hover: false,
closeOnClick: false
}
var elems = document.querySelectorAll('.dropdown-trigger-mobile');
var instances = M.Dropdown.init(elems, dropdownOptionsMobile);
It is a known issue, here you can read about it and the solution:
Select element is misbehaving on iOS
Shortly, the dropdown issue itself is caused by the animation. You can use the materialize-css-helper package to keep the animation and fix the issue, or just remove the animation through css:
.dropdown-content {
transform: none !important;
}
I have the same problem and I've founded out that it is a bug. They've already fixed it, but didn't released :(
Look here, there are some tips, like set closeOnClick to false
I have a div, and in that div, I have another div. I am trying to pin the inner div to the bottom of the outer div using specifically bootstrap classes, but I cant seem to find a bootstrap method to do this. I've also tried using just regular CSS, but cant get this working. I tried veritical-align: bottom; and setting the position to absolute.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="card-body">
<ul class="list-unstyled mt-3 mb-4" style="text-align: left;">
<li>stuff</li>
</ul>
<div>
<button type="button" class="btn btn-outline-primary">Edit</button>
<button type="button" class="btn btn-outline-primary">Delete</button>
</div>
</div>
To get it done using Bootstrap 4 classes, you just add the classes d-flex flex-column to the card-body and then add the mt-auto class (margin-top:auto) to the inner div like so:
<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="card-body d-flex flex-column">
<ul class="list-unstyled mt-3 mb-4" style="text-align: left;">
<li>stuff</li>
</ul>
<div class="mt-auto">
<button type="button" class="btn btn-outline-primary">Edit</button>
<button type="button" class="btn btn-outline-primary">Delete</button>
</div>
</div>
That will always keep the inner div pinned to the bottom.
Is this what you are trying to achieve??
.card-body {
border: 4px solid blue;
position: relative;
}
.inner {
border: 4px solid red;
position: absolute;
bottom: -50px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="card-body">
<ul class="list-unstyled mt-3 mb-4" style="text-align: left;">
<li>stuff</li>
</ul>
<div class="inner">
<button type="button" class="btn btn-outline-primary">Edit</button>
<button type="button" class="btn btn-outline-primary">Delete</button>
</div>
</div>
What's the best way to align these elements? I want to avoid using margin-top on the check mark icons to align them to the centerline of the buttons.
I Want To Avoid This
<div class="icon check" style="margin-top:11px;"></div>
Live example here:
JSFiddle
<div id="statusbar">
<div class="icon check"></div> <a class="btn inactive" href="">Button 1</a>
<div class="icon check"></div> <a class="btn inactive" href="">Button 2</a>
<div class="icon check"></div> <a class="btn inactive" href="">Button 3</a>
</div>
A good way is to set vertical-align:middle to the wrapper and using display:inline-block for the child like this:
<div id="statusbar">
<div class="icon check"></div> <a class="btn inactive" href="">Button 1</a>
<div class="icon check"></div> <a class="btn inactive" href="">Button 2</a>
<div class="icon check"></div> <a class="btn inactive" href="">Button 3</a>
</div>
.icon{
width:10px;
height:10px;
border:1px solid #000;
display: inline-block;
}
.inactive{
display: inline-block;
}
#statusbar{
height:auto;
vertical-align: middle;
}
DEMO
I would try setting the height of the checkbox icons to be equal to the button height, then centering the checkbox background image vertically. Depending on how the button height is set, this could be by font-size and line-height, or just a height. Then I'd use:
.icon {
background-position: 0 center;
}
Please share some of your CSS or a JSFiddle if that doesn't help.