I'm trying to recreate a card just like this one from WIX using bootstrap.
I have 2 problems:
Only at full screen the card touches the contact bar, when I reduce the size the card starts floating like this. (EDIT: solved this problem)
I would like the card to become vertical (text below photo) when the screen becomes to small. (EDIT: solved this problem)
UPDATE:
I still have a problem with responsiveness: when the screen becomes smaller my text doesn't fit nicely and the photo of my head is cut in half on the top like this on in Ipad and like this on a phone.
This is how a part of my html and css looks like:
.grid-container{
display: grid;
grid-template-rows: 580px 75px 405px;
width: 100vw;
}
.grid-item-contact{
background-color: #efefef;
display: grid;
grid-template-columns: 25% 50% 25%;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<!-- main container -->
<div class = "grid-container">
<!-- card with photo -->
<div class="grid-item-card">
<div class="card mb-3 mx-auto border-0" style="max-width: 50vw; margin-top: 10vh; margin-bottom: 0px; border-radius:5px 5px 0px 0px;">
<div class="row no-gutters">
<div class="col">
<img src="cat.jpg" class="card-img" alt="...">
</div>
<div class="col">
<div class="card-body">
<h5 class="card-title">Quinten KJ</h5>
<h6 class="card-text">Master student financial engineering</h6>
<p class="card-text">This is text</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
</div>
</div>
<!--contact bar -->
<div class="grid-item-contact">
<div class = "grid-item-contact-1"></div>
<div class = "grid-item-contact-2" style="background-color: #636769; text-align: center; border-radius:0px 0px 5px 5px;">
<img src="linkedin-6-32.png" style="margin-top: 20px;">
<img src="facebook-3-32.png" style="margin-top: 20px; margin-left: 20px;">
<img src="mail-32.png" style="margin-top: 20px; margin-left: 20px;">
</div>
<div class = "grid-item-contact-3"></div>
</div>
Please try this..
later i add the description for all..
Iam using col-md-6 instead of col for medium and small devices alignment. And order property use to change order of card text and card image. Some media queries(640px and 480px) used to align correct grid-container and also add some padding to grid-item-hello for small devices.
#import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght#400;700&display=swap');
/*--body--*/
body {
overflow-x: hidden;
font-family: 'Open Sans', sans-serif;
background-color: #efefef;
background-repeat:no-repeat;
}
/*--navbar--*/
.navbar{
text-transform: uppercase;
font-weight: 700;
font-size: .9rem;
letter-spacing: .1rem;
background: rgba(0, 0, 0, .6)!important;
}
.navbar-nav li {
padding-right: .7rem;
}
.navbar-dark .navbar-nav .nav-link {
color: white;
}
.navbar-dark .navbar-nav .nav-link:hover {
color: #bfbfbf;
}
/*-- slider --*/
.carousel-item {
height: 100vh;
width: 100vw;
min-height: 350px;
background: no-repeat center center scroll;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.carousel-caption{
position: absolute;
top: 68%;
}
.carousel-caption h2{
font-size: 2rem;
letter-spacing: .1rem;
text-shadow: .1rem .1rem .5rem black;
padding-bottom: 1rem;
}
.carousel-caption h5{
font-size: 1.5rem;
letter-spacing: .1rem;
text-shadow: .1rem .1rem .3rem black;
padding-bottom: 1.3rem;
}
.btn-lg{
border-width: medium;
font-size: 1.1rem;
}
/*--about--*/
.grid-container{
display: grid;
grid-template-rows: 520px 60px 310px;
width: 100vw;
}
.grid-item-card{
align-self: end;
}
.grid-item-contact{
background-color: #efefef;
display: grid;
/*--grid-template-columns: 490px 940px 490px;--*/
grid-template-columns: 15% 70% 25%;
}
.grid-item-hello{
background-color: #efefef;
text-align: center;
color: #636769;
}
.helloTitle{
margin-top: 90px;
margin-bottom: 20px;
}
.helloText{
margin-bottom: 10px;
}
#media only screen and (max-width: 640px) {
.grid-item-hello{
padding:0 20px;
}
.grid-container{
grid-template-rows: 680px 60px 300px;
}
}
#media only screen and (max-width: 480px) {
.grid-container{
grid-template-rows: 580px 60px 400px;
}
}
<!-- Based on Wix template: https://nl.wix.com/website-template/view/html/1893?siteId=31c9cc64-4739-437a-bf99-8a87fae88840&metaSiteId=7df46866-884d-4ed2-a9ea-b6f80df2ebaf&originUrl=https%3A%2F%2Fnl.wix.com%2Fwebsite%2Ftemplates%2Fhtml%2Fportfolio-cv -->
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link href="styles.css" rel="stylesheet">
<title>About</title>
</head>
<body style="background-image: url(https://images.unsplash.com/photo-1449157291145-7efd050a4d0e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1950&q=80);">
<!-- navbar -->
<nav class="navbar navbar-expand-lg navbar-dark fixed-top bg-dark">
<div class="container">
<a class="navbar-brand" href="index.html">Quinten KJ</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="about.html">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="cv.html">CV</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html" style="border-style: solid; border-width: medium; border-radius: 5px; margin-top: -4px;">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- main container -->
<div class="grid-container">
<!-- card with photo -->
<div class="grid-item-card">
<div class="card mx-auto border-0" style="max-width: 70vw; margin-top: 10vh; margin-bottom: 0px; border-radius:5px 5px 0px 0px;">
<div class="row">
<div class="col-lg-6 order-md-0 order-1 px-md-0">
<img src="https://images.unsplash.com/photo-1537815749002-de6a533c64db?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1445&q=80" class="card-img" alt="...">
</div>
<div class="col-lg-6 order-md-1 order-0 px-md-0">
<div class="card-body">
<h5 class="card-title">Quinten KJ</h5>
<h6 class="card-text">Master student financial engineering</h6>
<p class="card-text">This is text</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
</div>
</div>
<!--contact bar -->
<div class="grid-item-contact">
<div class="grid-item-contact-1"></div>
<div class="grid-item-contact-2" style="background-color: #636769; text-align: center; border-radius:0px 0px 5px 5px;">
<img src="https://image.flaticon.com/icons/svg/2111/2111723.svg" style="margin-top: 20px; height:36px;; width: 36px;">
<img src="https://image.flaticon.com/icons/svg/1051/1051360.svg" style="margin-top: 20px; margin-left: 20px; height:36px;; width: 36px;">
<img src="https://image.flaticon.com/icons/svg/1946/1946426.svg" style="margin-top: 20px; margin-left: 20px; height:36px;; width: 36px;">
</div>
<div class="grid-item-contact-3"></div>
</div>
<!--Hello-->
<div class="grid-item-hello">
<h3 class="helloTitle">Hello, I'm Quinten!</h3>
<p class="helloText">"I'm a greater believer in luck, and I find the harder I work the more I have of it" </p>
<p class="helloText">- Thomas Jefferson -</p>
<p class="helloText"></p>
<p class="helloText"></p>
<p class="helloText">I'm a master student financial engineering at the University of Antwerp.</p>
<p class="helloText"></p>
<p class="helloText"></p>
</div>
<!-- end main container-->
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
</body>
</html>
Related
Hello i have a landing page. I would like to set width of my header to the full page with bootstrap. I was trying to set it with container-fluid class but its not working. How to fix this? That it will be responsive and width set to the full page? Thanks for Help
Here is the code:
#import url('https://fonts.googleapis.com/css?family=Open+Sans&display=swap');
#import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght#0,200;0,400;0,700;0,900;1,600&display=swap');
#import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght#0,200;0,700;0,900;1,600&display=swap');
.raleway600 {
font-family: raleway, sans-serif;
font-weight: 600;
font-style: italic;
}
.raleway900 {
font-family: raleway, sans-serif;
font-weight: 900;
font-style: normal;
font-size: 4em;
}
* {
font-family: "Raleway", sans-serif;
}
body {
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
padding-top: 60px;
width: 98%;
font-family: "Raleway", sans-serif;
}
.navbar {
font-family: "Raleway", sans-serif;
}
.container {
padding-top: 10rem;
}
/* fix padding under menu after resize */
#media screen and (max-width: 767px) {
body {
padding-top: 60px;
}
}
#media screen and (min-width:768px) and (max-width: 991px) {
body {
padding-top: 110px;
}
}
#media screen and (min-width: 992px) {
body {
padding-top: 60px;
}
}
footer {
padding: 0;
margin: 0 auto;
position: relative;
background-color: rgb(11, 11, 11);
width: 100%;
}
.logo {
width: 7rem;
height: 7rem;
}
.navbar-brand {
margin-left: 17em !important;
}
#banner {
position: relative;
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("logo");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
height: 100%;
}
.hero-text {
text-align: center;
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
}
.row-fluid {
text-align: center;
justify-content: center !important;
}
.img-responsive {
margin: 0 auto
}
nav {
overflow: auto;
}
header {
height: 100vh;
}
.card-img-top {
width: 100%;
height: 15vw;
object-fit: cover;
}
<header>
<div id="banner" class="container-fluid baner p-0 ">
<div class="hero-text">
<h1 class="raleway900">"Text 1"</h1>
<p class="raleway600"><strong>Text 2</strong></p>
<p class="raleway600"><strong>Text 3</strong></p>
<p class="raleway600"><strong>Text 4</strong> </p>
<p class="raleway600"><strong>Text 5</strong> </p>
<button class="btn btn-primary raleway600">Button 1</button>
<button class="btn btn-outline-light raleway600">Button 2</button>
</div>
</div>
</header>
https://jsfiddle.net/j28qyhrw/1/
You can have it, hope it helps
<div class="header container-fluid d-flex justify-content-between align-items-center">
<div class="logo">Logo</div>
<nav class="nav">
<ul class="d-flex">
<li>
Link 1
</li>
<li>
Link 2
</li>
<li>
Link 3
</li>
<li>
Link 4
</li>
</ul>
</nav>
<div class="hamburger-menu-wrap ">
<span></span>
<span></span>
<span></span>
</div>
</div>
<header class="banner container-fluid border-bottom">
<div class="banner1">
<p>Header 1</p>
<p>Header 2</p>
<p>Header 3</p>
<p>Header 4</p>
</div>
</header>
<div class="main-container container-fluid">
<p>Content 1</p>
<p>Content 2</p>
<p>Content 3</p>
<p>Content 4</p>
<p>Content 5</p>
</div>
<footer class="footer container-fluid text-center">
<p class=" pb-0">Footer</p>
</footer>
/* header */
.header{ background-color: #2b2d3b; color: #fff; padding-top: 10px; padding-bottom: 10px; }
.header nav ul{ list-style-type: none; padding: 0; margin: 0; background-color: #2b2d3b; color: #fff; }
.header nav ul li{ list-style: none; padding:0 ; margin: 0 15px; color: #fff; }
.header nav ul li a{ color: #fff; }
/* hamburger menu */
.hamburger-menu-wrap {width: 24px;height: 16px;cursor: pointer;z-index: 1;display: none;}
.hamburger-menu-wrap span {background: #fff;display: block;height: 2px;margin-bottom: 6px;width: 100%;float: right;cursor: pointer !important;}
#media(max-width:991px){
.hamburger-menu-wrap{ display: block; }
.header nav{ display: none; }
.hamburger-open .header nav{ display: flex; }
.hamburger-open .header nav ul{ flex-direction: column!important; }
}
.footer{ background-color: #2b2d3b; color: #fff; padding-top: 10px; padding-bottom: 10px; }
Or check in jsfiddle example link :
https://jsfiddle.net/DeveloperSandip/u6ph27cx/4/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo01">
<a class="navbar-brand" href="#">Hidden brand</a>
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
<div class="container-fluid p-md-5 p-5 m-md-auto">
<div class="text-center" id="">
<img id="logo" style="pointer-events:none;" src="" class="img-fluid g-md-5 p-md-5" alt="">
</div>
</div>
</body>
</html>
try
Responsive containers allow you to specify a class that is 100% wide until the specified breakpoint is reached, after which we apply max-widths for each of the higher breakpoints. For example, .container-sm is 100% wide to start until the sm breakpoint is reached, where it will scale up with md, lg, xl, and xxl.Watch the screenshot
hope it will help you
Why do you use your own css for it? I don't have much experience yet, it's possible that I misunderstood. It is enough to insert the cdn in the head - I thought. Could it be that your css file conflicts with Bootstrap?
I am fairly new to coding and have a specific issue that I cannot figure out. I have a container that I want positioned differently based on the screen size. For large and mid-sized screens, I want the container left justified with a small amount of padding from the left edge, and on small screens, I want the container centered. I am using bootstraps, html, and css. See my style and code below. The container is overtop of a background image.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>Website Name</title>
<!-- MDB icon -->
<link rel="icon" href="img/mdb-favicon.ico" type="image/x-icon" />
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.2/css/all.css" />
<!-- Google Fonts Roboto -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght#300;400;500;700&display=swap" />
<!-- MDB -->
<link rel="stylesheet" href="css/mdb.min.css" />
</head>
<style>
#media (min-width: 100%) {
#intro {
min-width: 100%;
margin-right: none;
margin-top: -58.59px;
background-color: none;
}
}
.alfa {
position: absolute;
max-width: inherit;
margin-top: 55vh;
align-items: center;
justify-content: center;
background-color: white;
color: black;
border: lightgrey;
border-style: solid;
border-width: thin;
border-radius: 0em;
font-size: 1em;
padding: 1rem 1rem 1rem 1rem;
box-shadow: 0 0 20px black
}
.no-pad {
margin-right: 0rem;
margin-left: 0rem;
}
.navbar-brand {
margin-left: 1rem;
}
.nav-item {
margin-right: 1rem;
}
.row {
font-size: 1.5em;
}
.main-button {
display: inline-flex;
align-items: center;
justify-content: center;
}
#button1 {
font-size: 1.5em;
}
</style>
<body>
<!-- Header Bar -->
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="">My Accounting Exec</a>
<!--Toggle Button-->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<i title="" class="fa fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item text-center"><a class="nav-link" href="" style="color:white;">Services</a></li>
<li class="nav-item text-center"><a class="nav-link" href="" style="color:white;">Pricing</a></li>
<li class="nav-item text-center"><a class="nav-link" href="" style="color:white;">About</a></li>
<li class="nav-item text-center"><a class="nav-link" href="" style="color:white;">Contact</a></li>
</ul>
</div>
</nav>
</header>
<!-- Background-Image -->
<container>
<div class="bg-image" style="background-image: url('../MDB5-STANDARD-UI-KIT-Free-3.5.1/img/Accountant.jpg'); height: 89vh;">
<div class="Alert-Box text-center">
<div class="alfa text-center;">
<h5><b>Text Text Text</b></h5>
<div><button id="button1" type="button" class="btn btn-primary">WE ARE HERE FOR YOU!</button></div>
</div>
</div>
</div>
</container>
<!-- Service Links -->
<div class="row no-pad text-center">
<div class="col-lg-3 col-md-3 col-sm-12 d-flex align-items-center justify-content-center" style="border: solid .5px grey;
background-color: lightgrey;
height: 4.5rem;
padding: 0;">
</style>
<button href="" style="border: none; background-color: rgb(210, 210, 210); height: 100%; width: 100%; padding-left: 0mm;">
<b>Service 1</b></button>
</div>
<div class="col-lg-3 col-md-3 col-sm-12 d-flex align-items-center justify-content-center" style="border: solid .5px grey;
height: inherit;
background-color: lightgrey;
height:4.5rem;
padding: 0;">
</style>
<button href="" style="border: none; background-color: rgb(180, 180, 180);height: 100%; width: 100%; padding-left: 0mm;">
<b>Service 2</b></button>
</div>
<div class="col-lg-3 col-md-3 col-sm-12 d-flex align-items-center justify-content-center" style="border: solid .5px grey;
height: inherit;
background-color: lightgrey;
height:4.5rem;
padding: 0;">
</style>
<button href="" style="border: none; background-color: rgb(160, 160, 160); height: 100%; width: 100%; padding-left: 0mm;">
<b>Service 3</b></a>
</div>
<div class="col-lg-3 col-md-3 col-sm-12 d-flex align-items-center justify-content-center"
style="border: solid .5px grey;
height: inherit;
background-color: lightgrey;
height:4.5rem;
padding: 0;"></style>
<button href=""
style="border: none; background-color: rgb(140, 140, 140); height: 100%; width: 100%; padding-left: 0mm;">
<b>Service 4</b></a>
</div>
</div>
<!-- End your project here-->
<!-- MDB -->
<script type="text/javascript" src="js/mdb.min.js"></script>
<!-- Custom scripts -->
<script type="text/javascript"></script>
<!-- Bootstrap JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/#popperjs/core#2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.1/dist/js/bootstrap.min.js" integrity="sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT" crossorigin="anonymous"></script>
</body>
</html>
Without reading through all of your code, you need proper media queries that establish generalized rules and mobile only rules: ie
.container {
/* CODE TO LEFT ALIGN CONTENT + padding */
}
#media only screen and (max-width: 768px) {
.container {
/* CODE TO CENTER CONTENT*/
}
}
That way you can have generalized rules and target specific screen size treshholds.
Hope that makes sense for you.
I am in the middle of making an about section for my website then I encountered an issue where the section isn't covering the entire width of the page and nothing I found on other posts is working for me. I am using bootstrap5 if that helps.
* {
margin:0px;
padding:0px;
}
.navbar {
background: #131313;
padding: 1rem 8rem;
z-index: 1000;
}
.navbar-nav {
padding-right: 9%;
}
.navbar .navbar-brand {
font-size: 1.4rem;
font-weight: 700;
}
#navbarSupportedContent > ul > li:nth-child(n) > a {
color: #fff;
font-size: 1.1rem;
padding: 0 0.8rem;
}
#navbarSupportedContent > ul > li:nth-child(n) > a:hover {
color: grey;
}
#navbarSupportedContent > button {
outline: none;
background: rgb(197, 190, 190);;
font-weight: 600;
padding: 0.4rem 1.4rem;
border-radius: 30px;
}
#navbarSupportedContent > button:hover {
background: grey;
}
.mid {
height: 80vh;
width: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
text-align: center;
}
.mid video {
width: 100%;
height: 100%;
pointer-events: none;
object-fit: cover;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.hero {
position: relative;
}
.hero h2 {
font-weight: bold;
}
.mid .hero p {
width: 55%;
font-size: 1.1rem;
letter-spacing: 0.2px;
padding: 1.1rem;
}
.mid .hero a {
background: rgb(197, 190, 190);;
font-weight: 600;
padding: 1rem 2rem;
border-radius: 30px;
text-decoration: none;
}
.mid .hero a:hover {
background: grey;
}
.about {
background:#000;
}
.about .text {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
margin: auto;
}
.about .text h2 {
color: #F7F5F4;
font-weight: 700;
font-size: 2.7rem;
letter-spacing: 2px;
}
.about .text p {
color: #F7F5F4;
font-weight: 400;
font-size: 1.1rem;
letter-spacing: 0.5px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Talk Tech Teen Tech</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="#">Talk Tech Teen Tech</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mx-auto">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Listen</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Product Specs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Premium Techy</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Contact</a>
</li>
</ul>
<button class="btn btn-outline text-dark" type="submit">Sign Up</button>
</div>
</div>
</nav>
<div class="mid">
<video autoplay muted loop>
<source src="images/mic.mp4" type="video/mp4"><source>
</video>
<div class="hero text-center">
<h2 class="text-light display-4">Talk Tech Teen Tech</h2>
<p class="text-light mx-auto">This podcast talks about tech but through the eyes of grade school teens to get a different approach on the bleeding-edge of technology</p>
<a class= text-dark href="#">Start Listening</a>
</div>
</div>
</header>
<section class="about container py-5 my-5 mx-auto">
<div class="row align-items-center">
<div class="img col-lg-6 col-md-6 col-12 pt-5 pb-5">
<img class="img-fluid" src="images/mic.png">
</div>
<div class="text col-lg-6 col-md-6 col-12 pt-5 pb-5">
<h2>About Us</h2>
<p>Talk Tech Teen Tech is a podcast created by teens, made for the masses. In this podcast we talk about the bleeding edge of technology but through a teens perspective and what we think tech should be about and how companies handle technology. We talk about products from all sorts of companies (Apple, Samsung, OnePlus, Xiomi, Dell, Microsoft etc.). Our goal was to introduce another prespective of technology into the web and also to influence others that you don't need to be 30 to create a tech podcast, and with minimal gear you can create an amazing podcast!</p>
</div>
</div>
</section>
<script src="https://cdn.jsdelivr.net/npm/#popperjs/core#2.6.0/dist/umd/popper.min.js" integrity="sha384-KsvD1yqQ1/1+IA7gi3P0tyJcT3vR+NdBTt13hSJ2lnve8agRGXTTyNaBYmCR/Nwi" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta2/dist/js/bootstrap.min.js" integrity="sha384-nsg8ua9HAw1y0W1btsyWgBklPnCUAFLuTMS2G72MMONqmOymq585AcH49TLBQObG" crossorigin="anonymous"></script>
</body>
</html>
This is the Result
Any help would be greatly appreciated!
Wrapping your container with the section will most likely fix the problem.
Instead of writing this;
<section class="about container py-5 my-5 mx-auto">
try this:
<section class="about py-5 my-5">
<div class="container mx-auto">
You probably have a margin set around your container
Also your about styles should be set to width: 100%
It looks like the container class limits the max-width to be less than the full page width, see here: https://getbootstrap.com/docs/5.0/layout/containers/
Try adding width: 100%; to the about section CSS as you did to the CSS of .mid.
If this does not help, you can try width: 100% !important;, width: 100vw; and width: 100vw !important;.
Elements scale to the width of their parent. Is the element you're trying to draw the background on inside a body container that has some padding?
Been using bootstrap to try and have this section of my web page to display the images properly while shrinking the web page. They stay in line which is good, seems the col / row method with bootstrap really came thru; how can I get these to shrink with the page so that they may stay in formation longer, and look better overall when the web page has shrunk significantly?
the styles
h1 {
font-weight: bold;
font-size: 40px;
background-color: #4aaaa5;
padding: 15px;
color: #ffffff !important;
}
h2 {
font-size: 25px;
Color: #4aaaa5;
padding: 20px 20px 5px 20px;
}
#foot {
border-style: solid;
border-width: 10px 0px 0px 0px;
border-color: #4aaaa5;
padding-top: 20px;
color: #cccccc;
background-color: #666666;
text-align: center;
margin-top: auto;
}
.left {
display: inline-block;
position: relative;
padding: 0px;
margin: 20px;
}
h3{
position: absolute;
bottom: 5px;
font-size: 25px;
background-color: #4aaaa5;
padding: 15px 0px;
width: 100%;
color: #ffffff;
text-align: center;
}
body {
background-image: url("./hotel-wallpaper/hotel-wallpaper.png");
display: flex;
height: 100vh;
flex-direction: column;
}
.main{
display: block;
margin-top: 50px;
margin-bottom: 150px;
padding: 20px 20px 40px 20px;
background-color: #ffffff;
}
.borderr {
border-right: 2px solid #cccccc;
}
hr {
margin: 20px 0px 20px 0;
height: 1px;
border: 0px;
border-top: 3px solid #cccccc;
}
p {
margin-top: 20px;
line-height: 30px;
}
the html
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="./assets/reset.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="./assets/Style.css">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<title>Document</title>
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container col-xl-7 col-lg-8 col-md-9 col-sm-10">
<h1 class="navbar-brand"> My Name </h1>
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item borderr">
<a class="nav-link" href="./index.html"> About me <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active borderr">
<a class="nav-link" href="./portfolio.html">Portfolio</a>
</li>
<li class="nav-nav-link">
<a class="nav-link" href="./contact.html">
Contact
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<main>
<div class="main container col-xl-7 col-lg-8 col-md-9 col-sm-10">
<h2> Portfolio </h2>
<hr>
<div class="row">
<div class="left">
<img src="https://www.peta.org/wp-content/uploads/2017/05/Kenny-4-602x399.jpg" alt="White Liger" width="100%" height="100%"
style="max-width: 300px; max-height: 200px;">
<h3> liger </h3>
</div>
<div class="left">
<img src="https://twistedsifter.files.wordpress.com/2012/01/savannah_cat_closeup.jpg?w=800&h=507&zoom=2"
alt="Savannah" width="100%" height="100%" style="max-width: 300px; max-height: 200px;">
<h3>Savannah</h3>
</div>
<div class="left">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/35/XJ-B1_Beefalo.jpg/1920px-XJ-B1_Beefalo.jpg"
alt="Beefalo" width="100%" height="100%" style="max-width: 300px; max-height: 200px;">
<h3> Beefalo </h3>
</div>
<div class="left">
<div class="pic">
<img src="https://shoeuntied.files.wordpress.com/2017/12/rama2.jpg" alt="Cama" width="100%" height="100%" style="max-width: 300px; max-height: 200px;">
<h3>Lama camel</h3>
</div>
</div>
<div class="left">
<img src="https://i0.wp.com/metro.co.uk/wp-content/uploads/2018/11/sei_38307333-0b17.jpg?quality=90&strip=all&zoom=1&resize=644%2C471&ssl=1"
alt="Zonkey" width="100%" height="100%" style="max-width: 300px; max-height: 200px;">
<h3> Zonkey</h3>
</div>
</div>
</div>
</main>
<footer id="foot">
Copyright ©
</footer>
</body>
</html>
Thanks -
use Col-md-(media-dependent-length) for setting up row div length with image width full to 100%
Check Bootstrap Docs
Add class="img-fluid" to the image tag as :
<img class="img-fluid">
This will make images responsive which therefore shrink and expand based on the window size. Also, setting max-height and max-width as per your code will fix the max size.
But while shrinking the window size, it will reduce the size.
Regarding the images, refer this link from the official documentation of bootstrap.
can someone help me with my problem? I don't know how to diagnose this disfunction.
I'm building website and i have a problem with a full screen image at the beggining of my site.
When i try responsive mode in chrome and i change size to ipad size or any other mobile all is pretty ok but on my ipad image is not working properly on safari and even on chrome. When i launch site with only this img without rest of my code it works on ipad so problem can be everything...
How it looks on tablet: (imgur link)
and here is how i want to make it look: http://testwebsite.orkiestramp.pl/
or you can check on photo:
How it looks on computer (chrome etc.) (imgur link)
Here is code:
body {
font-family: 'Lato', sans-serif;
}
/* START HEADER (COUPLE PHOTO)*/
#header-slider {
background: url("https://images.unsplash.com/photo-1505150099521-fde7970bcc3a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80") center;
height: 100vh;
/* width: 100%/vm? Problems.*/
background-size: cover;
display: flex;
align-items: center;
justify-content: center;
background-attachment: fixed;
}
.first, .second{
text-align: center;
color: white;
font-style: italic;
}
.first {
margin-top: 40vh;
font-size: 6vw;
}
.second {
font-size: 4vw;
}
/* END HEADER (COUPLE PHOTO)*/
.header-text {
text-align: center;
font-family: 'Alex Brush';
font-size: 2.5em;
padding-top: 0.7em;
}
h2.header-text {
color: #f14e78;
}
/* .pre-main {
text-align: center;
} */
/* START MAIN (MAPS, DATES)*/
.main-page {
display: flex;
justify-content: space-evenly;
align-items: center;
text-align: center;
flex-wrap: wrap-reverse;
padding: 1.8em;
}
.main-text {
color: #f14e78;
font-family: 'Alex Brush';
font-size: 2em;
}
iframe {
height: 20em;
width: 100%;
}
a{
text-decoration: none;
color: #f14e78;
}
.main-left{
flex-basis: 20%;
}
.main-right {
flex-basis: 50%;
}
/* END MAIN (MAPS, DATES)*/
/* START FOOTER*/
.footer {
background-color:#333333;
align-items: center;
display: flex;
font-size: 1.4em;
justify-content: center;
height: 150px;
}
/* BOOTSTRAP SLIDER */
#slider-images {
padding: 20px 130px;
}
/* BOOTSTRAP SLIDER END */
.footer p {
color: #ffffff;
font-size: 18px;
letter-spacing: 1px;
}
/* END FOOTER*/
/* Timeline START */
/* Timeline holder */
ul.timeline {
list-style-type: none;
position: relative;
padding-left: 1.5rem;
}
/* Timeline vertical line */
ul.timeline:before {
content: ' ';
background: #f14e78;
display: inline-block;
position: absolute;
left: 16px;
width: 4px;
height: 100%;
z-index: 400;
border-radius: 1rem;
}
li.timeline-item {
margin: 20px 0;
}
/* Timeline item arrow */
.timeline-arrow {
border-top: 0.5rem solid transparent;
border-right: 0.5rem solid #f14e78;
border-bottom: 0.5rem solid transparent;
display: block;
position: absolute;
left: 2rem;
}
/* Timeline item circle marker */
li.timeline-item::before {
content: ' ';
background: #f14e78;
display: inline-block;
position: absolute;
border-radius: 50%;
border: 3px solid #f14e78;
left: 11px;
width: 14px;
height: 14px;
z-index: 400;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}
/* END TIMELINE */
#media screen and (max-width: 1024px) {
.first {
font-size: 9vw;
}
.second {
font-size: 7vw;
}
.main-page {
flex-direction: column;
padding: 0.5em;
}
.main-right {
width: 100%;
}
#slider-images {
padding: 10px;
}
}
#supports (-ms-ime-align:auto) {
.main-left{
flex-basis: 30%;
}
.main-right {
flex-basis: 70%;
}
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wesele Dorota & Marcin</title>
<meta name="description" content="Niezbedne informacje dla gosci na temat wesela Doroty i Marcina"/>
<meta name="author" content="Bendzi" />
<link rel="stylesheet" href="normalize.css">
<link rel="stylesheet" href="style.css">
<link rel="shortcut icon" href="image/favicon.png" type="image/x-icon"/>
<link href='https://fonts.googleapis.com/css?family=Alex Brush' rel='stylesheet'>
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
<!-- Bootstrap example slider -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</head>
<body>
<section id="header-slider">
<div class="header-text">
<h1 class ="first">Dorota & Marcin</h1>
<h1 class="second">27 luty 2021</h1>
</div>
</section>
<!-- <h2 class="header-text">Pobieramy sie!</h2>
<div class="pre-main">
<p>Jesteśmy bardzo podekscytowani, że możemy spędzić ten wyjątkowy dla nas dzień właśnie z Wami - naszymi bliskimi.</p>
</div>-->
<h2 class="header-text">Kiedy i gdzie?</h2>
<section class ="main-page">
<div class="main-left">
<img class="ceremoney png" src="image/Ceremoney.png" alt="ceremoney.png">
<h3 class="main-text">Ceremonia</h3>
<p>27 sluty 2021</p>
<p><b>15:00</b></p>
Sanktuarium Św. Michała Archanioła <br> i Bł. Bronisława Markiewicza
<p>ul. Ks. Markiewicza 25 <b>Miejsce Piastowe</b></p>
</div>
<div class="main-right">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d24584.395338500635!2d21.772600937713957!3d49.63326377402741!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x473c47a53cce9511%3A0x8b648ba7242fd980!2sSanktuarium%20%C5%9Aw.%20Micha%C5%82a%20Archanio%C5%82a%20i%20B%C5%82.%20Bronis%C5%82awa%20Markiewicza%20w%20Miejscu%20Piastowym%20-%20Michalici!5e0!3m2!1spl!2spl!4v1577625015874!5m2!1spl!2spl"></iframe>
</div>
</section>
<section class ="main-page">
<div class="main-left">
<img class="wedding png" src="image/Wedding.png" alt="wedding.png">
<img class="bed png" src="image/Bed.png" alt="bed.png">
<h3 class="main-text">Wesele i nocleg</h3>
<p>21 sluty 2021</p>
<p><b>16:30</b></p>
Kompleks Rekreacyjno - Rozrywkowy DWA - SERCA
<p>ul. Bieszczadzka 80 <b>Krosno</b></p>
</div>
<div class="main-right">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d29233.65083701806!2d21.76895992061611!3d49.637073691267375!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x473c46253abe1567%3A0xc8612fafb0d56ccb!2sKompleks%20Rekreacyjno%20-%20Rozrywkowy%20DWA%20-%20SERCA!5e0!3m2!1spl!2sus!4v1577624991125!5m2!1spl!2sus"></iframe>
</div>
</section>
<h2 class="header-text">Nasza historia</h2>
<!-- TIMELINE BOOTSTRAP -->
<div class="container py-5">
<div class="row">
<div class="col-lg-7 mx-auto">
<ul class="timeline">
<li class="timeline-item bg-white rounded ml-3 p-4 shadow">
<div class="timeline-arrow"></div>
<h2 class="h5 mb-0">Pierwszy spotkanie</h2><span class="small text-gray"><i class="fa fa-clock-o mr-1"></i>21 Marca, 2019</span>
<img style="width: 100%;" src="https://images.unsplash.com/photo-1505150099521-fde7970bcc3a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80">
</li>
<li class="timeline-item bg-white rounded ml-3 p-4 shadow">
<div class="timeline-arrow"></div>
<h2 class="h5 mb-0">Pierwsza podróż</h2><span class="small text-gray"><i class="fa fa-clock-o mr-1"></i>5 Września, 2019</span>
<img style="width: 100%;height: 100%;" src="https://images.unsplash.com/photo-1505150099521-fde7970bcc3a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80">
</li>
<li class="timeline-item bg-white rounded ml-3 p-4 shadow">
<div class="timeline-arrow"></div>
<h2 class="h5 mb-0">Pierwsze spotkanie</h2><span class="small text-gray"><i class="fa fa-clock-o mr-1"></i>18 Czerwca, 2019</span>
<img style="width: 100%;height: 100%;" src="https://images.unsplash.com/photo-1505150099521-fde7970bcc3a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80">
</li>
<li class="timeline-item bg-white rounded ml-3 p-4 shadow">
<div class="timeline-arrow"></div>
<h2 class="h5 mb-0">Pierwsza podróż</h2><span class="small text-gray"><i class="fa fa-clock-o mr-1"></i>10 Października, 2019</span>
<img style="width: 100%;height: 100%;" src="https://images.unsplash.com/photo-1505150099521-fde7970bcc3a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80">
</li>
</ul>
</div>
</div>
</div>
<!-- BOOTRTRAP EXAMPLE SLIDER -->
<section id="slider-images">
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="https://images.unsplash.com/photo-1505150099521-fde7970bcc3a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://images.unsplash.com/photo-1505150099521-fde7970bcc3a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://images.unsplash.com/photo-1505150099521-fde7970bcc3a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80" alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</section>
<section class="footer">
<p>Dorota: 823 123 123<br> Marcin: 783 213 212</p>
</section>
</body>
</html>
I believe the problem is here on your #header-slider :
background-attachment: fixed;
Can you try without this line ? If it's ok, there are ways to make iPads not compute some rules.
I hope this will work for you! I know I had your problem a long time ago, please tell me. :)