Alternative to make a div full screen - html

.pop-up {
z-index: 10;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: 90vh;
width: 50vw;
max-width: 80%;
background-color: #132c23;
border: 5px solid #fffbce;
border-radius: 20px;
}
.wrap-pop-up-div {
height: 100%;
width: 100%;
position: relative;
}
.pop-carousel {
position: absolute;
top: 12.5%;
left: 30%;
}
.close-modal {
position: absolute;
right: 5%;
top: 2%;
outline: none;
background: none;
cursor: pointer;
border: none;
font-size: 3rem;
color: #fffbce;
}
.close-modal:hover {
color: #510000;
transition-duration: 300ms;
}
.pop-carousel .container-carousel {
overflow: hidden;
width: 600px;
height: auto;
}
.pop-carousel .slides {
display: flex;
align-items: center;
align-content: center;
}
.pop-carousel img {
width: 600px;
height: 400px;
flex-shrink: 0;
}
.list-pop-up {
position: relative;
left: 2%;
top: 15%;
}
.pop-up ul {
padding: 0px;
list-style: none;
font-family: rochester;
font-size: 1.8rem;
}
.pop-up ul a {
color: #fffbce;
text-decoration: none;
}
.pop-up ul a:hover {
color: #4c8d49;
text-decoration: underline;
transition-duration: 350ms;
}
.pop-up ul a.active {
color: #4c8d49;
text-decoration: underline;
}
.pop-up ul li {
padding: 10px 0;
}
.wrap-pop-up-div > .para-div,
.wrap-pop-up-div > a {
position: absolute;
top: 70%;
}
.wrap-pop-up-div > .para-div {
left: 30%;
width: 600px;
text-align: justify;
font-size: 1.2rem;
color: #fffbce;
}
.wrap-pop-up-div > a {
left: 7.5%;
top: 80%;
text-decoration: none;
color: #fffbce;
font-size: 1.3rem;
border: 2px solid #fffbce;
padding: 5px 7.5px;
border-radius: 5px;
}
.wrap-pop-up-div > a:hover {
border-color: #510000;
background-color: #510000;
transition-duration: 200ms;
-webkit-transition-duration: 200ms;
}
.overlay {
background-color: rgba(0, 0, 0, 0.5);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 5;
}
#media (max-width: 950px) {
.pop-up {
height: 100%;
width: 100%;
position: fixed;
top: 0;
left: 0;
}
}
<div class="pop-up" >
<div class="wrap-pop-up-div show-toggle">
<button class="close-modal">×</button>
<div class="list-pop-up">
<ul>
<li>
<a class="active" href="#">
Badeparadies
</a>
</li>
<li>
<a href="#">
Trieberger Wasserfälle
</a>
</li>
</ul>
</div>
<div class="pop-carousel">
<div class="container-carousel">
<i class="fas fa-arrow-left prevBtn"></i>
<i class="fas fa-arrow-right nextBtn"></i>
<div class="slides">
<img
src="../source/img/gen-info/Rooms/bspForRooms.jpg"
alt="roomForThree"
/>
<img
src="../source/img/gen-info/Rooms/bspForRooms.jpg"
alt="roomForThree"
/>
</div>
</div>
</div>
<div class="para-div">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Unde aliquid consectetur sit optio eius consequuntur porro similique ducimus magni id, sint, aut fugiat aliquam ab magnam facere ipsum cupiditate autem incidunt tenetur possimus excepturi accusantium nostrum. At fugiat ex natus ea ut id voluptates, vero, similique perferendis expedita tenetur esse.</p>
</div>
<a class="box-shadower" href="#">Buchen</a>
</div>
<div class="wrap-pop-up-div show-toggle">
<button class="close-modal">×</button>
<div class="list-pop-up">
<ul>
<li>
<a href="#">
Badeparadies
</a>
</li>
<li>
<a class="active" href="#">
Trieberger Wasserfälle
</a>
</li>
</ul>
</div>
<div class="pop-carousel">
<div class="container-carousel">
<i class="fas fa-arrow-left prevBtn"></i>
<i class="fas fa-arrow-right nextBtn"></i>
<div class="slides">
<img
src="../source/img/gen-info/Rooms/bspForRooms.jpg"
alt="roomForThree"
/>
<img
src="../source/img/gen-info/Rooms/bspForRooms.jpg"
alt="roomForThree"
/>
</div>
</div>
</div>
<div class="para-div">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Unde aliquid consectetur sit optio eius consequuntur porro similique ducimus magni id, sint, aut fugiat aliquam ab magnam facere ipsum cupiditate autem incidunt tenetur possimus excepturi accusantium nostrum. At fugiat ex natus ea ut id voluptates, vero, similique perferendis expedita tenetur esse.</p>
</div>
<a class="box-shadower" href="#">Buchen</a>
</div>
</div>
</div>
<div class="overlay show-toggle"></div>
I have some modals, which should pop up in full screen at 950px (max-width). Thus I implemented a media query but it does not work. Does anyone know an alternative way? I also tried to on my pop-up class a 100vw but this had no effect at all. Perhaps someone has an idea why? The code I post here is basically the way how I did it for my background of the modal (the greyish overlay), so it worked for me in this document already, seems odd that it isn't working now.
CSS:
#media (max-width: 950px) {
.pop-up {
height: 100%;
width: 100%;
position: fixed;
top: 0;
left: 0;
}
}
HTML:
<div class="pop-up" >
<div class="wrap-pop-up-div show-toggle">
<button class="close-modal">×</button>
<div class="list-pop-up">
<ul>
<li>
<a class="active" href="#">
Badeparadies
</a>
</li>
<li>
<a href="#">
Trieberger Wasserfälle
</a>
</li>
</ul>
</div>
<div class="pop-carousel">
<div class="container-carousel">
<i class="fas fa-arrow-left prevBtn"></i>
<i class="fas fa-arrow-right nextBtn"></i>
<div class="slides">
<img
src="../source/img/gen-info/Rooms/bspForRooms.jpg"
alt="roomForThree"
/>
<img
src="../source/img/gen-info/Rooms/bspForRooms.jpg"
alt="roomForThree"
/>
</div>
</div>
</div>
<div class="para-div">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Unde aliquid consectetur sit optio eius consequuntur porro similique ducimus magni id, sint, aut fugiat aliquam ab magnam facere ipsum cupiditate autem incidunt tenetur possimus excepturi accusantium nostrum. At fugiat ex natus ea ut id voluptates, vero, similique perferendis expedita tenetur esse.</p>
</div>
<a class="box-shadower" href="#">Buchen</a>
</div>
<div class="wrap-pop-up-div show-toggle">
<button class="close-modal">×</button>
<div class="list-pop-up">
<ul>
<li>
<a href="#">
Badeparadies
</a>
</li>
<li>
<a class="active" href="#">
Trieberger Wasserfälle
</a>
</li>
</ul>
</div>
<div class="pop-carousel">
<div class="container-carousel">
<i class="fas fa-arrow-left prevBtn"></i>
<i class="fas fa-arrow-right nextBtn"></i>
<div class="slides">
<img
src="../source/img/gen-info/Rooms/bspForRooms.jpg"
alt="roomForThree"
/>
<img
src="../source/img/gen-info/Rooms/bspForRooms.jpg"
alt="roomForThree"
/>
</div>
</div>
</div>
<div class="para-div">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Unde aliquid consectetur sit optio eius consequuntur porro similique ducimus magni id, sint, aut fugiat aliquam ab magnam facere ipsum cupiditate autem incidunt tenetur possimus excepturi accusantium nostrum. At fugiat ex natus ea ut id voluptates, vero, similique perferendis expedita tenetur esse.</p>
</div>
<a class="box-shadower" href="#">Buchen</a>
</div>
</div>
</div>
<div class="overlay show-toggle"></div>

You have
max-width: 80%;
transform: translate(-50%, -50%);
in your style for pop-up. Change your css to
#media (max-width: 950px) {
.pop-up {
height: 100%;
width: 100%;
position: fixed;
top: 0;
left: 0;
max-width: 100%;
transform: translate(0, 0);
}
}

.pop-up {
transform: translate(-50%, -50%);
max-width: 80%;
border: 5px solid #fffbce;
border-radius: 20px;
}
messes up your popup if your media query is active. Add
#media (max-width: 950px) {
.pop-up {
transform: none;
max-width: 100%;
border: none;
border-radius: 0;
}
}
as well and it should be good.

Related

Why does the width of my web page not fill the entire screen width?

I have the majority of my code wrapped in a container with the following style:
.container {
position: relative;
width: 100%;
height: 100vh;
overflow: auto;
padding-left: 0;
padding-right: 0;
scroll-behavior: smooth;
scroll-snap-type: y mandatory;
}
This is to enable me to scroll smoothly from one section of the page that takes up a height of 100vh to another. (That is why I have overflow: auto in my styling). However, when I add the "overflow: auto", the web page stops being the full width of my window (as shown in the image).
screenshot of problem
When I remove the "overflow: auto" and replace it with "overflow: none", then the width is fixed but my scrolling feature now longer works.
HTML Code here:
<body class="container-fluid">
<!-- Main Page -->
<div class="container">
<div class="section">
<div class="main row vertical-center">
<div class="main-image col-md-6">
<img src="rec/img/placeholder-image.png" alt="client_image">
</div>
<div class="main-text align-items-center col-md-6">
<h2 class="p-3">
Name Lastname
</h2>
<span class="align-bottom bottom-text-main">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatem corporis nostrum illo? Vero necessitatibus accusamus ullam commodi, consequatur corrupti. Recusandae eligendi eaque possimus minima numquam dignissimos cumque adipisci tempora temporibus.
</span>
</div>
<span id="contact">
<!-- <ul class="contact-icons" style="list-style-type:none;">
<li></li></li>
<li></li>
<li></li>
</ul> -->
<i></i>
<i></i>
<i></i>
</span>
</div>
</div>
<!-- Information -->
<div class="section info">
<div class="information p-4 pb-0" id="information">
<h1 >More about me.</h1>
<br>
<div class="background ml-3">
<h5 class = "pb-1">Background</h5>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Corrupti facilis, est distinctio esse temporibus sint animi sunt veniam asperiores commodi quo numquam excepturi nemo ab, harum, nam possimus quas veritatis!</p>
</div>
<div class="skills ml-3">
<h5 class="pb-1">Skills</h5>
<ul>
<li>Skill</li>
<li>Skill</li>
<li>Skill</li>
<li>Skill</li>
<li>Skill</li>
</ul>
</div>
</div>
</div>
<!-- Experience -->
<div class="section">
<div class="experience p-3" id="experience">
<h1 class="pt-3">Work experience</h1>
<br>
<div class="xp">
<div class="workxp p-3 ml-3">
<h4 class = "pb-2">Lorem, ipsum.</h4>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Laborum, aliquid. Quidem, quae dolorem! Amet ea obcaecati nam quia aliquid, facilis dolorem ab velit optio. Accusamus quidem commodi rerum itaque incidunt?
</div>
<div class="workxp p-3 ml-3">
<h4 class = "pb-2">Lorem, ipsum.</h4>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus aperiam veritatis eos illo quo necessitatibus omnis illum iure impedit debitis, consectetur voluptatum quisquam, quae temporibus veniam. In minima quos perferendis.
</div>
<div class="workxp p-3 ml-3">
<h4 class = "pb-2">Lorem, ipsum.</h4>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illo officiis alias architecto non iure, quia labore rem. Totam nulla qui exercitationem beatae, ab aperiam! Asperiores soluta nisi repudiandae odit doloribus.
</div>
</div>
</div>
</div>
<!-- Additional Inforation -->
<div class="section">
<div class="additional-info p-3" id="additional-info">
<h1>Additional Information</h1>
<!-- <h1 class="second-line-info">Information</h1> -->
<div class="additional-info-text text-left">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, pariatur!</p>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Praesentium, pariatur at. Fuga error impedit officiis!</p>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Dolor facilis tempora odit vel cum adipisci, aut ducimus illum ab tenetur quae temporibus non. Velit rerum ipsa quis, sint blanditiis doloremque repellendus aliquid eius amet exercitationem!</p>
<p>Lorem ipsum dolor sit amet.</p>
<p>Lorem, ipsum dolor.</p>
</div>
</div>
</div>
<!-- Footer -->
<div class="section" id="footer">
<footer class="page-footer font-small blue pt-4">
<div class="container-fluid text-center text-md-left">
<div class="row">
<div class="col-md-6 mt-md-0 mt-3">
<h5 class="text-uppercase">Name Lastname</h5>
<p>Cliche Inspiritional Quote Here</p>
</div>
<!-- Grid column -->
<hr class="clearfix w-100 d-md-none pb-3">
<!-- Grid column -->
<div class="col-md-6 mb-md-0 mb-9">
<!-- Links -->
<h5 class="text-uppercase">Contact Links</h5>
<ul class="list-unstyled">
<li>
<i> Facebook</i>
</li>
<li>
<i> Instagram</i>
</li>
<li>
<i> Email</i>
</li>
</ul>
</div>
<!-- Grid column -->
</div>
<!-- Grid row -->
</div>
<!-- Footer Links -->
</footer>
</div>
</div>
Here is the CSS file:
body {
color: var(--grey);
width: 100%;
padding: 0;
margin: 0;
min-width: fit-content;
}
.container {
position: relative;
width: 100vh;
height: 100vh;
overflow: visible;
padding-left: 0;
padding-right: 0;
scroll-behavior: smooth;
scroll-snap-type: y mandatory;
}
.container .section {
position: relative;
height: 100%;
width: 100%;
scroll-snap-align: start;
/* background-blend-mode: multiply; */
}
/* .container.section:nth-child(1) {
background: ;
background-size: cover;
background-attachment: fixed;
} */
.main {
background-color: var(--white);
padding-left: 0%;
padding-right: 0%;
margin-top: 0rem;
margin-bottom: 0rem;
height: 100vh;
}
.main-image {
padding-top: 0%;
margin-left: 0%;
padding-right: 0;
margin-bottom: 2rem;
height: 50%;
}
.main-image img {
height: 100%;
width: 100%;
margin-left: 0%;
margin-right: 0%;
}
.main-text {
padding-bottom: 2rem;
height: 50%;
/* margin-left: 5%;
margin-right: 5%; */
}
.main-text p {
vertical-align: middle;
}
.information {
background-color: var(--soft);
height: 100vh;
padding-top: 0;
}
.experience {
background-color: var(--white);
height: 100%;
}
.information h1 {
padding-top: 1rem;
}
.background {
padding-top: 3rem;
}
.skills ul {
list-style-type: none;
}
.skills {
padding-top: 3rem;
}
.additional-info {
background-color: var(--soft);
height: 100vh;
padding-top: 1rem;
}
.additional-info h1 {
color: var(--grey);
}
.second-line-info {
margin-left: 5rem;
}
.additional-info-text {
text-align: center;
padding-left: 2rem;
padding-right: 2rem;
}
.additional-info-text p {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
}
#footer {
height: 10vh;
}
.list-unstyled i {
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
#media only screen and (min-width: 600px) {
html {
width: 100%;
}
body {
width: 100%;
padding: 0;
}
.main {
padding-top: 0%;
width: 100%;
}
.vertical-center {
display: flex;
align-items: center;
}
.main-image {
height: 100%;
margin-top: 15%;
}
.main-image img {
border-radius: 50%;
height: 50%;
width: 75%;
}
.main-text {
height: 100%;
margin-top: 20%;
}
.main-text h2 {
margin-bottom: 3rem;
}
#contact {
position: absolute;
bottom: 2%;
right: 2%;
}
.contact-icons {
padding: 0;
font-size: 2em;
display: table-cell;
}
.fa {
padding-left: 1rem;
padding-right: 1rem;
text-align: center;
text-decoration: none;
border-radius: 50%;
}
.contact a {
display: inline-block;
width: 1.2em;
transition: all .2s ease-in-out;
}
a:hover {
text-decoration: none;
}
.additional-info {
text-align: left;
justify-content: left;
}
.additional-info-text p {
margin-top: 2rem;
}
/* BEVAN ONDER */
/* General */
body, html
{
width: 100%;
padding: 0;
margin:0;
}
.container{
width: 100%;
}
.container.section{
width: 100%;
}
/* Information page(s) */
.background{
padding-top: 2rem;
}
.skills{
padding-top: 2rem;
}
.background p{
width: 50%;
}
}
Is there a possible fix for this?
Use this css value
overflow:scroll
or
overflow:visible
Keeping them auto will let browser decide the overflow.
I personally never use auto value.
try this
overflow:scroll;
width:100vw
if didn't work please edit post and add html

Slick Carousel bigger width than parent element

I 've got the following code, and when I am viewing on mobile the Slick Carousel is bigger than the parent element and I couldn't fix it with any settings. I am using Boostrap as well.
<nav class="navbar fixed-top">
<div class="container">
<a class="navbar-brand" href="#">
<img src="/assets/Intech Logo.png" alt="INTECH DYNAMICS logo" />
</a>
</div>
</nav>
<div class="wrapper-section-1">
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-6 col-xl-6 col-xs-12 col-xm-12 d-flex justify-content-center imagine">
<img class="img img-fluid floating" src="/assets/Header Image.png" alt="Careers banner image" />
</div>
<div class="col-lg-6 col-md-6 col-xl-6 col-xs-12 col-xm-12 d-flex justify-content-center">
<div class="row">
<div class="col-lg-12 title">
<h1 class="text-title">CAREERS</h1>
</div>
<div class="col-lg-12 slide">
<div class="single-item slider slide">
<div>
<div class="font-italic">
Lorem ipsum dolor, sit amet consectetur adipisicing elit.
Illo at reiciendis architecto harum nihil culpa accusantium
saepe ut, tempore quibusdam ex odit magnam nemo accusamus
numquam consequatur? Praesentium, voluptates pariatur!</div>
<br>
<span class="font-weight-bold">Darius Opro</span><span class="font-weight-normal"> Full Stack
Programmer</span>
</div>
<div>
<div class="font-italic">
Lorem ipsum dolor, sit amet consectetur adipisicing elit.
Illo at reiciendis architecto harum nihil culpa accusantium
saepe ut, tempore quibusdam ex odit magnam nemo accusamus
numquam consequatur? Praesentium, voluptates pariatur!</div>
<br>
<span class="font-weight-bold">Cosmin Mihalache</span><span class="font-weight-normal"> Front End
Developer</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
The CSS looks like this:
.wrapper-section-1 {
font-family: IBMPlexSans-Medum;
color: white;
margin-top: 54px;
width: auto;
padding: 8vh;
background-image: linear-gradient(to right, #1c003b, #5216aa);
}
.img {
max-width: 70%;
height: auto;
}
.imagine {
padding: 30px 0 30px 0;
}
.title {
align-items: flex-end;
display: flex;
justify-content: flex-end;
}
.text-title {
margin-bottom: 2rem;
}
/* Slick Carousel */
.slick-prev:before,
.slick-next:before {
color: black;
}
.slick-slide {
transition: all ease-in-out 0.3s;
opacity: 0.2;
}
.slick-active {
opacity: 0.5;
}
.slick-current {
opacity: 1;
}
.slide {
width: 500px;
margin: 0;
text-align: right;
background-color: blue
}
/* Custom Arrows */
.prev-arrow {
position: absolute;
bottom: -50px;
left: 400px;
cursor: pointer;
}
.next-arrow {
right: 3px;
position: absolute;
bottom: -50px;
cursor: pointer;
}
/* Floating Animation */
.floating {
animation-name: floating;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
margin-left: 30px;
margin-top: 5px;
}
$(document).on("ready", function () {
$(".single-item").slick({
lazyLoad: "ondemand", // ondemand progressive anticipated
infinite: true,
settings: "unslick",
prevArrow:
'<span class="prev-arrow"><i class="fas fa-angle-left"></i></span>',
nextArrow:
'<span class="next-arrow"><i class="fas fa-angle-right"></i></span>',
});
});
I attached a photo to have a better idea of what is happening. I tried to give to the carousel padding, to set width in percentage with parent element but nothing worked.
Update: Pretty sure that JS has nothing to do with it but I attached anyway

How do I add a body of text above a slideshow without pushing it down?

I've created a slideshow inside a section tag using a div tag. I tried to add a body of text above the slideshow so I added another div tag above the div tag for the slideshow and it worked however, as I add text, it pushes the images in the slideshow down, cutting off the images in the slideshow. Is there a solution to this? Thank you
<!DOCTYPE html>
<html>
<head>
<title> AnimeExpoBd </title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<ul>
<li class="logo">ANIME EXPO LOGO</li>
<li class="navbar">HOME</li>
<li class="navbar"><a href=#gotoaboutus>ABOUT US</a></li>
<li class="navbar">SCHEDULE</li>
<li class="navbar">CONTACT US</li>
</ul>
</header>
<section class="feature-box opening">
<div id="gotoaboutus" class="about-us"><strong>ABOUT US</strong><p class="descpara">We aim to popularize and educate the Bangladesh public about Japanese anime and manga culture, as well as provide a forum to facilitate communication between professionals and fans. We're passionate about all things anime. We're here to help you discover hidden gems, learn more about new and current anime, find fan art and cosplay of all your faves, and get your opinions!</div>
<div class="Images"></div>
</section>
<section class="feature-box closing">
<div class="sched">Section A<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Eaque exercitationem ad sed enim maiores cum recusandae numquam quibusdam. Perferendis reiciendis ut tenetur dignissimos neque hic impedit optio quasi libero sunt. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Eligendi, ipsum? Exercitationem accusantium quaerat numquam architecto cum culpa magnam illo quos quod. Eligendi placeat repellendus perferendis veritatis ducimus iure maxime vero! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae rerum quia odit veniam natus consequuntur iste eum eos officiis ab optio sed itaque quasi possimus voluptatibus, velit est dolor quo. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quaerat nostrum in, quidem totam a atque obcaecati natus ratione quae rem ipsam sed hic laudantium enim aspernatur nemo cum, nobis eius.</p></div>
<div class="slidershow middle">
<div class="header">Header and Description</div>
<div class="slides">
<input type="radio" name="r" id="r1" checked>
<input type="radio" name="r" id="r2">
<input type="radio" name="r" id="r3">
<input type="radio" name="r" id="r4">
<input type="radio" name="r" id="r5">
<div class="slide s1">
<img src="images/1.jpg" alt="">
</div>
<div class="slide">
<img src="images/2.jpg" alt="">
</div>
<div class="slide">
<img src="images/3.png" alt="">
</div>
<div class="slide">
<img src="images/4.jpg" alt="">
</div>
<div class="slide">
<img src="images/5.jpg" alt="">
</div>
</div>
<div class="navigation">
<label for="r1" class="bar"></label>
<label for="r2" class="bar"></label>
<label for="r3" class="bar"></label>
<label for="r4" class="bar"></label>
<label for="r5" class="bar"></label>
</div>
</div>
</section>
<footer>footer</footer>
</body>
</html>
section.feature-box.closing {
margin: 5px;
padding: 10px;
height: 620px;
width: 1310px;
background-color: #34495e;
display: flex;
}
section.feature-box.closing div.slidershow div.header {
font-size: medium;
color: white;
padding-bottom: 20px;
text-align: center;
margin-top: 5px;
}
section.feature-box.closing div.sched {
width: 481px;
text-align: center;
color:black;
font-size: medium;
background-color: #c3edea;
}
section.feature-box.closing div.slidershow {
width: 700px;
height: 400px;
overflow: hidden;
}
section.feature-box.closing div.middle {
position: relative;
top: 68%;
left: 31%;
transform: translate(-50%, -50%);
}
section.feature-box.closing div.navigation {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
display: flex;
}
section.feature-box.closing div.navigation label.bar {
width: 50px;
height: 10px;
border: 2px solid #fff;
margin: 6px;
cursor: pointer;
}
section.feature-box.closing div.navigation label.bar:hover {
background-color: white;
}
input[name="r"]{
position: absolute;
visibility: hidden;
}
section.feature-box.closing div.slides {
width: 500%;
height: 100%;
display: flex;
background-size: 100%;
}
section.feature-box.closing div.slides div.slide {
width: 20%;
transition: 0.6s;
}
section.feature-box.closing div.slides div.slide img{
width: 100%;
height: 100%;
}
#r1:checked ~ .s1 {
margin-left: 0;
}
#r2:checked ~ .s1 {
margin-left: -20%;
}
#r3:checked ~ .s1 {
margin-left: -40%;
}
#r4:checked ~ .s1 {
margin-left: -60%;
}
#r5:checked ~ .s1 {
margin-left: -80%;
}
Try this :
section.feature-box.closing div.slidershow div.header {
font-size: medium;
color: white;
padding-bottom: 20px;
text-align: center;
margin-top: 5px;
position: absolute;
left: 40%;
}

Pure CSS responsive flipping boxes

I want to have some flipping boxes. On mouse over, the image flips and shows the text.
This works, but its not responsive (the 2nd row boxes ends over the previous row).
The problem is .f_contenedor height, but I want this to be responsive, so I'm using the "padding-top: 56%" property.
How can I make sure "f_contendor" height is the same as .face?
There is an example here http://bregna.org/flip.html
and this is the snippet. Is the same code, just the backgrounds are different.
.f_contenedor:hover .f_card {
transform: rotateY(180deg);
box-shadow: -5px 5px 5px #aaa;
}
.f_contenedor {
position: relative;
padding: 10px;
width: 50%;
height: auto;
z-index: 1;
float: left;
perspective: 1000;
box-sizing:border-box;;
}
.f_card {
width: 100%;
height: 100%;
transform-style: preserve-3d;
transition: all .3s linear;
}
#media (min-width: 768px) {
.f_contenedor {
width: 50%;
}
}
#media (min-width: 992px) {
.f_contenedor {
width: 30%;
}
}
.shadow {
-moz-box-shadow: 5px 5px 5px rgba(68, 68, 68, 0.6);
-webkit-box-shadow: 5px 5px 5px rgba(68, 68, 68, 0.6);
box-shadow: 5px 5px 5px rgba(68, 68, 68, 0.6);
}
.face {
background-size: cover;
background-repeat: no-repeat;
}
.face {
position: absolute;
width: 100%;
height: 0;
padding-top: 56%;
backface-visibility: hidden;
}
.face.back {
display: block;
transform: rotateY(180deg);
box-sizing: border-box;
height: 100%;
color: white;
text-align: center;
background-color: #aaa;
}
.face.back span {
margin-top: -56%;
padding: 12px;
display: block;
}
<!doctype html>
<html lang="es_MX">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" type="image/png" href="/favicon.png"/>
<title>Flip</title>
</head>
<body>
<div class="f_contenedor">
<div class="f_card" style="background-color: black">
<div class="back face text-center shadow">
<span>
<h1>WEB</h1>
<p>Accusantium delectus non quae. Aliquam delectus, dolorem ea id, inventore libero molestias numquam, porro quasi quibusdam reiciendis sequi soluta tenetur veniam voluptatem.
</p></span>
</div>
</div>
</div>
<div class="f_contenedor">
<div class="f_card">
<div class="front face shadow" style="background-color: orange">
</div>
<div class="back face text-center shadow">
<span>
<h1>CMS</h1>
<p>Accusantium delectus non quae. Aliquam delectus, dolorem ea id, inventore libero molestias numquam, porro quasi quibusdam reiciendis sequi.
</p></span>
</div>
</div>
</div>
<div class="f_contenedor">
<div class="f_card">
<div class="front face shadow" style="background-color : firebrick;">
</div>
<div class="back face text-center shadow">
<span>
<h1>THE GRID</h1>
<p>Accusantium delectus non quae. Aliquam delectus, dolorem ea id, inventore libero molestias numquam.
</p></span>
</div>
</div>
</div>
<div class="f_contenedor">
<div class="f_card">
<div class="front face shadow" style="background-color: green">
</div>
<div class="back face text-center shadow">
<span>
<h1>FLOWERS</h1>
<p>Ad, aperiam blanditiis dolorem dolorum ea earum ipsam laboriosam molestias non odio provident .
</p></span>
</div>
</div>
</div>
<div class="f_contenedor">
<div class="f_card">
<div class="front face shadow" style="background-color: yellow">
</div>
<div class="back face text-center shadow">
<span>
<h1>DRINKS</h1>
<p>Accusamus animi earum enim ex impedit nesciunt nihil quod quos vel? Dolores fugit harum modi placeat quasi quam?
</p></span>
</div>
</div>
</div>
<div class="f_contenedor">
<div class="f_card">
<div class="front face shadow" style="background-color: greenyellow">
</div>
<div class="back face text-center shadow">
<span>
<h1>MURALS</h1>
<p>Aperiam aut consequuntur nostrum rem similique temporibus veritatis.
</p></span>
</div>
</div>
</div>
</body>
</html>
You could slightly adjust your CSS so that the .back face is exclusively positioned with absolute, and aligned to the top of the parent. Additionally, you would want to adjust the .face to be relatively positioned.
So something along these lines:
.face {
/* position: absolute; Remove this */
position:relative; /* Position the face relatively by default */
width: 100%;
height: 0;
padding-top: 56%;
backface-visibility: hidden;
}
.face.back {
position:absolute; /* For back faces, these should be positioned with absolute */
top:0; /* Align back faces with the top of the parent */
display: block;
transform: rotateY(180deg);
box-sizing: border-box;
height: 100%;
color: white;
text-align: center;
background-color: #aaa;
}

align images horizontally with overflow hidden

I want to make an image slider with thumbnail images to select from, my idea is allign all images horizontally and hide overfolwn than with javascript i will just change the left postion to display the needed thumbnail, but I couldn't figure out how to css images to align hrizontally and hide the part that goes beyond the container of the thumnails, I am using spectre css framework, my HTML looks like this
.img-list {
margin-bottom: 20px;
height: 100px;
width: 100%;
overflow-x: hidden;
}
#media (max-width: 600px) {
.img-list {
height: 50px;
}
}
.img-container {
height: 100%;
position: relative;
overflow: visible;
}
.img-container img {
height: 100%;
display: inline-block;
position: relative;
}
.img-main {
width: 100%;
}
.img-main img {
width: 100%;
}
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre.min.css">
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre-exp.min.css">
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre-icons.min.css">
<div class="container">
<div class="columns">
<div class="column col-md-12">
<div class="img-main">
<img src="https://preview.ibb.co/gxVppG/img1.jpg">
</div>
<div class="img-list ">
<div class="img-container">
<img src="https://preview.ibb.co/gxVppG/img1.jpg">
<img src="https://preview.ibb.co/iZ3Lww/img2.jpg">
<img src="https://preview.ibb.co/iQsPOb/img3.jpg">
<img src="https://preview.ibb.co/gFFdib/img4.jpg">
<img src="https://preview.ibb.co/hS5ppG/img5.jpg">
<img src="https://preview.ibb.co/goKtGw/img6.jpg">
<img src="https://preview.ibb.co/bSWjOb/img7.jpg">
<img src="https://preview.ibb.co/i2o9pG/img8.jpg">
</div>
</div>
</div>
<div class="column col-md-12">
<h1>Peugeaut 206</h1>
<input type="number" onchange="showImage(this)" value="1">
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Numquam culpa sint recusandae architecto odit tenetur
fugit rerum soluta quidem velit. Eos provident nemo dolores vitae pariatur perspiciatis delectus ex dignissimos!
Quibusdam architecto natus nam ullam cupiditate deserunt voluptatem nulla inventore nesciunt error recusandae
quod ab, harum temporibus laboriosam numquam facilis beatae. Numquam odit dolorem quasi rerum aut cupiditate
distinctio ad! Assumenda aut, repellat nihil, fugit doloremque doloribus harum possimus commodi aliquam recusandae
reiciendis delectus vel modi quia sapiente sit voluptas deleniti. Repellat magni rerum fuga vitae odio ad
ullam tempora.</p>
</div>
</div>
</div>
You can simply use white-space:nowrap
.img-list {
margin-bottom: 20px;
height: 100px;
width: 100%;
overflow: auto; /*Show horizontal scroll*/
}
#media (max-width: 600px) {
.img-list {
height: 50px;
}
}
.img-container {
height: 100%;
position: relative;
white-space:nowrap; /*Added this*/
}
.img-container img {
height: 100%;
display: inline-block;
vertical-align:top; /*to remove unwanted whitespace */
position: relative;
}
.img-main {
width: 100%;
}
.img-main img {
width: 100%;
}
<div class="img-main">
<img src="https://preview.ibb.co/gxVppG/img1.jpg">
</div>
<div class="img-list ">
<div class="img-container">
<img src="https://preview.ibb.co/gxVppG/img1.jpg">
<img src="https://preview.ibb.co/iZ3Lww/img2.jpg">
<img src="https://preview.ibb.co/iQsPOb/img3.jpg">
<img src="https://preview.ibb.co/gFFdib/img4.jpg">
<img src="https://preview.ibb.co/hS5ppG/img5.jpg">
<img src="https://preview.ibb.co/goKtGw/img6.jpg">
<img src="https://preview.ibb.co/bSWjOb/img7.jpg">
<img src="https://preview.ibb.co/i2o9pG/img8.jpg">
</div>
</div>
Flexbox is good option but if you want you can add to div with a list of thumbnail images white-space: nowrap
Here is jsfiddle:
.img-container {
white-space: nowrap;
}
.img-container img {
height: 80px;
width: 80px;
display: inline-block;
}
.img-list {
height: 100px;
width: 100%;
}
.img-main img {
width: 100%;
}
<div class="img-main">
<img src="https://preview.ibb.co/gxVppG/img1.jpg">
</div>
<div class="img-list ">
<div class="img-container">
<img src="https://preview.ibb.co/gxVppG/img1.jpg">
<img src="https://preview.ibb.co/iZ3Lww/img2.jpg">
<img src="https://preview.ibb.co/iQsPOb/img3.jpg">
<img src="https://preview.ibb.co/gFFdib/img4.jpg">
<img src="https://preview.ibb.co/hS5ppG/img5.jpg">
<img src="https://preview.ibb.co/goKtGw/img6.jpg">
<img src="https://preview.ibb.co/bSWjOb/img7.jpg">
<img src="https://preview.ibb.co/i2o9pG/img8.jpg">
</div>
</div>
I have updated CSS removed the unnecessary style.
My solution of choice is Flexbox!
To class .img-container:
add display: flex; - this turns the container into a flex container
add flex-direction: row; - this is default but illustrates the example
add flex-wrap: nowrap; - this is also default but also illustrates the example
finally, change overflow to hidden
jsfiddle demo
I believe this achieves what you desire. Please let me know if I'm mistaken.