Tooltip shows up underneath the element - html

I've added a customized tooltip to my project. The tooltip is showing under the element when I hover over it. I'm not sure what's going on. It's only for some elements too. I've tried changing the tooltip position but it breaks the whole design. My desired need is that to display the tootip fully without hiding underneath parent element.
[data-tooltip] {
display: inline-block;
position: relative;
cursor: help;
padding: 4px;
}
/* Tooltip styling */
[data-tooltip]:before {
content: attr(data-tooltip);
display: none;
position: absolute;
background: #000;
color: #fff;
padding: 4px 8px;
font-size: 14px;
line-height: 1.4;
min-width: 100px;
text-align: center;
border-radius: 4px;
}
/* Dynamic horizontal centering */
[data-tooltip-position="top"]:before,
[data-tooltip-position="bottom"]:before {
left: 50%;
-ms-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
/* Dynamic vertical centering */
[data-tooltip-position="right"]:before,
[data-tooltip-position="left"]:before {
top: 50%;
-ms-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
[data-tooltip-position="top"]:before {
bottom: 100%;
margin-bottom: 6px;
}
[data-tooltip-position="right"]:before {
left: 100%;
margin-left: 6px;
}
[data-tooltip-position="bottom"]:before {
top: 100%;
margin-top: 6px;
}
[data-tooltip-position="left"]:before {
right: 100%;
margin-right: 6px;
}
/* Tooltip arrow styling/placement */
[data-tooltip]:after {
content: '';
display: none;
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
/* Dynamic horizontal centering for the tooltip */
[data-tooltip-position="top"]:after,
[data-tooltip-position="bottom"]:after {
left: 50%;
margin-left: -6px;
}
/* Dynamic vertical centering for the tooltip */
[data-tooltip-position="right"]:after,
[data-tooltip-position="left"]:after {
top: 50%;
margin-top: -6px;
}
[data-tooltip-position="top"]:after {
bottom: 100%;
border-width: 6px 6px 0;
border-top-color: #000;
}
[data-tooltip-position="right"]:after {
left: 100%;
border-width: 6px 6px 6px 0;
border-right-color: #000;
}
[data-tooltip-position="bottom"]:after {
top: 100%;
border-width: 0 6px 6px;
border-bottom-color: #000;
}
[data-tooltip-position="left"]:after {
right: 100%;
border-width: 6px 0 6px 6px;
border-left-color: #000;
}
/* Show the tooltip when hovering */
[data-tooltip]:hover:before,
[data-tooltip]:hover:after {
display: block;
z-index: 50;
}
Example fiddle

This is CSS issue, about overflow hidden.
Solution:
Just remove from this css rules:
.each_member_in_list .each_inlist {
.each_member_in_list {
This items:
overflow: hidden !important;
overflow: hidden;

Related

how to responsive and fix a checkbox in css

i want fix and match blue color checkbox in table
like this image
This image is for when the browser is in full screen
http://s8.picofile.com/file/8368937534/%D8%B3%D8%B3.jpg
But for me when I shrink the browser it looks like the photo below
http://s9.picofile.com/file/8368937576/%D8%B4%D8%B4.jpg
.container {
display: block;
position: relative;
/* padding-left: 35px; */
/* margin-bottom: 12px; */
cursor: pointer;
font-size: 22px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* Hide the browser's default checkbox */
.container input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
/* Create a custom checkbox */
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 50px;
width: 107px;
background-color: #eee;
}
/* On mouse-over, add a grey background color */
.container:hover input~.checkmark {
background-color: #ccc;
}
/* When the checkbox is checked, add a blue background */
.container input:checked~.checkmark {
background-color: #2196f3;
}
/* Create the checkmark/indicator (hidden when not checked) */
.checkmark:after {
content: "";
position: absolute;
display: none;
}
/* Show the checkmark when checked */
.container input:checked~.checkmark:after {
display: block;
}
/* Style the checkmark/indicator */
.container .checkmark:after {
left: 9px;
top: 5px;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 3px 3px 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
<th scope="row">7:00</th>
<td>
<label class="container" style="direction:rtl">
<input type="checkbox"checked="checked"/>
<span class="checkmark"></span>
</label>
</td>
thanks.
checkmark {width: 100%;}
and
.container .checkmark:after {
left: 9px;
top: 5px;
width: 5px;
height: 10px;
border: solid #2196f3;
border-width: 0 3px 3px 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}

Glitchy transform transition in Firefox when parent element changes from absolute to fixed

I've had a look around but couldn't find anyone else experiencing anything similar.
As the title states I'm getting a weird "glitch" in a transform transition when the parent element changes from absolute to fixed positioned ONLY in Firefox (looks completely fine in Chrome).
Thought I would throw it in here just in case someone has found a fix for this issue before.
OS: OS X El Capitan
Firefox version: 51.0.1
Codepen: http://codepen.io/anon/pen/dNmJPK
Html:
<div class="menu">
<button id="btn-menu" type="button">
<span class="menu-bars"></span>
</button>
</div>
SCSS:
#btn-menu {
position: absolute;
z-index: 100;
top: 50px;
right: 30px;
height: 49px;
width: 49px;
background-color: transparent;
padding-left: 0;
padding-right: 0;
cursor: pointer;
transition: .5s;
transform: translate(0, -50%);
border: 3px solid #000;
border-radius: 10px;
&:focus {
outline: none;
}
.menu-open & {
border-color: transparent;
position: fixed;
}
.menu-bars {
display: inline-block;
position: relative;
vertical-align: middle;
width: 21px;
height: 3px;
background-color: #000;
transition: .3s;
&:before, &:after {
content: "";
display: block;
position: absolute;
left: 0;
width: 100%;
height: 100%;
background-color: #000;
transition: .3s;
}
&:before {
top: -10px;
transform-origin: 0 0;
}
&:after {
bottom: -10px;
transform-origin: 0 100%;
}
.menu-open & {
background-color: transparent;
&:before {
top: -7px;
transform: rotate(45deg);
}
&:after {
bottom: -7px;
transform: rotate(-45deg);
}
}
}
}
JQuery:
// Open/close menu
$('#btn-menu').on('click', function() {
$('.menu').toggleClass('menu-open');
});
Thank you to #MichaelCoker for the solution of using transforms instead of top, bottom. See updated codepen below.
http://codepen.io/anon/pen/xgWpQa
&:before {
transform: translate(0, -10px);
}
&:after {
transform: translate(0, 10px);
}
.menu-open & {
background-color: transparent;
&:before {
transform: rotate(45deg);
}
&:after {
transform: rotate(-45deg);
}
}

Add corner ribbon to bootstrap site

How do I get this ribbon to be on of my bootstrap page as the top layer? Solid color and solid text.
html:
<div class="corner-ribbon bottom-left sticky orange">Hello</div>
CSS:
/* The ribbons */
.corner-ribbon{
width: 200px;
background: #e43;
position: absolute;
top: 25px;
left: -50px;
text-align: center;
line-height: 50px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
/* Custom styles */
.corner-ribbon.sticky{
position: fixed;
}
.corner-ribbon.shadow{
box-shadow: 0 0 3px rgba(0,0,0,.3);
}
.corner-ribbon.bottom-left{
top: auto;
bottom: 25px;
left: -50px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
/* Colors */
.corner-ribbon.white{background: #f0f0f0; color: #555;}
.corner-ribbon.black{background: #333;}
.corner-ribbon.grey{background: #999;}
.corner-ribbon.blue{background: #39d;}
.corner-ribbon.green{background: #2c7;}
.corner-ribbon.turquoise{background: #1b9;}
.corner-ribbon.purple{background: #95b;}
.corner-ribbon.red{background: #e43;}
.corner-ribbon.orange{background: #e82;}
.corner-ribbon.yellow{background: #ec0;}
As it is now the ribbon in on the same "level" as the background. Meaning that youtube iframe links etc. will go on the top of the ribbon.
I use this template:
https://blackrockdigital.github.io/startbootstrap-agency/
If you would recommend me to use another code, please let me know.
Just use z-index:
/* The ribbons */
.corner-ribbon{
width: 200px;
background: #e43;
top: 25px;
left: -50px;
text-align: center;
line-height: 50px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
/* Pay attention! */
z-index: 1;
position: fixed;
}
/* Custom styles */
.
corner-ribbon.sticky{
position: fixed;
}
.corner-ribbon.shadow{
box-shadow: 0 0 3px rgba(0,0,0,.3);
}
.corner-ribbon.bottom-left{
top: auto;
bottom: 25px;
left: -50px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
/* Colors */
.corner-ribbon.white{background: #f0f0f0; color: #555;}
.corner-ribbon.black{background: #333;}
.corner-ribbon.grey{background: #999;}
.corner-ribbon.blue{background: #39d;}
.corner-ribbon.green{background: #2c7;}
.corner-ribbon.turquoise{background: #1b9;}
.corner-ribbon.purple{background: #95b;}
.corner-ribbon.red{background: #e43;}
.corner-ribbon.orange{background: #e82;}
.corner-ribbon.yellow{background: #ec0;}
.annoying_block{
position: absolute;
bottom: 10px;
left: 10px;
width: 50vw;
height: 100px;
background-color: red;
}
<div class="corner-ribbon bottom-left sticky orange">Hello</div>
<div class="annoying_block">
</div>
If I understand correctly, what you're looking for is the z-index property.
.corner-ribbon{
z-index: 100;
width: 200px;
background: #e43;
position: absolute;
top: 25px;
left: -50px;
text-align: center;
line-height: 50px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}

How to make slanted border stay in correct position across different screen sizes CSS3

I am trying to achieve the slanted left and right borders like the following design
I have been successful in achieving something that looks like it, especially the left and right slanted borders in screen size 1360px. Unfortunately, when the screen size is increased/decreased the left and right borders really mess up the layout. Is there a better way of doing this so that it is responsive and borders stay in correct places?
Here is how i'm coding the layout currently:
.f-col1 {
width: 15%;
float: left;
position: relative;
margin-top: -30px;
}
.f-col1::before {
content: " ";
width: 104%;
border-bottom: 1px solid #FFF;
position: absolute;
left: 0;
top: 0;
-ms-transform: rotate(22deg);
-webkit-transform: rotate(22deg);
transform: rotate(22deg);
margin-top: -8px;
}
.f-col2 {
width: 70%;
float: left;
border-top: 1px solid #FFF;
padding-top: 12px;
}
.f-col3 {
width: 15%;
float: left;
text-align: right;
position: relative;
margin-top: -50px;
}
.f-col3::before {
content: " ";
width: 104%;
border-bottom: 1px solid #FFF;
position: absolute;
left: 0;
top: 0;
-ms-transform: rotate(-22deg);
-webkit-transform: rotate(-22deg);
transform: rotate(-22deg);
margin-top: 12px;
margin-left: -4%;
}
I have made a JSFiddle for it:
https://jsfiddle.net/btmxus6t/
Also, live link where you can see the layout is displaying correctly in 1360px but messes up when screen size is changed:
http://revolutionarycoder.com/footer/index.html
If you wish to keep the same HTML structure:
Forcing the width to stay the same so we'll make sure the element doesn't change in size, including a static top/left/right property to force it into place, rest of the border will just fall off if not neccesary. Do note that this is a custom solution, and will not be very responsive if you decide to change stuff.
.f-col1::before {
content: " ";
width: 260px;
border-bottom: 1px solid #FFF;
position: absolute;
top: -20px;
right: -10px;
-ms-transform: rotate(22deg);
-webkit-transform: rotate(22deg);
transform: rotate(22deg);
}
.f-col3::before {
content: " ";
width: 265px;
border-bottom: 1px solid #FFF;
position: absolute;
left: -10px;
top: 0;
-ms-transform: rotate(-22deg);
-webkit-transform: rotate(-22deg);
transform: rotate(-22deg);
}
You can use rotating pseudo elements with heading:
body {
background: black;
color: white;
margin: 0;
}
h2 {
box-shadow: inset 0 -1px 0 0 white;
line-height: 4.5em;
margin: 0 10em;
position: relative;
text-align: center;
}
h2:before, h2:after {
bottom: 0;
box-shadow: inherit;
content: "";
height: 1px;
display: block;
position: absolute;
width: 10em;
}
h2:before {
right: 100%;
transform: rotate(20deg);
transform-origin: right bottom;
}
h2:after {
left: 100%;
transform: rotate(-20deg);
transform-origin: left bottom;
}
<h2>Title</h2>

putting a point on the right side of a div

I am trying to put a point on the right side of a relative (no defined width) div.
HTML (using Wordpress and Bootstrap)
<div class="col-md-9 col-md-offset-1">
<h2 class="sml-title"><?php the_category(' - '); ?></h2>
...
CSS
.sml-title {
display: inline-block;
padding: 15px;
color: #fff;
background-color: #4ad2dc;
}
.sml-title:after {
right: 0px;
top: 0px;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: rgba(136, 183, 213, 0);
border-left-color: #88b7d5;
border-width: 30px;
margin-top: -30px;
}
the problem I'm running into is that the arrow goes all the way to the right side of the screen. I want it to go right after the sml-title. But I can't set a width on the sml-title because i don't control the content.
Trying to accomplish this
You can achieve the shape as either of the two ways-
.arrow {
border-right: 33px solid transparent;
height: 0;
width: 130px;
border-bottom: 34px solid black;
}
.invert {
-moz-transform: rotateX(180deg);
-webkit-transform: rotateX(180deg);
transform: transform: rotateX(180deg);
;
}
#base {
background: red;
display: inline-block;
height: 134px;
margin-left: 33px;
/* margin-top: 51px; */
position: relative;
width: 70px;
transform: rotate(90deg);
}
#base:before {
border-bottom: 35px solid red;
border-left: 36px solid transparent;
border-right: 34px solid transparent;
content: "";
height: 0;
left: 0;
position: absolute;
top: -35px;
width: 0;
}
<div class="arrow"></div>
<div class="arrow invert"></div>
<div id="base"></div>
h2{
background: #000;
color: #fff;
float: left;
font-family: Arial, sans-serif;
overflow: hidden;
padding: 20px 50px 20px 20px;
position: relative;
text-align: center;
min-width: 200px;
}
h2:before, h2:after {
content: '';
display: block;
width: 0;
height: 0;
border-top: 30px solid transparent;
border-bottom: 30px solid transparent;
border-left: 30px solid #fff;
position: absolute;
right: -10px;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
h2:before {
top: -20px;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
h2:after {
bottom: -20px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
<h2 class="sml-title">TITLE</h2>
If you use position: absolute, it will position the element within the nearest parent which is either position: relative or absolute. In your case, .sml-title has neither of those properties, so .sml-title:after is not positioned within .sml-title.
If you want your ::after pseudoelement to be positioned within .sml-title, you'll need to add position: relative or absolute to .sml-title