My website does not work on iphone or mac - php

What happens is that I have a website on android that loads me correctly, on the desktop as well. But on iphone or mac os, I have problems and that is that it has many defects that is to say that it does not catch the styles.
I leave you part of the html and the css that I use in addition to the bootstrap 4 library.
They can also be viewed on my host to verify the problem of the iphone because at first glance on the desktop it looks normal, the problem is on an Apple device.
https://arstrikestudio.com/dlx/
HTML.
<div class="delexlp">
<span class="ir-arriba"> <i class="fa fa-arrow-circle-down"></i></span>
<div id="logo-div" class="paddingleft">
<div id="logo-img">
<img id="lgefect" src="delexni/img/default/delex2020-01.svg" width="100%" height="100%">
</div>
</div>
<div class="imgscroll">
</div>
<div class="col-lg-12 col-sm-12 oculto">
<div class="row">
<div class="col-lg-6 col-sm-12">
<div class="d-none d-md-block sectlp">
<img src="delexni/img/default/delex.svg" alt="">
<br>
<div class="container">
<p class="text-center">Facilitamos a nuestros clientes el proceso<br>de comprar por internet brindandoles un servicio<br><span style="background-color:orange;color:white;"> SIMPLE, CONFIABLE Y RAPIDO </span><br>ganandonos su confianza libra por libra.</p>
</div>
<br>
<div class="text-center">
<a class="btn btn-secondary" href="register">CREA TU CUENTA</a>
<a class="btn btn-secondary" href="login">INICIA SESION</a>
</div>
</div>
<div class="sectlpm d-md-none">
<div class="row spaceblank2" style="padding-left:18%">
<img src="delexni/img/default/delex.svg" alt="" width="300px" height="200px">
</div>
<div class="row" style="padding-top:40vh">
<div class="container">
<p class="text-center spaceblank">Facilitamos a nuestros clientes el proceso<br>de comprar por internet brindandoles un servicio<br><span style="background-color:orange;color:white;"> SIMPLE, CONFIABLE Y RAPIDO </span><br>ganandonos su confianza libra por libra.</p>
</div>
</div>
<div class="row" style="padding-left:15%">
<div class="text-center">
<a class="btn btn-secondary" href="register">CREA TU CUENTA</a>
<a class="btn btn-secondary" href="login">INICIA SESION</a>
</div>
</div>
</div>
</div>
<div class="d-none d-md-block col-lg-6">
<img src="delexni/img/default/delex-x.svg" alt="">
</div>
</div>
</div>
</div>
CSS.
body{
background-size: cover;
background-repeat: no-repeat;
}
.delexlp{
background: url('../img/default/fondo2.svg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.delexlg{
background: url('../img/default/fondo.svg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height: 100vh;
}
#logo-div {
position: fixed;
height: 14vh !important;
width: 100vw;
}
#logo-div img{
width: 100%;
height: 100%;
background-size: cover;
}
.black{
width: 100vw;
height: 45px;
background: black;
}
.oculto{
display: none;
}
.imgscroll{
height: 6000px;
}
.textground{
font-size: 720px;
}
.ir-arriba {
display:block;
text-align: center;
padding:20px;
font-size:48px;
color:#fff;
cursor:pointer;
position: fixed;
bottom:20px;
right:50%;
margin: auto;
z-index: 6;
}
.btn-delex{
background-color: #f6871f;
color: white;
}
.btn-delex2{
background-color: #f6871f;
color: white;
}
#keyframes crescendo {
0% {transform: scale(1);}
100% {transform: scale(43);}
}
.paddingleft{
padding-left: 0 !important;
}
.sectlp {
padding: 15%;
}
.pdtop15{
padding-top: 15%;
}
#media (max-width: 700px) {
.form-control{ background-color: red; }
}
h1, h2, h3, h4, h5 ,h6{
font-weight: 200;
}
a{
text-decoration: none;
}
p, li, a{
font-size: 14px;
}
fieldset{
margin: 0;
padding: 0;
border: none;
}
/* GRID */
.twelve { width: 100%; }
.eleven { width: 91.53%; }
.ten { width: 83.06%; }
.nine { width: 74.6%; }
.eight { width: 66.13%; }
.seven { width: 57.66%; }
.six { width: 49.2%; }
.five { width: 40.73%; }
.four { width: 32.26%; }
.three { width: 23.8%; }
.two { width: 15.33%; }
.one { width: 6.866%; }
/* COLUMNS */
.col {
display: block;
float:left;
margin: 0 0 0 1.6%;
}
.col:first-of-type {
margin-left: 0;
}
.row{
padding: 20px 0;
}
/* CLEARFIX */
.cf:before,
.cf:after {
content: " ";
display: table;
}
.cf:after {
clear: both;
}
.cf {
*zoom: 1;
}
.wrapper{
width: 100%;
margin: 30px 0;
}
/* STEPS */
.steps{
list-style-type: none;
margin: 0;
padding: 0;
/*background-color: #fff;*/
text-align: center;
}
.steps li{
display: inline-block;
margin: 20px;
color: #ccc;
padding-bottom: 5px;
}
.steps li.is-active{
border-bottom: 1px solid #3498db;
color: #3498db;
}
/* FORM */
.form-wrapper .section{
padding: 0px 20px 30px 20px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background-color: #fff;
opacity: 0;
-webkit-transform: scale(1, 0);
-ms-transform: scale(1, 0);
-o-transform: scale(1, 0);
transform: scale(1, 0);
-webkit-transform-origin: top center;
-moz-transform-origin: top center;
-ms-transform-origin: top center;
-o-transform-origin: top center;
transform-origin: top center;
-webkit-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
text-align: center;
width: 100%;
}
.form-wrapper .section h3{
margin-bottom: 30px;
}
.form-wrapper .section.is-active{
opacity: 1;
-webkit-transform: scale(1, 1);
-ms-transform: scale(1, 1);
-o-transform: scale(1, 1);
transform: scale(1, 1);
}
.form-wrapper .button, .form-wrapper .submit{
background-color: #3498db;
display: inline-block;
padding: 8px 30px;
color: #fff;
cursor: pointer;
font-size: 14px !important;
font-family: 'Open Sans', sans-serif !important;
position: absolute;
right: 20px;
bottom: 20px;
}
.form-wrapper .submit{
border: none;
outline: none;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
.form-wrapper input[type="text"],
.form-wrapper input[type="password"],.form-wrapper input[type="email"],.form-wrapper input[type="number"]
,.form-wrapper select,.form-wrapper textarea{
display: block;
padding: 10px;
margin: 10px auto;
background-color: #f1f1f1;
border: none;
width: 50%;
outline: none;
font-size: 14px !important;
font-family: 'Open Sans', sans-serif !important;
}
.form-wrapper input[type="radio"]{
display: none;
}
.form-wrapper input[type="radio"] + label{
display: block;
border: 1px solid #ccc;
width: 100%;
max-width: 100%;
padding: 10px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
cursor: pointer;
position: relative;
}
.form-wrapper input[type="radio"] + label:before{
content: "✔";
position: absolute;
right: -10px;
top: -10px;
width: 30px;
height: 30px;
line-height: 30px;
border-radius: 100%;
background-color: #3498db;
color: #fff;
display: none;
}
.form-wrapper input[type="radio"]:checked + label:before{
display: block;
}
.form-wrapper input[type="radio"] + label h4{
margin: 15px;
color: #ccc;
}
.form-wrapper input[type="radio"]:checked + label{
border: 1px solid #3498db;
}
.form-wrapper input[type="radio"]:checked + label h4{
color: #3498db;
}
.spaceblank{
background-color: white;
opacity: 0.89;
}
.spaceblank2{
background-color: white;
}
.pd30{
padding-top: 30%;
}
.pd60{
padding-top: 60%;
}
.pd200{
padding-top: 200%;
}
/* tabletas */
#media (min-width: 768px) {
}
/* escritorio normales */
#media (min-width: 992px) {
{ font-size:px; }
}
/* pantallas grandes */
#media (min-width: 1200px) {
}
/*****/
#media screen and (min-width: 700px) {
.form-control { font-size: px; }
.form-wrapper .section{
position: absolute;
min-height: 30px;
}
}
#media screen and (min-device-width: 481px) and (max-device-width: 768px) {
.form-control { font-size: px; }
}
#media only screen and (max-device-width: 480px) {
.form-control { font-size: 30px; }
.form-wrapper input[type="text"],
.form-wrapper input[type="password"],.form-wrapper input[type="email"],.form-wrapper input[type="number"]
,.form-wrapper select,.form-wrapper textarea{
width: 100%;
outline: none;
font-size: 32px !important;
}
.form-wrapper .button{font-size: 32px !important;}
.ocultar{
display: none !important;
}
.form-wrapper .section{
min-height: 30px;
max-height: 100px
}
}

Well, the mobile version in all devices had problems in zoom, and I will explain how I fixed it.
First, when you transform: scale(); an element, if the width/height of the zoom rate are the same, you can provide only 1 parameter instead of 2 (as in original code). Also, doing it using jQuery.scroll() is really slow on some devices.
But you were indeed spot on in your code when you created a scale in the style attribute of the element, instead of an animation. If you do an animation, it gets a blurred zoom effect on desktop, inclusive. Also, putting the pictures embedded on a svg indeed made better optimization than converting the images to png (really!).
Putting the animation on the style, only iOS makes some blurriness, which I failed to remove.
So the main point of the answer is the css rule transform-origin.
Since each mobile device has a different screen size, simply zooming on center of image (which is the default behavior without transform-origin), makes the image zoom on the wrong spot.
SO, I got a specific coordinate of a working device which transform-origin worked, and applied a calculation to get the corresponding coordinates on each device (for instance, calculated using the document.documentElement.clientHeight for height). And then setting these coordinates on transform-origin it worked.
Also second important point: for the animation to behave performant on mobile, I've used requestAnimationFrame.
There is an important detail: you were totally correct in making a svg with black background and transparent letters. I've fiddled A LOT and the final answer made use of that, but I've trimmed the logo as I asked you, and made black borders calculated in css using calc(), to fill entire screen on mobile.
And finally, I've removed all superfluous paddings and applied flexbox on elements to get control of centering things vertically/horizontally.
You can see all my edits on https://github.com/niloct/delex_refactor, and I've published it using the awesome https://fast.io free hosting service integrated with github (on https://delex.imfast.io/).
Let me know if you have more questions. Thanks for reading.

Related

How to scroll the body content with the side menu and make it dynamic for small screens?

What should I do so that the content of the body is dynamic when hiding and showing the Side Menu? I am trying to create a product management project with PHP.
I have created a Side Menu ( Sidebar ), for which I used a template. The Side Menu also has a navigation bar that contains the button that we use to hide and show the Side Menu.
The new pages or views are added through php, and I want the content of the pages that I add new to occupy the entire screen, with a margin-left: 40px to the left and scroll dynamically when we show the Side Menu When I add a new page, two problems arise:
The content of the new page is overlaid on top of the navigation bar and hidden under the Sidebar.
See the screenshot
I have fixed this problem first by adding margin-top and margin-left
.bodis {
margin-top: 50px;
margin-left: 330px!important;
}
But this is not very dynamic and it is not Responsive either, since when I hide the Sidebar, the content of the pages stays in the center of the page and when the screen size is reduced, the content even disappears.
You can check it in the first screenshot, . You can see that the content disappears when we reduce the size of the screen .
the content of the body remains in the center of the screen when we hide the Side Menu, and in the second screenshot
The template uses several frameworks for css and javascript that I show below. I have read the documentation of some of them, such as Bootstrap, but it is not clear to me what would be the best way to make the dynamic content for each of the screens that I add to the project
Bootstrap V4.3
Bootstrap Material Design V4.0
Font Awesome V5.9.0
Sweet Alerts V8.13.0 CSS file
jQuery Custom Content Scroller V3.1.5
------ javascript ----
jQuery V3.4.1
popper
Bootstrap V4.3
How can I make content dynamic and effective on mobile devices?
How can I make the content of the page occupy almost the entire screen and scroll when showing the Side Menu? Can I use any of the frameworks that the template uses?
I show the bar code of the Side Menu and that of One of the views, in this case the Home
HOME VIEW:
<div class="bodis">
<div class="full-box page-header">
<h1 class="title">Home</h1>
<h2>BIENVENIDO ESTO ES EL HOME</h2>
</div>
</div>
<main class="full-box main-container">
<section class="full-box nav-lateral">
<div class="full-box nav-lateral-bg show-nav-lateral"></div>
<div class="full-box nav-lateral-content">
<figure class="full-box nav-lateral-avatar">
<i class="far fa-times-circle show-nav-lateral"></i>
<img src="./assets/avatar/Avatar.png" class="img-fluid" alt="Avatar">
<figcaption class="roboto-medium text-center">
Leading Company <br><small class="roboto-condensed-light">Panel Administración</small>
</figcaption>
</figure>
<div class="full-box nav-lateral-bar"></div>
<nav class="full-box nav-lateral-menu">
<ul>
<li class="usuarioColor">
<a href="#" class="nav-btn-submenu">
<i class="fas fa-users fa-fw"></i>
Usuarios
<i class="fas fa-chevron-down"></i>
</a>
<ul>
<li>
<a href="index.php?vista=user_new">
<i class="fas fa-plus fa-fw"></i>
Añadir Usuario
</a>
</li>
<li>
<a href="index.php?vista=user_list">
<i class="fas fa-clipboard-list fa-fw"></i>
Lista de Usuarios
</a>
</li>
<li>
<a href="index.php?vista=user_search">
<i class="fas fa-search fa-fw"></i>
Buscar
</a>
</li>
</ul>
</li>
<li class="productosColor">
<a href="#" class="nav-btn-submenu">
<i class="fas fa-file-invoice-dollar fa-fw"></i>
Productos <i class="fas fa-chevron-down"></i></a>
<ul>
<li>
<a href="#">
<i class="fas fa-plus fa-fw"></i>
Añadir Producto</a>
</li>
<li>
<a href="#">
<i class="fas fa-clipboard-list fa-fw"></i>
Lista de Productos</a>
</li>
<li>
<a href="#">
<i class="fas fa-hand-holding-usd fa-fw"></i>
Por Categoria
</a>
</li>
<li>
<a href="#">
<i class="fas fa-search-dollar fa-fw"></i>
Buscar
</a>
</li>
</ul>
</li>
<li>
<i class="fas fa-store-alt fa-fw"></i> Empresa
</li>
</ul>
</nav>
</div>
</section>
<!-- Page content -->
<section class=" full-box page-content">
<nav class="fexid-top full-box navbar-info">
<a href="#" class="float-left show-nav-lateral">
<i class="fas fa-exchange-alt"></i>
</a>
<a href="#">
<i class="fas fa-user-cog"></i>
</a>
<a href="#" class="btn-exit-system">
<i class="fas fa-power-off"></i>
</a>
</nav>
</section>
</main>
#font-face {
font-family: 'roboto_medium_regular';
src: url('../webfonts/roboto-medium-webfont.woff2') format('woff2'),
url('../webfonts/roboto-medium-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'roboto_condensed_light';
src: url('../webfonts/robotocondensed-light-webfont.woff2') format('woff2'),
url('../webfonts/robotocondensed-light-webfont.woff') format('woff'),
url('../webfonts/robotocondensed-light-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'roboto_condensed_regular';
src: url('../webfonts/robotocondensed-regular-webfont.woff2') format('woff2'),
url('../webfonts/robotocondensed-regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
:root{
--color-one: #F5F5F5;
--color-two: #24292E;
--color-three: #EC5252;
/*--color-three: #0366D6;*/
--form-color: #14111A;
--accent-color: #253556;
/*--accent-color: #455A64;*/
--border-color: #D8D8D8;
}
.bodis {
margin-top: 50px;
margin-left: 330px!important;
}
body,html{
font-family: 'roboto_condensed_light';
width: 100vw;
height: 100vh;
background-color: var(--color-one);
color: #333;
font-size: 16px;
}
.full-box{
margin: 0;
padding: 0;
box-sizing: border-box;
width: 100%;
}
.form-neon{
border: 1px solid var(--border-color);
background-color: #FFF;
padding: 15px;
border-radius: 3px;
}
/*---------- Page headers styles ----------*/
.page-header{
padding: 30px 20px 60px 20px;
}
.page-header > :nth-child(1){
padding-bottom: 7px;
}
.page-header > :nth-child(2){
font-size: 18px;
}
/*---------- Page nav tabs ----------*/
.page-nav-tabs{
display: flex;
justify-content: center;
flex-wrap: wrap;
margin-bottom: 30px;
}
.page-nav-tabs li,
.page-nav-tabs li a{
height: 40px;
line-height: 40px;
}
.page-nav-tabs li{
margin: 5px 20px;
}
.page-nav-tabs li a{
color: var(--accent-color);
font-size: 17px;
min-width: 200px;
width: auto;
display: block;
text-align: center;
user-select: none;
transition: all .2s ease-in-out;
border-bottom: 2px solid transparent;
}
.page-nav-tabs li a.active{
color: var(--color-three);
cursor: none;
pointer-events: none;
}
.page-nav-tabs li a:hover{
text-decoration: none;
color: #333;
border-bottom: 2px solid #333;
}
/*---------- Edit bootstrap styles ----------*/
.form-control[readonly]{
background-color: transparent;
}
.form-control:focus,
.form-control:active{
outline: none;
box-shadow: none;
border: none;
}
.form-control-file:active,
.form-control-file:focus{
outline: none;
}
.table .btn{
margin-bottom: 0;
}
.table thead th{
color: #FFF;
}
.table tbody tr{
color: #333;
transition: all .2s ease-in-out;
}
.table-dark,
.table{
background-color: #fff;
}
.table-dark{
border: 1px solid var(--accent-color);
}
.table-dark thead tr{
background-color: var(--accent-color);
}
.table-dark td,
.table-dark thead th,
.table-dark th{
border: none;
}
.table-dark tr:hover{
color: var(--color-three);
background-image: linear-gradient(to right, transparent, rgba(124, 100, 112, .2) 85%, transparent);
}
.page-link{
transition: all .2s ease-in-out;
}
.page-link:hover{
background-color: var(--color-three);
color: #FFF;
}
table form{
margin-bottom: 0;
}
/*---------- Text Styles ----------*/
.roboto-medium{
font-family: 'roboto_medium_regular';
}
.roboto-condensed-light{
font-family: 'roboto_condensed_light';
}
.roboto-condensed-regular{
font-family: 'roboto_condensed_regular';
}
/*---------- login Styles ----------*/
.login-container{
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: #0575E6;
background: -webkit-linear-gradient(to right, #021B79, #0575E6);
background: linear-gradient(to right, #021B79, #0575E6);
}
.login-content{
width: 95%;
max-width: 320px;
height: auto;
border: 1px solid var(--border-color);
background-color: #FFF;
border-radius: 4px;
padding: 15px;
color: var(--accent-color);
}
.btn-login{
width: 90%;
padding: 10px 0;
display: block;
margin: 0 auto;
border-radius: 3px;
margin-top: 30px;
background-color: transparent;
color: var(--accent-color);
border: 1px solid var(--accent-color);
transition: all .2s ease-out;
}
.btn-login:hover{
background-color: var(--color-three);
border: 1px solid var(--color-three);
text-decoration: none;
color: #fff;
}
.btn-login:active,
.btn-login:focus{
outline: none;
}
/*---------- Page layout Styles ----------*/
.main-container{
height: 100%;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
}
.page-content,
.nav-lateral{
height: 100%;
overflow: hidden;
}
.page-content{
position: fixed;
padding-left: 300px;
transition: all .2s ease-in-out;
padding-bottom: 20px;
}
/***********************/
/* Nav Lateral */
/***********************/
/* COLORES DE LAS LISTAS */
/* nav > ul > li a:hover {
background: white !important;
color:#47748b !important;
} */
.usuarioColor {
background: rgb(239, 149, 54);
}
.nav-lateral{
width: 300px;
position: absolute;
top: 0;
left: 0;
z-index: 1;
transition: all .2s ease-in-out;
background-image: url('../assets/img/nav-font.jpg');
background-position: center center;
background-size: cover;
}
.nav-lateral-bg{ display: none; }
.nav-lateral-content{
max-width: 300px;
height: 100%;
background-color: rgba(36, 41, 46, .8);
}
.nav-lateral-bar{
height: 3px;
background-color: var(--color-three);
}
.nav-lateral-avatar{
padding: 40px 0;
}
.nav-lateral-avatar i{
display: none;
}
.nav-lateral-avatar img{
width: 50%;
margin: 0 auto;
display: block;
border: 4px solid #FFF;
border-radius: 100%;
}
.nav-lateral-avatar figcaption{
margin-top: 20px;
color: #FFF;
}
.nav-lateral-menu{
height: auto;
}
.nav-lateral-menu ul{
margin: 0;
padding: 0;
list-style: none;
}
.nav-lateral-menu ul li{
width: 100%;
height: auto;
}
.nav-lateral-menu ul li a{
display: block;
width: 100%;
height: 45px;
line-height: 45px;
text-decoration: none;
color: #FFF;
font-size: 17px;
box-sizing: border-box;
padding-left: 20px;
transition: all .2s ease-in-out;
}
.nav-lateral-menu ul li a.active{
color: #FFF;
background-color: var(--color-three);
}
.nav-lateral-menu ul li a:hover{
color: #fff;
background-image: linear-gradient(to right, transparent, rgba(255, 255, 255, .1) 50%, transparent);
}
.nav-lateral-menu ul li ul{
display: none;
border: 1px solid var(--color-three);
background: rgba(20, 30, 48, .5);
}
.nav-lateral-menu ul li ul a{
padding-left: 45px;
}
.show-nav-lateral-submenu{
display: block !important;
}
.nav-lateral-menu .fa-chevron-down,
.nav-lateral-menu .fa-chevron-up{
float: right;
height: 45px;
line-height: 45px;
margin-right: 7px;
transition: all .2s ease-in-out;
}
/* Page content */
.navbar-info{
height: 50px;
border-bottom: 1px solid var(--border-color);
text-align: right;
padding-right: 10px;
}
.navbar-info a{
color: var(--accent-color);
height: 50px;
min-width: 40px;
text-align: center;
line-height: 50px;
display: inline-block;
transition: all .2s ease-out;
user-select: none;
}
.navbar-info a:hover{
color: var(--color-three);
background-image: radial-gradient(circle,rgba(250, 30, 78, .1), transparent 80%);
}
.navbar-info a:active,
.navbar-info a:focus{
outline: none;
}
/*---------- Home Styles ----------*/
.tile-container{
text-align: center;
padding: 20px 25px;
}
.tile{
height: 200px;
width: 200px;
margin: 10px;
display: inline-block;
text-decoration: none;
color: var(--accent-color);
border: 1px solid var(--border-color);
border-radius: 3px;
user-select: none;
transition: all .2s ease-in-out;
background-color: #FFF;
}
.tile:hover{
text-decoration: none;
border-color: var(--color-three);
}
.tile:focus,
.tile:active{
outline: none;
}
.tile-tittle{
margin: 0;
width: 100%;
padding: 0;
height: 40px;
line-height: 40px;
box-sizing: border-box;
text-transform: uppercase;
border-bottom: 1px solid var(--border-color);
transition: all .2s ease-in-out;
font-family: 'roboto_medium_regular';
}
.tile:hover .tile-tittle{
color: #FFF;
border-color: var(--color-three);
background-color: var(--color-three);
}
.tile-icon{
width: 100%;
height: 160px;
box-sizing: border-box;
padding-top: 22px;
}
.tile-icon > i{
font-size: 80px;
}
.tile-icon > p{
font-family: 'roboto_medium_regular';
height: 35px;
line-height: 35px;
}
.tile:hover .tile-icon > i,
.tile:hover .tile-icon > p{
color: var(--color-three);
}
/*---------- Breakpoints ----------*/
#media (max-width: 767px){
.nav-lateral{
width: 100%;
overflow: hidden;
display: none;
background-image: none;
}
.nav-lateral.active{
display: block;
z-index: 9999;
}
.nav-lateral-bg{
width: 100%;
height: 100%;
background-color: rgba(3, 3, 3, .4);
position: relative;
display: block;
z-index: 2;
}
.nav-lateral-content{
position: absolute;
left: 0;
top: 0;
z-index: 3;
transform: translateX(-400px);
transition: all .3s ease-in-out;
background-color: var(--color-two);
}
.nav-lateral.active .nav-lateral-content{
transform: translateX(0);
}
.nav-lateral-avatar i{
height: 50px;
width: 50px;
line-height: 50px;
color: #FFF;
cursor: pointer;
font-size: 25px;
position: absolute;
top: 5px;
right: 0;
text-align: center;
display: block;
transition: all .2s ease-out;
}
.nav-lateral-avatar i:hover{
color: var(--color-three);
}
.page-content{
padding-left: 0;
}
}
/* Bootstrap breakpoints */
#media (min-width: 576px){
}
#media (min-width: 768px){
.nav-lateral.active{
transform: translateX(-400px);
}
.page-content.active{
padding-left: 0;
}
}
#media (min-width: 992px){
}
#media (min-width: 1200px){
}
/*---------- Keyframes ----------*/
I have tried to fix this error by adding margin-top and margin-left :
.bodis {
margin-top: 50px;
margin-left: 330px!important;
}
But the result still does not meet the desired.
I have read the bootstrap documentation trying to find a solution, but I don't see that it is the best for my needs
I have tried to implement the answers of this question, but it didn't work in my case
I finally found a solution to my problem, and although I can't add all the code here, the solution was very simple.
I have only ordered my css files and removed what is not necessary, to avoid problems.
For views that are added back to my app, I put them inside two div.
The parent wraps everything and has the following css:
bodysuits {
margin-top: 80px;
overflow-y: hidden;
width:100%;
}
.body .content {
padding: 20px;
}
And we also add a second div with the div class="content"
In this way my different pages would look like this:
<div class="bodis page-content">
<div class="content">
<h1 class="title ">Title</h1>
<h2 class="subtitle">Subtitle</h2>
<!-- THE REST OF THE CONTENT --!>
</div>
</div>
Update the media query code by changing the width from 100% to 300px like so;
#media(max-width: 767px)
.nav-side-bg {
width: 300px;
height: 100%;
background-color: rgba(3, 3, 3, .4);
position: relative;
display: block;
z-index: 2;
}
All this worked and I am encouraged to study css more intensely since I see that it is a very powerful language in web layout

how to put an icon on an image with Php CSS?

I have images in a file with its name in the database. And I would like to display it in a responsive list. But I would like to add for each image an icon in a corner (or text below the frame) of the image to remove it if necessary. here is my html and php code
<?php
$sqlimage = "SELECT * FROM images where `id_user` = '".$customer_id."'";
$result = mysqli_query($conn, $sqlimage);
foreach ($result as $imageShow) {
?>
<div class="container">
<h1>Image Galerry</h1>
<div class="image-container">
<div class="image">
<img src="<?php echo 'Media/'.$imageShow['file_name'] ?>" alt="">
<div>
<i class='fa fa-trash' style='color: red'></i>
</div>
</div>
<div class="linkDelete"
style="font-size: 13px;position:absolute;text-align:center; width:26px; padding-top:3px">
Delete
</div>
<?php
}
mysqli_close($conn);
?>
</div>
<div class="popup-image">
<span>×</span>
<img src="Media/3-20220714-68033.jpg" alt="">
</div>
</div>
And here is my CSS3 code to display the images
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container{
position: relative;
min-height: 100vh;
background-color: #191C24 !important;
}
.container h1{
font-size: 40px;
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-weight: normal;
padding: 15px;
color: #333;
text-align: center;
text-transform: capitalize;
}
.container .image-container{
display: flex;
flex-wrap: wrap;
gap:15px;
justify-content: center;
padding: 10px;
}
.container .image-container .image{
height: 250px;
width: 350px;
border: 10px solid #fff;
box-shadow: 0 5px 15px rgba(0, 0, 0, .1);
overflow: hidden;
cursor: pointer;
float: left;
}
.linkDelete{
float: left;
clear: left;
}
.container .image-container .image img{
height: 100%;
width: 100%;
object-fit: cover;
transition: .2s linear;
}
.container .image-container .image a{
height: 100%;
width: 100%;
object-fit: cover;
transition: .2s linear;
}
.container .image-container .image:hover img{
transform: scale(1.1);
}
.container .popup-image{
position: fixed;
top: 50px;
left: 0px;
background: rgba(0, 0, 0, .9) ;
height: 100%;
width: 100%;
z-index: 100%;
display: none;
}
.photo-name{
position: absolute;
width: 100%;
bottom: 30px;
text-align: center;
background-color: cyan;
}
/* .image-container{
position:relative;
}
.image-container a{
position:absolute;
bottom:0px;
right:0px;
} */
.container .popup-image span{
position: absolute;
top: 0;
right: 10px;
font-size: 60px;
font-weight: bolder;
color: #fff;
cursor: pointer;
z-index: 100;
}
.container .popup-image img{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
border: 5px solid #333;
border-radius: 5px;
width: 75%;
object-fit: cover;
}
#media (max-width:768px){
.container .popup-image img{
width: 95%;
}
}
I would like to have an image and on this image there is the icon which tells me the link to delete which is already prepared
I tried several ways but each time I find the icon in a position since the images with different dimensions.
If there was a possibility if not below the image a link to delete it and thank you in advance.
Set position: relative; on .image. Then set a class on the parent div for the icon. I called it .icon-wrapper. Set this parent to position: absolute; with top: 0;. Then you can use width and height: 100%; so it falls directly on top of your .image div.
Then you can use display: flex; with align-items: center; and justify-content: center; on .icon.wrapper to align the icon vertically and horizontally.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
position: relative;
min-height: 100vh;
background-color: #191C24 !important;
}
.container h1 {
font-size: 40px;
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-weight: normal;
padding: 15px;
color: #333;
text-align: center;
text-transform: capitalize;
}
.container .image-container {
display: flex;
flex-wrap: wrap;
gap: 15px;
justify-content: center;
padding: 10px;
}
.container .image-container .image {
height: 250px;
width: 350px;
border: 10px solid #fff;
box-shadow: 0 5px 15px rgba(0, 0, 0, .1);
overflow: hidden;
cursor: pointer;
float: left;
}
.linkDelete {
float: left;
clear: left;
}
.container .image-container .image img {
height: 100%;
width: 100%;
object-fit: cover;
transition: .2s linear;
}
.container .image-container .image a {
height: 100%;
width: 100%;
object-fit: cover;
transition: .2s linear;
}
.container .image-container .image:hover img {
transform: scale(1.1);
}
.container .popup-image {
position: fixed;
top: 50px;
left: 0px;
background: rgba(0, 0, 0, .9);
height: 100%;
width: 100%;
z-index: 100%;
display: none;
}
.photo-name {
position: absolute;
width: 100%;
bottom: 30px;
text-align: center;
background-color: cyan;
}
/* .image-container{
position:relative;
}
.image-container a{
position:absolute;
bottom:0px;
right:0px;
} */
.container .popup-image span {
position: absolute;
top: 0;
right: 10px;
font-size: 60px;
font-weight: bolder;
color: #fff;
cursor: pointer;
z-index: 100;
}
.container .popup-image img {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
border: 5px solid #333;
border-radius: 5px;
width: 75%;
object-fit: cover;
}
#media (max-width:768px) {
.container .popup-image img {
width: 95%;
}
}
i {
font-size: 3em;
color: red;
}
.image {
position: relative;
}
.icon-wrapper {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
display: flex;
align-items: center;
justify-content: center;
}
<script src="https://kit.fontawesome.com/6140596fcb.js" crossorigin="anonymous"></script>
<div class="container">
<h1>Image Galerry</h1>
<div class="image-container">
<div class="image">
<img src="https://dummyimage.com/300/000/fff" alt="">
<div class="icon-wrapper">
<i class="fa-solid fa-trash"></i>
</div>
</div>
<div class="linkDelete" style="font-size: 13px;position:absolute;text-align:center; width:26px; padding-top:3px">
Delete
</div>
</div>
<div class="popup-image">
<span>×</span>
<img src="Media/3-20220714-68033.jpg" alt="">
</div>
</div>
Thanks for adding the delete icon. But this one blocked me from displaying the full size image when I click inside the photo (the popup-image class action).
In the CSS
.container .popup-image img{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
border: 5px solid #333;
border-radius: 5px;
width: 75%;
object-fit: cover;
}
#media (max-width:768px){
.container .popup-image img{
width: 95%;
}
}
And in the HTML
<div class="popup-image">
<span>×</span>
<img src="Media/3-20220714-68033.jpg" alt="">
</div>

Id card printing 85.60mm X 53.98mm

I am setting up an ID card printing software in PHP both for landscape and portrait mode. The problem is with the print() command it always takes the standard page sizes A4, A3... Because of this it prints the id in a specific section of the card.
Can anyone help or recommend something? Perhaps there is another way to print it without print preview in chrome?
<style>
#page {
/*size: A5;
margin: 5px;*/
width: 53.98mm;
height: 85.60mm;
margin: 0px;
}
#media print {
html, body {
/*width: 210mm;
height: 297mm;*/
/*width: 218mm;
height: 340mm;*/
}
}
#printablediv {
width: 53.98mm;
height: 85.60mm;
}
.idcardreport {
font-family: arial;
-webkit-print-color-adjust: exact;
}
/*IDcard Front Part Css Code*/
.idcardreport-frontend{
margin: 2px;
float: left;
border: 1px solid #000;
padding: 10px;
width: 260px;
text-align: center;
height:370px;
background-size: 100% 100% !important;
}
.logo img{
width: 50px;
height: 50px;
border: 1px solid #ddd;
margin-bottom: 5px;
}
.pick img{
width: 60px;
height: 80px;
border: 1px solid #ddd;
margin-bottom: 5px;
}
.signe img{
width: 50px;
height: 50px;
border: 1px solid #ddd;
margin-bottom: 5px;
}
h3 {
font-size: 14px;
color: #1A2229;
text-align: center;
}
h2 {
font-size: 10px;
color: #1A2229;
text-align: center;
}
h1 {
font-size: 18px;
color: #1A2229;
text-align: center;
}
p {
text-align: left;
font-size: 12px;
margin-bottom: 0px;
margin-top: 1px;
color: #1A2229;
}
.vertical{
writing-mode:tb-rl;
-webkit-transform:rotate(180deg);
-moz-transform:rotate(180deg);
-o-transform: rotate(180deg);
-ms-transform:rotate(180deg);
transform: rotate(180deg);
white-space:nowrap;
display:block;
bottom:0;
}
</style>
<style>
#media print {
body * {
visibility: hidden;
}
#section-to-print, #section-to-print * {
visibility: visible;
}
#section-to-print {
position: absolute;
left: 0px;
/*right: -400px;*/
top: 0;
}
}
button.btn.btn-dark {
padding: 10px;
position: relative;
top: -390px;
}
</style>
<button type="button" class="btn btn-dark" onclick="window.print()"><i class="fa fa-print"></i> Print</button>
<div class="wrapper" id="section-to-print"></div> //add ID on the section u want to print

input field CSS Code doesn't render correctly when doctype html is added

I am working on a simple login page with a login form. When i added < !DOCTYPE HTML>, the input field sketched further than the container when set to 100% width. I have searched for solution and noticed questions asked consider doctype messing up css is regarding a specific problem.
Below are my codes;
.loginbox {
width: 320px;
height: 440px;
background: #000;
color: #fff;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-sizing: border-box;
padding: 70px 30px;
}
#media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
.loginbox {
width: 450px;
height: 480px;
padding: 90px 30px;
}
.inputContainer input {
margin-bottom: 30px;
}
}
.loginavatar {
width: 100px;
height: 100px;
border-radius: 50%;
position: absolute;
top: -50px;
left: calc(50% - 50px);
}
.loginbox h1 {
font-size: 22px;
text-align: center;
margin: 0;
padding: 0 0 20px;
}
.inputContainer input {
margin-bottom: 20px;
}
input:-webkit-autofill {
-webkit-text-fill-color: #ffffff !important;
transition: background-color 5000s ease-in-out 0s;
-webkit-transition: background-color 5000s ease-in-out 0s;
}
.inputContainer input[type="text"],
input[type="password"] {
width: 100%;
height: 42px;
background: transparent;
color: #fff;
font-size: 14px;
font-family: inherit;
font-weight: 400;
border: none;
border-bottom: 1px solid #333;
outline: none;
padding-left: 25px;
}
.logico {
position: absolute;
top: 20%;
}
.usernithicon,
.passnithicon {
position: relative;
}
.inputContainer input[type="text"]:hover,
input[type="password"]:hover,
input[type="text"]:focus,
input[type="password"]:focus {
border-bottom: 1px solid #bc2333;
}
.inputContainer .inputBox label {
position: absolute;
top: 0;
left: 10%;
padding: 15px 0 0 0;
font-size: 14px;
pointer-events: none;
transition: .5s;
}
.inputContainer .inputBox input:focus~label,
.inputContainer .inputBox input:valid~label {
top: -18px;
left: 10%;
font-size: 12px;
color: #bc2333;
}
input[type=checkbox]+label {
display: block;
margin: 3px 3px 20px;
cursor: pointer;
padding: 0;
}
input[type=checkbox] {
display: none;
}
input[type=checkbox]+label:before {
content: "\2714";
border: 1px solid #fff;
border-radius: 0.2em;
display: inline-block;
width: 1em;
height: 1em;
padding-left: 0.2em;
padding-bottom: 0.3em;
margin-right: 0.2em;
vertical-align: bottom;
color: transparent;
transition: .2s;
}
input[type=checkbox]+label:active:before {
transform: scale(0);
}
input[type=checkbox]:checked+label:before {
background-color: #bc2333;
border-color: #bc2333;
color: #fff;
}
input[type=checkbox]:checked:disabled+label:before {
transform: scale(1);
background-color: #bc2333;
border-color: #bc2333;
opacity: 0.5;
}
input[type=checkbox]:disabled+label:before {
transform: scale(1);
border-color: #fff;
opacity: 0.2;
}
.inputContainer input[type="submit"] {
width: 100%;
height: 48px;
background: #bc2333;
color: #fff;
font-size: 16px;
font-weight: 500;
font-family: inherit;
border: 0;
outline: none;
}
.inputContainer input[type="submit"]:hover {
cursor: pointer;
background: #7a091f;
transition: .3s ease;
}
.inputContainer a {
color: #fff;
display: block;
text-decoration: none;
text-align: center;
}
.inputContainer a:hover {
color: #f4f4f4;
transition: .2s ease;
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="application-name" content="">
<title>Member Login</title>
<link rel="stylesheet" href="fonts/FontAwesome/css/fontawesome-all.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/login.css">
</head>
<body>
<div class="loginbox">
<img class="loginavatar" src="assets/images/user.png" draggable="false" />
<h1>Login Form</h1>
<div class="inputContainer">
<form method="POST" action="">
<!--<p>Username</p>-->
<div class="usernithicon inputBox">
<i class="fa fa-user logico"></i>
<input type="text" id="usern" name="username" required><label for="usern">Username</label></div>
<!--<p>Password</p>-->
<div class="passnithicon inputBox">
<i class="fa fa-lock logico"></i>
<input type="password" id="pswrd" name="password" required><label for="pswrd">Password</label></div>
<input type="checkbox" id="remberme" name="remember"><label for="remberme">Remeber Me</label>
<input type="submit" name="" value="Login">
Forgot password?<br>
Create An Account
</form>
</div>
</div>
</body>
</html>
When this renders in browser the username and password input field will become stretched and i was able to use width:90%;, which works fine but i would love to have it set to width:100%; (which works perfectly without added the doctype tag) but when the doctype code is added, it becomes stretched.
Additional Issue: The background image i added to the body wont cover the whole screen, it breaks in the middle and repeat. i tried adding background-repeat:none; but didn't work. but if i remove the doctype tag, the background fills up the page as expected.
How do i solve this?
base on what you want i added display: inline-flex; in your input wrappers
Try this
.loginbox {
width: 320px;
height: 440px;
background: #000;
color: #fff;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-sizing: border-box;
padding: 70px 30px;
}
#media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
.loginbox {
width: 450px;
height: 480px;
padding: 90px 30px;
}
.inputContainer input {
margin-bottom: 30px;
}
}
.loginavatar {
width: 100px;
height: 100px;
border-radius: 50%;
position: absolute;
top: -50px;
left: calc(50% - 50px);
}
.loginbox h1 {
font-size: 22px;
text-align: center;
margin: 0;
padding: 0 0 20px;
}
.inputContainer input {
margin-bottom: 20px;
}
input:-webkit-autofill {
-webkit-text-fill-color: #ffffff !important;
transition: background-color 5000s ease-in-out 0s;
-webkit-transition: background-color 5000s ease-in-out 0s;
}
.inputContainer input[type="text"],
input[type="password"] {
width: 100%;
height: 42px;
background: transparent;
color: #fff;
font-size: 14px;
font-family: inherit;
font-weight: 400;
border: none;
border-bottom: 1px solid #333;
outline: none;
padding-left: 20px;
}
.logico {
position: absolute;
top: 20%;
}
.usernithicon,
.passnithicon {
position: relative;
display: inline-flex;
align-items: baseline;
width: 100%;
}
.inputContainer input[type="text"]:hover,
input[type="password"]:hover,
input[type="text"]:focus,
input[type="password"]:focus {
border-bottom: 1px solid #bc2333;
}
.inputContainer .inputBox label {
position: absolute;
top: 0;
left: 10%;
padding: 15px 0 0 0;
font-size: 14px;
pointer-events: none;
transition: .5s;
}
.inputContainer .inputBox input:focus~label,
.inputContainer .inputBox input:valid~label {
top: -22px;
left: 10%;
font-size: 12px;
color: #bc2333;
}
input[type=checkbox]+label {
display: block;
margin: 3px 3px 20px;
cursor: pointer;
padding: 0;
}
input[type=checkbox] {
display: none;
}
input[type=checkbox]+label:before {
content: "\2714";
border: 1px solid #fff;
border-radius: 0.2em;
display: inline-block;
width: 1em;
height: 1em;
padding-left: 0.2em;
padding-bottom: 0.3em;
margin-right: 0.2em;
vertical-align: bottom;
color: transparent;
transition: .2s;
}
input[type=checkbox]+label:active:before {
transform: scale(0);
}
input[type=checkbox]:checked+label:before {
background-color: #bc2333;
border-color: #bc2333;
color: #fff;
}
input[type=checkbox]:checked:disabled+label:before {
transform: scale(1);
background-color: #bc2333;
border-color: #bc2333;
opacity: 0.5;
}
input[type=checkbox]:disabled+label:before {
transform: scale(1);
border-color: #fff;
opacity: 0.2;
}
.inputContainer input[type="submit"] {
width: 100%;
height: 48px;
background: #bc2333;
color: #fff;
font-size: 16px;
font-weight: 500;
font-family: inherit;
border: 0;
outline: none;
}
.inputContainer input[type="submit"]:hover {
cursor: pointer;
background: #7a091f;
transition: .3s ease;
}
.inputContainer a {
color: #fff;
display: block;
text-decoration: none;
text-align: center;
}
.inputContainer a:hover {
color: #f4f4f4;
transition: .2s ease;
}
For the background try this
body, html{
height: 100%;
background-image: url('your_image_path')
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}

How to display button in tooltip

I have a tooltip in my project.
What I like to do is add active button to my tooltip.
Problem is that the tooltip is displaying a HTML tags not a button...
Here is the effect of my work:-)
enter image description here
Bellow is my code.
Please if some one can help. Thank You.
/* Frame */
.frame {
height: 150px;
max-width: 1170px;
/*line-height: 130px;*/
/* overflow:visible !important;*/
}
.frame ul {
list-style: none;
margin: 0;
padding: 0;
height: 100%;
font-size: 14px;
}
.frame ul li {
float: left;
width: 232px;
height: 100%;
margin: 0 2px 0 0;
padding: 0;
background: #f1f1f1;
color: #00b5f6;
text-align: center;
cursor: default;
display:flex;
}
.frame ul li:hover{
color: #fff;
background: #00b5f6;
}
/* setup tooltips */
.tooltip {
position: relative;
z-index:1;
}
li .tooltip{
overflow:visible;
}
.tooltip:before,
.tooltip:after {
position:absolute;
display:inline-block;
opacity: 0;
pointer-events: none;
width:225px;
}
.tooltip:after {
border-right: 6px solid transparent;
border-top: 6px solid #00b5f6;
border-left: 6px solid transparent;
content: '';
height: 0;
top: -5px;
left: 20px;
width: 0;
display:none;
}
.tooltip:before {
background: #00b5f6;
border-radius: 2px;
color: #fff;
content: attr(data-title);
font-size: 12px;
padding: 6px 10px;
top: 0px;
left: 0px;
white-space: nowrap;
height:118px;
max-width:212px !important;
display:block;
word-wrap: break-word;
text-align: left;
white-space: pre-line;
}
/* expand */
.tooltip.expand:before {
transform: scale3d(.2,.2,1);
transition: all .2s ease-in-out 0.5s;
}
.tooltip.expand:after {
transform: translate3d(0,6px,0);
transition: all .2s ease-in-out 0.5s;
}
.tooltip.expand:hover:before,
.tooltip.expand:hover:after {
opacity: 1;
transform: scale3d(1,1,1);
}
.date_event{
text-align:left; width:232px; position:absolute; padding: 5px 0 0 5px; font-style: italic; max-height:20px; z-index:-1;
}
.suwak{
width:232px; height:150px; margin-left:auto; margin-right:auto; overflow-y:visible; overflow-x:hidden; border:solid 1px #000;
}
.title_event{
font-size:16px; font-weight:bold; width:232px; height:130px; vertical-align: middle !important; display: table-cell !important; margin-left:auto; margin-right:auto;
}
<?php $tooltip = "Lorem ipsum dolor sit amet enim.";
$tooltip = $tooltip."<div class='btn_google'>google</div>"; ?>
<div class="suwak">
<div class="frame" id="basic">
<li class="tooltip expand" data-title="<?php echo $tooltip;?>">
<div class="date_event">02.02.2017</div>
<div style="text-align: center; width:232px;">
<div class="title_event">Some title</div>
</div>
</li>
</div>
</div>
That li is not need, just change it to div
Also why not just add a hidden div block as tooltip container, on hover show it (just like the tooltip):
.expand:hover>div {
display: none;
height: 148px;
width: 232px;
}
.mytitle {
display: none;
}
.expand:hover>.mytitle {
display: block;
background: red;
}
/* Frame */
.frame {
height: 150px;
max-width: 1170px;
/*line-height: 130px;*/
/* overflow:visible !important;*/
}
.frame ul {
list-style: none;
margin: 0;
padding: 0;
height: 100%;
font-size: 14px;
}
.frame ul li {
float: left;
width: 232px;
height: 100%;
margin: 0 2px 0 0;
padding: 0;
background: #f1f1f1;
color: #00b5f6;
text-align: center;
cursor: default;
display: flex;
}
.frame ul li:hover {
color: #fff;
background: #00b5f6;
}
/* setup tooltips */
.tooltip {
position: relative;
z-index: 1;
}
li .tooltip {
overflow: visible;
}
.tooltip:before,
.tooltip:after {
position: absolute;
display: inline-block;
opacity: 0;
pointer-events: none;
width: 225px;
}
.tooltip:after {
border-right: 6px solid transparent;
border-top: 6px solid #00b5f6;
border-left: 6px solid transparent;
content: '';
height: 0;
top: -5px;
left: 20px;
width: 0;
display: none;
}
.tooltip:before {
background: #00b5f6;
border-radius: 2px;
color: #fff;
content: attr(data-title);
font-size: 12px;
padding: 6px 10px;
top: 0px;
left: 0px;
white-space: nowrap;
height: 118px;
max-width: 212px !important;
display: block;
word-wrap: break-word;
text-align: left;
white-space: pre-line;
}
/* expand */
.tooltip.expand:before {
transform: scale3d(.2, .2, 1);
transition: all .2s ease-in-out 0.5s;
}
.tooltip.expand:after {
transform: translate3d(0, 6px, 0);
transition: all .2s ease-in-out 0.5s;
}
.tooltip.expand:hover:before,
.tooltip.expand:hover:after {
opacity: 1;
transform: scale3d(1, 1, 1);
}
.date_event {
text-align: left;
width: 232px;
position: absolute;
padding: 5px 0 0 5px;
font-style: italic;
max-height: 20px;
z-index: -1;
}
.suwak {
width: 232px;
height: 150px;
margin-left: auto;
margin-right: auto;
overflow-y: visible;
overflow-x: hidden;
border: solid 1px #000;
}
.title_event {
font-size: 16px;
font-weight: bold;
width: 232px;
height: 130px;
vertical-align: middle !important;
display: table-cell !important;
margin-left: auto;
margin-right: auto;
}
.expand:hover>div {
display: none;
}
.mytitle {
height: 0px;
width: 0px;
display: none;
}
.expand:hover>.mytitle {
height: 150px;
width: 232px;
display: block;
background: red;
}
<div class="suwak">
<div class="frame" id="basic">
<div class="expand" data-title="">
<div class="mytitle">my title <button>123</button><button>123</button></div>
<div class="date_event">02.02.2017</div>
<div style="text-align: center; width:232px;">
<div class="title_event">Some title</div>
</div>
</div>
</div>
</div>
You can do this without using Javascript. Remove that li and do something like this in a simple way:
.box{
width: 200px;
height: 100px;
position: relative;
background-color: silver;
text-align: center;
}
.box:hover .tip{
display: block;
}
.tip{
display: none;
background-color: yellow;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
<div class="box">
<div class="tip">
This is tip content and this is <button>button</button> in it
</div>
Box content
</div>
UPDATE
from the link that you provided on your comment (uw.edu.pl) This is what you are trying to do:
ul{
list-style: none;
}
ul.main{
display: inline-block;
margin-top: 50px;
}
ul.main>li{
width: 200px;
height: auto;
position: relative;
background-color: silver;
text-align: center;
}
ul li ul{
display: none;
}
ul li a{
display: block;
height: 100%;
text-decoration: none;
color: white;
}
ul li:hover ul{
display: block;
}
ul.tip{
display: none;
background-color: yellow;
position: absolute;
bottom: 100%;
padding: 0;
height: auto;
left: 0;
right: 0;
z-index: 1;
}
<ul class="main">
<li>
Box content 1
<ul class="tip">
<li>
This is tip content and this is <button>button1</button> in it
</li>
</ul>
</li><li>
Box content 2
<ul class="tip">
<li>
This is tip content and this is <button>button2</button> in it
</li>
</ul>
</li><li>
Box content 3
<ul class="tip">
<li>
This is tip content and this is <button>button3</button> in it
</li>
</ul>
</li><li>
Box content 4
<ul class="tip">
<li>
This is tip content and this is <button>button4</button> in it
</li>
</ul>
</li>
</ul>

Categories