Div Only Prints Horizontally - html

I've been working in a page that works with bootstrap, contains just css and html and printing a box with a picture, but i'm stucking in a little creepy thing, and it is that the box only prints horizontally tried overflow-wrap: wrap; but no luck same thing with max-width, any one know what's the problem?
My Expected Thing: To Print Like 4 Boxes And Then Heads To Next Line
.modal-content {
width: 750px;
margin-left: 125px;
}
.modal-dialog {
margin: 105px;
}
.button {
display: block;
margin :30px;
}
body {
font-family: 'Roboto', sans-serif;
background-color: #eee;
display: inline-flex;
flex-direction: row;
overflow-wrap: wrap;
overflow-y: hidden;
max-width: 100px;
min-height: 500px;
}
.contain {
display: flex;
flex-direction: row;
}
.stage {
background: #fff;
height: 150px;
width: 200px;
margin : 40px;
flex-wrap: wrap;
background-color: red;
box-shadow: 1px 4px 11px #aaa, inset 1px 3px 6px #ccc;
padding: 1em 0 3em;
position: relative;
}
.stage-content {
background-repeat: no-repeat;
background-size: contain;
width: 200px;
height: 150px;
background-position: top
margin-bottom: 10px;
padding-top: 60%;
background-image: url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxIQEhURERIVFRUVFRYVFRUYFhUVFRYXFxUWFxcVFRUYHSggGBolHRUVITEhJSkrLi4uGB8zODMsNygtLisBCgoKDg0OFxAQGi0dHSUrLSstLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLTc3Lf/AABEIALMBGgMBIgACEQEDEQH/xAAbAAABBQEBAAAAAAAAAAAAAAAAAQIDBQYEB//EADwQAAEDAgIHBgQDCAIDAAAAAAEAAhEDIQQxBRJBUWFxgQYTIpGhsTLB0fBCUuEHFHKCkrLC8WLSI3Oi/8QAGQEAAwEBAQAAAAAAAAAAAAAAAAECBAMF/8QAJBEBAQACAgEEAgMBAAAAAAAAAAECEQMhMQQSQVETMiJCYVL/2gAMAwEAAhEDEQA/APDkIQmQSpEqYLKJSITgLKcmhOVQALroVIXKnMMKolYVHp2FfK4TUUmGfdUSzebKHvNXND6oCj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1dNM+6e55Mk7c+KbKCUgTISlbmPvakT2C480AoNuKlYy8EbJkZ5So6fwnmPmulvxR/x/wASlXfDHZ7WbcxvGf8AME2phwRPqLjruTxZo/iPsE94hzotE+hhErv7JZ3FfVoFuy29Qqxc6wIETs2bNnVQ1WAzaIT2z58WvDkQpHUyE3VTcNaNKROLUkIACJSIRsHgKZiEII9T00ITCU2CbTuJOaEJ134fk1+QO0zfohufQn3QhQ0w4OP/AM/RSD4mjl9UIU12xNb+H/2fRO/AP4j7BCEjw+U9TN/Nv9wXBpAeHqPVqEJxPP8ApksezWBp1KGLqObL6VNrqZlw1SXxMAwbb1uuz1QljJvOrPVt0IXPk8uXp/0cfbC2Hqxsj+4LzBxkoQnxeHH1HmFqCEgQhdWcFOOzohCAYFIM+n+KVCBDqfwfzfRd1IeI8j7FCFNauL4OA8LeZ+SWt8T+v9wQhDT8IXZN+9pUT8jz+qEJuORjs+nyTQhCcZsyOUSEJuRpSoQkH//Z");
}
.stage-content:after {
content: 'mamamia';
text-align: center;
display: block;
font-size:10px;
text-transform: uppercase;
transform: translateY(0.5em);
}
.curtain-container {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.curtain-panel {
display: flex;
height: 150px;
width: 100%;
cursor: pointer;
overflow: hidden;
}
.curtain-panel .curtain {
width: 100%;
background-color: orange;
height: 150px;
position: relative;
transition: transform 0.5s ease-out;
display: flex;
align-items: center;
overflow: hidden;
}
.curtain-panel .curtain:before {
content: attr(data-title);
font-size:10px;
text-align: center;
width: 200%;
position: absolute;
top: 50%;
line-height: 0;
text-shadow: 1px 1px 3px #ccc;
}
.curtain-panel .left-curtain:before {
left: 0;
}
.curtain-panel .right-curtain:before {
right: 0;
}
.curtain-panel .curtain:after {
content: '';
background-size: 20px 20px;
background-image: radial-gradient(circle at 10px -5px, rgba(0, 0, 0, 0) 12px, #fff 13px);
display: block;
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
.curtain-trigger {
visibility: hidden;
position: absolute;
}
.curtain-trigger:hover ~ .left-curtain {
transform: translateX(calc(-100% + 2em));;
}
.curtain-trigger:hover ~ .right-curtain {
transform: translateX(calc(100% - 2em));
}
<html>
<head>
<title>Testing</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.1/css/bootstrap.min.css">
<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.1/js/bootstrap.min.js" integrity="sha384-XEerZL0cuoUbHE4nZReLT7nx9gQrQreJekYhJD9WNWhH8nEW+0c5qq7aIo2Wl30J" crossorigin="anonymous"></script>
</head>
<body>
<div class="contain"><div class="stage">
<div class="stage-content"><span class="button"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#staticBackdrop0">
Launch static backdrop modal
</button></span></div>
<label class="curtain-container">
<div class="curtain-panel">
<input type="checkbox" class="curtain-trigger" />
<div class="left-curtain curtain" data-title="Marwan Moussa"></div>
<div class="right-curtain curtain" data-title="Marwan Moussa"></div>
</div>
</label>
</div><div class="stage">
<div class="stage-content"><span class="button"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#staticBackdrop1">
Launch static backdrop modal
</button></span></div>
<label class="curtain-container">
<div class="curtain-panel">
<input type="checkbox" class="curtain-trigger" />
<div class="left-curtain curtain" data-title="Final Maro Trying"></div>
</div>
</div>
<div class="right-curtain curtain" data-title="Final Maro Trying"></div>
</div>
</label>
</div><div class="stage">
<div class="stage-content"><span class="button"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#staticBackdrop2">
Launch static backdrop modal
</button></span></div>
<label class="curtain-container">
<div class="curtain-panel">
<input type="checkbox" class="curtain-trigger" />
<div class="left-curtain curtain" data-title="Marwaaaaan"></div>
</div>
</div>
<div class="right-curtain curtain" data-title="Marwaaaaan"></div>
</div>
</label>
</div><div class="stage">
<div class="stage-content"><span class="button"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#staticBackdrop3">
Launch static backdrop modal
</button></span></div>
<label class="curtain-container">
<div class="curtain-panel">
<input type="checkbox" class="curtain-trigger" />
<div class="left-curtain curtain" data-title="Omar"></div>
</div>
</div>
</div>
<div class="right-curtain curtain" data-title="Omar"></div>
</div>
</label>
</div><div class="stage">
<div class="stage-content"><span class="button"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#staticBackdrop4">
Launch static backdrop modal
</button></span></div>
<label class="curtain-container">
<div class="curtain-panel">
<input type="checkbox" class="curtain-trigger" />
<div class="left-curtain curtain" data-title="Marorooor"></div>
</div>
</div>
</div>
<div class="right-curtain curtain" data-title="Marorooor"></div>
</div>
</label>
</div></div></body>
</html></body>

Related

How to configure div position based on another div bottom position?

I try to put "datacontain" div below "blue-div", but when blue-div height ++, it covers the "datacontain" div,
how to make "datacontain" div position responsive to blue-div bottom part position ?
Result :
-> i want to make the phonenumber (datacontain div) below blue-div
//style
<style>
.responsive {
width: 100%;
height: auto;
}
.flex-container {
display: flex;
flex-direction: column;
}
.blue-div {
max-width: 70%;
min-width: 70%;
height: 70px;
display: table;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
top:-12%;
/* /transform: translate(-50%, -50%); */
position: absolute;
background-color: #003777;
z-index: 130;
border-radius: 10px;
}
.white-cont {
width: 80%;
height: 215px;
display: block;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
margin-top: -25px;
/* /transform: translate(-50%, -50%); */
position: absolute;
background-color: white;
z-index: 100;
border-radius: 10px;
vertical-align: middle;
box-shadow: 1px 1px 6px 1px #888888;
}
.container-sk {
position: relative;
}
.input-group-addon {
color: gray;
background-color: #ffffff;
}
.datacontain {
margin-top: 50px;
}
.submitButton{
border-radius: 35px;
display: block;
width: 100%;
border: none;
background-color: #ef7c24;
color: white;
padding: 14px 28px;
font-size: 16px;
cursor: pointer;
text-align: center;
}
</style>
//html
<img src="<?php echo base_url() . 'assets/img/banner.jpg' ?>" alt="Nature" class="responsive">
<div class="container-sk flex-container" style="background-color:#28abe3; min-height:300px">
<div class="white-cont">
<div class="datacontain col-md-12">
<div class="">
<label>phonenumber</label>
</div>
<div class="">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">
<img style="height:20px;width:20px" src="<?php echo base_url() . 'assets/img/flag.png' ?>">
+62
</div>
<input class="form-control" id="phonenumber" name="phonenumber" type="text" />
</div>
</div>
<div class="col-md-12 mx-auto">
<button class="submitButton" type="button"> KLAIM VOUCHER </button>
</div>
</div>
</div>
<div class="blue-div" style="">
<label style="color:#fff;font-size:14px;display:table-cell;word-wrap: break-word;vertical-align: middle;" >this is voucher 12345 12345 12354 12345 12345 1234 1234 1234 1234 345 345345 345 345 3 </label>
</div>
</div>
</div>
You need to remove position: absolute; on both the blue div and the white container. If you want the blue div to appear first you also need to move it before the white container in your code.
.responsive {
width: 100%;
height: auto;
}
.flex-container {
display: flex;
flex-direction: column;
}
.blue-div {
max-width: 70%;
min-width: 70%;
height: 70px;
display: table;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
top:-12%;
/* /transform: translate(-50%, -50%); */
background-color: #003777;
z-index: 130;
border-radius: 10px;
}
.white-cont {
width: 80%;
height: 215px;
display: block;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
background-color: white;
z-index: 100;
border-radius: 10px;
vertical-align: middle;
box-shadow: 1px 1px 6px 1px #888888;
}
.container-sk {
position: relative;
}
.input-group-addon {
color: gray;
background-color: #ffffff;
}
.datacontain {
margin-top: 50px;
}
.submitButton{
border-radius: 35px;
display: block;
width: 100%;
border: none;
background-color: #ef7c24;
color: white;
padding: 14px 28px;
font-size: 16px;
cursor: pointer;
text-align: center;
}
<div class="container-sk flex-container" style="background-color:#28abe3; min-height:300px">
<div class="blue-div" style="">
<label style="color:#fff;font-size:14px;display:table-cell;word-wrap: break-word;vertical-align: middle;" >this is voucher 12345 12345 12354 12345 12345 1234 1234 1234 1234 345 345345 345 345 3 </label>
</div>
<div class="white-cont">
<div class="datacontain col-md-12">
<div class="">
<label>phonenumber</label>
</div>
<div class="">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">
+62
</div>
<input class="form-control" id="phonenumber" name="phonenumber" type="text" />
</div>
</div>
<div class="col-md-12 mx-auto">
<button class="submitButton" type="button"> KLAIM VOUCHER </button>
</div>
</div>
</div>
</div>
</div>

Overflow hides the content

The problem is on the "container main" div, which has the overflow-y. When the <form> height gets increased and the overflow starts to work on the "container div", it's not possible to see the whole form and the top part gets hidden
I don't think it's normal behavior, I've been some hours at this problem and just can't solve it the way I wanted (by leaving the form centered with "container main" flexbox)
.form-background {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: -999;
backdrop-filter: brightness(125%) hue-rotate(180deg) blur(10px);
background-color: rgba(0, 0, 0, .5)
}
body {
background-image: url(https://images.pexels.com/photos/1624600/pexels-photo-1624600.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260)
}
section {
height: 100vh;
display: flex;
flex-direction: column;
overflow: auto!important
}
.main.container {
flex-grow: 3;
height: auto;
padding: 0 50px;
overflow-y: scroll;
margin: 50px auto 50px auto;
display: flex;
align-items: center;
}
form {
width: 100%;
}
.edit {
width: 50%;
display: inline-block
}
.edit .input-file {
cursor: pointer
}
.edit.middle,
.edit.middle input {
width: 100%
}
.edit.custom-input {
width: 100%;
display: flex
}
.edit.right {
padding-left: 5px
}
.edit.left {
padding-right: 5px
}
.clickin {
margin: 15px 0
}
form>.box:nth-child(n+2) {
margin-top: 70px
}
.current-templates,
.mob {
display: none;
margin-top: 20px;
}
.current-templates .file {
padding: 10px;
font-size: 1.2rem
}
.current-templates .file:not(:first-child) {
margin-top: 20px
}
.current-templates .file,
.current-templates .options {
display: flex;
align-items: center
}
.current-templates .options {
width: 100%;
justify-content: space-around
}
.current-templates .file span {
white-space: nowrap
}
.current-templates .options {
margin-left: 30px;
list-style: none;
overflow: auto
}
.current-templates .options li {
padding: 4px 25px;
cursor: pointer;
white-space: nowrap;
text-align: center;
transition: background-color .2s var(--cubic-bezier)
}
.current-templates .options li:hover {
background-color: var(--hover-color)
}
.current-templates .options .opt[selected=true] {
background-color: rgba(18, 238, 102, .466)
}
.btn-wrapper {
width: 100%;
display: flex;
justify-content: center;
align-items: center
}
.btn-wrapper button {
padding: 10px;
font-size: 1.1rem;
cursor: pointer;
outline: 0;
border: solid #000 1px;
width: 200px;
margin-top: 30px
}
.btn-anim {
transition: background-color .2s var(--cubic-bezier), color .2s var(--cubic-bezier);
background-color: var(--input-color)
}
.btn-anim:hover {
background-color: var(--hover-color) !important;
color: #fff
}
.btn-anim-blocked:hover {
background-color: rgba(255, 110, 110, .363)!important;
color: #fff
}
.fas.fa-question {
font-size: .8rem;
margin-left: 15px;
cursor: pointer;
padding: 5px;
position: relative
}
.img {
position: absolute;
left: 100%;
top: 0;
visibility: hidden;
opacity: 0;
transform: translate(-50%, -150%);
transition: visibility .2s var(--cubic-bezier), opacity .2s var(--cubic-bezier), transform .2s var(--cubic-bezier)
}
button.refresh-options i {
background-color: transparent;
border: none;
border-radius: 100%;
padding: 5px 8px;
transition: transform 1s var(--cubic-bezier)
}
button.refresh-options {
background-color: transparent;
border: none;
padding: 8px;
font-size: 1rem;
cursor: pointer;
outline: 0;
display: none
}
.edit .input-file,
.edit input {
background-color: var(--input-color)
}
button.refresh-options:hover i {
transform: rotateZ(360deg)
}
.check-box {
margin: 15px 0 25px 1px;
display: flex;
align-items: center
}
.check-box .square {
position: relative;
width: 20px;
height: 20px;
background-color: transparent;
border: solid #fff 1px;
cursor: pointer
}
.check-box span {
margin-left: 20px
}
header {
position: fixed;
width: 100%;
background-color: transparent;
}
.container.nav-content {
padding: 0;
overflow: auto;
}
.container.nav-content {
grid-template-columns: auto 1fr;
justify-content: space-between;
}
ul.nav-opts {
justify-content: flex-end;
}
.fake-nav {
height: 74px;
margin-bottom: 30px;
}
<section>
<div class="fake-nav"></div>
<header>
<nav>
<div class="container nav-content">
<div class="brand">
<img src="" alt="clickin logo">
</div>
<ul class="nav-opts">
<li>Home</li>
<li>Posts</li>
<li>Imagens</li>
</ul>
</div>
</nav>
</header>
<div class="container main">
<div class="form-background"></div>
<form>
<div class="edit-wrapper box">
<div class="edit left"> <label>Id do board <i class="fas fa-question"> <img class="img" src="" alt="Board Id?"> </i></label> <input name="board_id" type="number" required> </div>
<div class="edit right"> <label>Nome do Grupo<i class="fas fa-question"> <img class="img" src="" alt="Nome do Grupo?"> </i></label> <input name="group_name" type="text" required> </div>
</div>
<div class="edit middle box"> <label>Diretório da pasta para construção da estrutura<i class="fas fa-question"> <img class="img" src="" alt="Diretório desejado?"> </i></label> <input name="desired_path" type="text" required> </div>
<div class="edit-wrapper box">
<div class="edit left"> <label>Diretório dos Templates<i class="fas fa-question"> <img class="img" src="" alt="Diretório dos templates?"> </i></label> <input name="templates_path" type="text" required> </div>
<div class="edit right"> <label>Selecione os templates<i class="fas fa-question"> <img class="img" src=""> </i></label> <label class="input-file btn-anim" for="templates">Templates</label> <input name="templates" disabled id="templates" type="file" accept=".psd" multiple
required> </div>
</div>
<div class="edit-wrapper">
<div class="check-box" data-selected="false">
<div class="square"></div>
<span>Templates estruturados em ordem</span>
</div>
</div>
<div class="edit-wrapper mob">
<button type="button" class="refresh-options btn-anim"> Recarregar temas por possíveis mudanças <i class="fas fa-redo-alt"></i> </button>
<center> <img width="100px" class="loader" src="" alt="loading"> </center>
</div>
<div class="current-templates" style="display: block;">
<div class="file" selected_topics="">
<span class="template-name">Template 1</span>
<ul class="options">
<li class="opt" selected="false">1 °</li>
<li class="opt" selected="false">2 °</li>
<li class="opt" selected="false">3 °</li>
</ul>
</div>
<div class="file" selected_topics="">
<span class="template-name">Template 2</span>
<ul class="options">
<li class="opt" selected="false">1 °</li>
<li class="opt" selected="false">2 °</li>
<li class="opt" selected="false">3 °</li>
</ul>
</div>
<div class="file" selected_topics="">
<span class="template-name">Template 3</span>
<ul class="options">
<li class="opt" selected="false">1 °</li>
<li class="opt" selected="false">2 °</li>
<li class="opt" selected="false">3 °</li>
</ul>
</div>
</div>
<div class="btn-wrapper"> <button class="btn-anim" type="submit">Gerar!</button> </div>
</form>
</div>
<footer>Copyright 2021 © João Webber</footer>
</section>
I think the offending part of your CSS code is this one:
.main.container {
flex-grow: 3;
height: auto;
padding: 0 50px;
overflow-y: scroll;
margin: 50px auto 50px auto;
display: flex;
align-items: center;
}
The margin: 50px auto 50px auto; forces your main.container to get squeezed in between your header and your footer, but the form is contains is not following his parent height.
Either:
you remove the overflow-y: scroll from .main.container to allow the <form> to increase the height of his parent, but no more scroll bar inside .main.container.
or you set <form> height: 100% to force him to take its parent height, which will still cause the scroll bar to appear in .main.container (because the form content can't be squeezed) but the top of your <form> will be aligned to the top of .main.container.
It's about 'display: flex;' a flexbox is not just one single property, it's a whole module. If your interested in reading a article about flexbox: guide to use flex-box.
When you delete the display: flex; in your main container it will solve your problem.
.form-background {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: -999;
backdrop-filter: brightness(125%) hue-rotate(180deg) blur(10px);
background-color: rgba(0, 0, 0, .5)
}
/*
body {
background-image: url(https://images.pexels.com/photos/1624600/pexels-photo-1624600.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260)
}*/
section {
height: 100vh;
display: flex;
flex-direction: column;
overflow: auto!important
}
.container.main {
flex-grow: 3;
height: auto;
padding: 0 50px;
overflow-y: scroll;
margin: 50px auto 50px auto;
}
form {
width: 100%;
}
.edit {
width: 50%;
display: inline-block
}
.edit .input-file {
cursor: pointer
}
.edit.middle,
.edit.middle input {
width: 100%
}
.edit.custom-input {
width: 100%;
display: flex
}
.edit.right {
padding-left: 5px
}
.edit.left {
padding-right: 5px
}
.clickin {
margin: 15px 0
}
form>.box:nth-child(n+2) {
margin-top: 70px
}
.current-templates,
.mob {
display: none;
margin-top: 20px;
}
.current-templates .file {
padding: 10px;
font-size: 1.2rem
}
.current-templates .file:not(:first-child) {
margin-top: 20px
}
.current-templates .file,
.current-templates .options {
display: flex;
align-items: center
}
.current-templates .options {
width: 100%;
justify-content: space-around
}
.current-templates .file span {
white-space: nowrap
}
.current-templates .options {
margin-left: 30px;
list-style: none;
overflow: auto
}
.current-templates .options li {
padding: 4px 25px;
cursor: pointer;
white-space: nowrap;
text-align: center;
transition: background-color .2s var(--cubic-bezier)
}
.current-templates .options li:hover {
background-color: var(--hover-color)
}
.current-templates .options .opt[selected=true] {
background-color: rgba(18, 238, 102, .466)
}
.btn-wrapper {
width: 100%;
display: flex;
justify-content: center;
align-items: center
}
.btn-wrapper button {
padding: 10px;
font-size: 1.1rem;
cursor: pointer;
outline: 0;
border: solid #000 1px;
width: 200px;
margin-top: 30px
}
.btn-anim {
transition: background-color .2s var(--cubic-bezier), color .2s var(--cubic-bezier);
background-color: var(--input-color)
}
.btn-anim:hover {
background-color: var(--hover-color) !important;
color: #fff
}
.btn-anim-blocked:hover {
background-color: rgba(255, 110, 110, .363)!important;
color: #fff
}
.fas.fa-question {
font-size: .8rem;
margin-left: 15px;
cursor: pointer;
padding: 5px;
position: relative
}
.img {
position: absolute;
left: 100%;
top: 0;
visibility: hidden;
opacity: 0;
transform: translate(-50%, -150%);
transition: visibility .2s var(--cubic-bezier), opacity .2s var(--cubic-bezier), transform .2s var(--cubic-bezier)
}
button.refresh-options i {
background-color: transparent;
border: none;
border-radius: 100%;
padding: 5px 8px;
transition: transform 1s var(--cubic-bezier)
}
button.refresh-options {
background-color: transparent;
border: none;
padding: 8px;
font-size: 1rem;
cursor: pointer;
outline: 0;
display: none
}
.edit .input-file,
.edit input {
background-color: var(--input-color)
}
button.refresh-options:hover i {
transform: rotateZ(360deg)
}
.check-box {
margin: 15px 0 25px 1px;
display: flex;
align-items: center
}
.check-box .square {
position: relative;
width: 20px;
height: 20px;
background-color: transparent;
border: solid #fff 1px;
cursor: pointer
}
.check-box span {
margin-left: 20px
}
header {
position: fixed;
width: 100%;
background-color: transparent;
}
.container.nav-content {
padding: 0;
overflow: auto;
}
.container.nav-content {
grid-template-columns: auto 1fr;
justify-content: space-between;
}
ul.nav-opts {
justify-content: flex-end;
}
.fake-nav {
height: 74px;
margin-bottom: 30px;
}
<section>
<div class="fake-nav"></div>
<header>
<nav>
<div class="container nav-content">
<div class="brand">
<img src="" alt="clickin logo">
</div>
<ul class="nav-opts">
<li>Home</li>
<li>Posts</li>
<li>Imagens</li>
</ul>
</div>
</nav>
</header>
<div class="container main">
<div class="form-background"></div>
<form>
<div class="edit-wrapper box">
<div class="edit left"> <label>Id do board <i class="fas fa-question"> <img class="img" src="" alt="Board Id?"> </i></label> <input name="board_id" type="number" required> </div>
<div class="edit right"> <label>Nome do Grupo<i class="fas fa-question"> <img class="img" src="" alt="Nome do Grupo?"> </i></label> <input name="group_name" type="text" required> </div>
</div>
<div class="edit middle box"> <label>Diretório da pasta para construção da estrutura<i class="fas fa-question"> <img class="img" src="" alt="Diretório desejado?"> </i></label> <input name="desired_path" type="text" required> </div>
<div class="edit-wrapper box">
<div class="edit left"> <label>Diretório dos Templates<i class="fas fa-question"> <img class="img" src="" alt="Diretório dos templates?"> </i></label> <input name="templates_path" type="text" required> </div>
<div class="edit right"> <label>Selecione os templates<i class="fas fa-question"> <img class="img" src=""> </i></label> <label class="input-file btn-anim" for="templates">Templates</label> <input name="templates" disabled id="templates" type="file" accept=".psd" multiple
required> </div>
</div>
<div class="edit-wrapper">
<div class="check-box" data-selected="false">
<div class="square"></div>
<span>Templates estruturados em ordem</span>
</div>
</div>
<div class="edit-wrapper mob">
<button type="button" class="refresh-options btn-anim"> Recarregar temas por possíveis mudanças <i class="fas fa-redo-alt"></i> </button>
<center> <img width="100px" class="loader" src="" alt="loading"> </center>
</div>
<div class="current-templates" style="display: block;">
<div class="file" selected_topics="">
<span class="template-name">Template 1</span>
<ul class="options">
<li class="opt" selected="false">1 °</li>
<li class="opt" selected="false">2 °</li>
<li class="opt" selected="false">3 °</li>
</ul>
</div>
<div class="file" selected_topics="">
<span class="template-name">Template 2</span>
<ul class="options">
<li class="opt" selected="false">1 °</li>
<li class="opt" selected="false">2 °</li>
<li class="opt" selected="false">3 °</li>
</ul>
</div>
<div class="file" selected_topics="">
<span class="template-name">Template 3</span>
<ul class="options">
<li class="opt" selected="false">1 °</li>
<li class="opt" selected="false">2 °</li>
<li class="opt" selected="false">3 °</li>
</ul>
</div>
</div>
<div class="btn-wrapper"> <button class="btn-anim" type="submit">Gerar!</button> </div>
</form>
</div>
<footer>Copyright 2021 © João Webber</footer>
</section>

Rotate and place element flush to parent element's edge, regardless of content length

How can the tabs be always positioned flush to the right hand side of the container, when rotated and have child text of an unknown width?
Without rotation right: 0; on the .tab would be fine but the rotation throws it off.
body {
margin: 0;
}
.container {
background-color: pink;
padding: 3rem;
position: relative;
}
.tab {
position: absolute;
right: 1rem;
transform: rotate(-90deg);
padding: 1rem;
background-color: green;
margin-right: -2.45rem;
top: 5rem;
}
<body>
<div class="container">
<h1>Button</h1>
<div class="tab">
<button class="tab-button" type="button">Button</button>
</div>
</div>
<hr>
<div class="container">
<h1>Longer button</h1>
<div class="tab">
<button class="tab-button" type="button">Longer Button</button>
</div>
</div>
</body>
Adjust the transform-origin and add some translation then you can use right:0.
body {
margin: 0;
}
.container {
background-color: pink;
padding: 3rem;
position: relative;
}
.tab {
position: absolute;
right: 0;
transform: rotate(-90deg) translateY(-100%);
transform-origin: top right;
padding: 1rem;
background-color: green;
top: 2rem;
}
<div class="container">
<h1>Button</h1>
<div class="tab">
<button class="tab-button" type="button">Button</button>
</div>
</div>
<hr>
<div class="container">
<h1>Longer button</h1>
<div class="tab">
<button class="tab-button" type="button">Longer Button</button>
</div>
</div>
body {
margin: 0;
}
.container {
background-color: pink;
padding: 3rem;
position: relative;
}
.tab {
position: absolute;
right: -39px;
transform: rotate(-90deg);
padding: 1rem;
background-color: green;
top: 5rem;
min-width: 100px;
}
<html>
<head>
<link rel="stylesheet" href="lib/style.css">
<script src="lib/script.js">
</script>
</head>
<body>
<div class="container">
<h1>Button</h1>
<div class="tab">
<button class="tab-button" style="width: 100%; white-space: nowrap" type="button">Button</button>
</div>
</div>
<hr>
<div class="container">
<h1>Longer button</h1>
<div class="tab">
<button class="tab-button" style="width: 100%; white-space: nowrap" type="button">Longer Button</button>
</div>
</div>
</body>
</html>

How to keep position of image when text is changing?

Trying to position my image without changing the position. When the wind text is turned off(js not working in codepen btw. ) ie not displayed under the temperature, the weatherimage is moving up. I tried to position this 'absolute' but not helping.
I am using reactjs to display the Widget on the right:
<div className="widget">
<div className="row">
<div className="col-lg-12 title">{title}</div>
</div>
<div className="row widgettop">
<div className="col-lg-6 topicon">
<img src={'http://openweathermap.org/img/w/' + icon + '.png'}></img>
</div>
<div className="col-lg-6 topdegrees">
{location}
<div className='degrees'>{degrees}°</div>
{wind && <div>Wind{' '}<span className='wind'>{speed}</span> {unitsType === 'metric' ? <span>km/h</span> : <span>mph</span>}</div>}
</div>
</div>
</div>
Based on the state.wind I display the wind details or not.
How can I keep the image in position when the Wind text/ other content is removed/changed?
codepen here
You can toggle the visibility property for the wind area using JS. The image holds its place when I added visibility: hidden to say #windArea - you can toggle between visible and hidden:
body {
margin: 0;
padding: 0;
font-family: sans-serif;
font-family: Lucida Grande;
}
input,
label {
display: block;
}
#tempArea input,
#tempArea label {
display: inline;
margin-bottom: 10px;
}
#windArea input,
#windArea label {
display: inline;
margin-bottom: 10px;
}
div#main {
background: #F2F2F2;
padding: 1vw 2vw;
width: 48%;
}
.spaceradio {
margin-right: 10px;
}
img {
width: 84% !important;
height: 100% !important;
margin-left: 20%;
position: relative;
}
.divider {
border-left: 1px solid lightgrey;
}
.widget {
box-shadow: 1px 2px 1px lightgray;
background-color: white;
margin-left: 10px;
height: 100%;
width: 90%;
position: absolute;
}
.title {
margin-left: 30px;
padding: 10px;
position: absolute;
}
.left {
margin-left: 20px;
padding: 10px;
vertical-align: top;
}
.text {
height: 40px;
width: 100%;
}
.top {
margin-top: 15px;
}
.widgettop {
margin-top: 15px;
}
.topdegrees {
margin-top: 40px;
}
.topicon {
margin-top: 20px;
}
.degrees {
font-size: xx-large;
font-weight: bold;
}
.wind {
font-size: small;
font-weight: bold;
}
.hline {
border-top: 4px solid blue;
padding: 0 !important;
margin-bottom: 10px;
width: 48%;
}
/* .abs
{
position: absolute;
} */
#windArea { /* ADDED */
visibility: hidden;
}
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<div class="left">
<hr class="container hline">
<div id="main" class="container border">
<div class="row">
<div class="col-lg-6 top"><label for="title">Title</label><input id="title" type="text" placeholder=" Title of widget" name="title" class="text" value="">
<div class="top"><label for="radio">Temperature</label>
<div id="tempArea" class="row"><span class="col-lg-6"><input type="radio" id="one" class="spaceradio" value="metric" checked=""><label for="one">℃</label></span><span class="col-lg-6"><input type="radio" id="two" class="spaceradio" value="imperial"><label for="two">℉</label></span></div>
</div>
<div class="top"><label for="radio">Wind</label>
<div id="windArea" class="row"><span class="col-lg-6"><input type="radio" id="one" class="spaceradio" value="true"><label for="one">On</label></span><span class="col-lg-6"><input type="radio" id="two" class="spaceradio" value="false" checked=""><label for="two">Off</label></span></div>
</div>
</div>
<div class="col-lg-6 divider top">
<div class="widget">
<div class="row">
<div class="col-lg-12 title">FDSFSDFDSFDSFDS</div>
</div>
<div class="row widgettop">
<div class="col-lg-6 topicon"><img src="http://openweathermap.org/img/w/09d.png"></div>
<div class="col-lg-6 topdegrees abs">Paramatta
<div class="degrees">58.12°</div>
<div>Wind <span class="wind">23.04</span> <span>mph</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

HTML: content height exclude footer

Here is my code:
css
*{
margin: 0 auto;
font-family: "Trebuchet MS", Arial, Verdana;
font-size: 12px;
}
html {
height: 100%;
}
body {
height: 100%;
min-height: 100%;
position: relative;
background-color: #f4f4f4;
}
#table {
display: table;
height: 100%;
}
.container {
width: 100%;
height: 100%;
}
#table_cell {
display: table-cell;
height: 100%;
vertical-align: middle;
text-align: center;
line-height: 1;
}
.glyphicon {
position: absolute;
padding: 11px 10px 10px 10px;
pointer-events: none;
}
#username,
#password,
#mail {
position: relative
}
#username-input,
#password-input {
padding-left: 30px;
display: inline-block!important;
width: 270px!important;
height: 37px!important;
}
footer {
height: auto;
width: 100%;
bottom: 0;
text-align: center;
position: absolute;
margin: 0 0 0 -15px;
border-top: 1px solid #e7eaec;
background-color: #ffffff;
}
html
<html>
<head>
</head>
<body>
<div class="container">
<div id="table">
<div id="table_cell">
<form name="login_form" id="login_form" method="post" action="">
<img src="images/this.png" />
<br/>
<div id="username">
<i class="glyphicon glyphicon-user"></i>
<input autofocus type="text" class="form-control" name="base_u_username" id="username-input" placeholder="Username" />
</div>
<br/>
<div id="password">
<i class="glyphicon glyphicon-lock"></i>
<input autocomplete="off" type="password" class="form-control" name="base_u_password" id="password-input" placeholder="Password" />
</div>
<br/>
<span style="float:right;">
<input type="submit" name="login" class="btn btn-default" value="Login" />
</span>
</form>
</div>
</div>
<footer>
footer
<br>footer
</footer>
</div>
</body>
</html>
I am struggling with my page layout.
I know there are some similar posts, I try but looks like my case is different.
How can my <div id=table> height exclude footer?
If possible, I don't wish to set a number for height.
Thanks.
Just remove position: absolute; from footer.
Edit:
One better solution is remove height and minheight from body, #table and .container and use display:flex.
Give following css to .container
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 100vh;
* {
margin: 0 auto;
font-family: "Trebuchet MS", Arial, Verdana;
font-size: 12px;
}
html {
}
body {
position: relative;
background-color: #f4f4f4;
}
#table {
display: table;
}
.container {
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 100vh;
}
#table_cell {
display: table-cell;
height: 100%;
vertical-align: middle;
text-align: center;
line-height: 1;
}
.glyphicon {
position: absolute;
padding: 11px 10px 10px 10px;
pointer-events: none;
}
#username,
#password,
#mail {
position: relative
}
#username-input,
#password-input {
padding-left: 30px;
display: inline-block!important;
width: 270px!important;
height: 37px!important;
}
footer {
height: auto;
width: 100%;
bottom: 0;
text-align: center;
margin: 0 0 0 -15px;
border-top: 1px solid #e7eaec;
background-color: #ffffff;
}
<html>
<head>
</head>
<body>
<div class="container">
<div id="table">
<div id="table_cell">
<form name="login_form" id="login_form" method="post" action="">
<img src="images/this.png" />
<br/>
<div id="username">
<i class="glyphicon glyphicon-user"></i>
<input autofocus type="text" class="form-control" name="base_u_username" id="username-input" placeholder="Username" />
</div>
<br/>
<div id="password">
<i class="glyphicon glyphicon-lock"></i>
<input autocomplete="off" type="password" class="form-control" name="base_u_password" id="password-input" placeholder="Password" />
</div>
<br/>
<span style="float:right;">
<input type="submit" name="login" class="btn btn-default" value="Login" />
</span>
</form>
</div>
</div>
<footer>
footer
<br>footer
</footer>
</div>
</body>
</html>
add this css
#table {
display: table;
height: calc(100% - 31px);
}
Change css for footer
footer {
background-color: #ffffff;
border-top: 1px solid #e7eaec;
bottom: 0;
height: auto;
text-align: center;
width: 100%;
}