Hide title from tooltip - html

I'm making a tooltip using CSS. Now using the following html code
<div title="This is some information for our tooltip." class="progress3">
</div>
and the following CSS
.progress3{
display: inline;
position: relative;
}
.progress3:hover:after{
background: #333;
background: rgba(0,0,0,.8);
border-radius: 5px;
bottom: 26px;
color: #fff;
content: attr(title);
left: 20%;
padding: 5px 15px;
position: absolute;
z-index: 98;
width: 220px;
content: attr(title);
}
.progress3:hover:before{
border: solid;
border-color: #333 transparent;
border-width: 6px 6px 0 6px;
bottom: 20px;
content: "";
left: 50%;
position: absolute;
z-index: 99;
}
Now it works, when I hover over it shows the tooltip, but it also shows the title...
How do I remove what's circled in orange in the image below.

Simply don't add the content via the title attribute, change it to something like data-tooltip.
.progress3:hover:after {
content: attr(data-tooltip);
}
jsFiddle example
You could use JS/jQuery, but given the approach you are taking, it is impossible to hide/remove it while keeping functionality as you would then have nothing to add via CSS..
HTML
<div data-tooltip="This is some information for our tooltip." class="progress3">
</div>
CSS
.progress3 {
position: relative;
width: 100px;
height: 100px;
background: red;
}
.progress3:hover:after {
background: #333;
background: rgba(0,0,0,.8);
border-radius: 5px;
bottom: 26px;
color: #fff;
content: attr(data-tooltip);
left: 20%;
padding: 5px 15px;
position: absolute;
z-index: 98;
width: 220px;
}
.progress3:hover:before {
border: solid;
border-color: #333 transparent;
border-width: 6px 6px 0 6px;
bottom: 20px;
content: "";
left: 50%;
position: absolute;
z-index: 99;
}

Related

chat message block with arrow css

I need to make this exact div with right arrow. As you can see it's little bit curved
Here's what I got. I want to make it a little bit longer and curved as in picture above
.speech-bubble {
display:inline-block;
padding:5px;
position: relative;
background: #dcf8c6;
border-radius: .4em;
}
.speech-bubble:after {
content: '';
position: absolute;
right: 0;
top: 50%;
width: 0;
height: 0;
border: 5px solid transparent;
border-left-color: #dcf8c6;
border-right: 0;
margin-top: -5px;
margin-right: -5px;
}
<div class="speech-bubble"> Hello Mike! Could you please call me back </div>
.speech-bubble {
display: inline-block;
position: relative;
}
.speech-bubble > span {
background: #dcf8c6;
border-radius: 0.4em;
display: inline-block;
padding: 10px;
z-index: 1;
}
.speech-bubble::after {
background-color: #ffffff;
border-radius: 0 0 50% 0;
border-right: 0;
bottom: 14px;
content: '';
height: 30px;
margin-top: -5px;
margin-right: -5px;
position: absolute;
right: -21px;
transform: rotate(10deg);
width: 30px;
z-index: -1;
}
.speech-bubble::before {
background-color: #dcf8c6;
border-radius: 50%;
border-right: 0;
bottom: 7px;
content: '';
height: 30px;
margin-top: -5px;
margin-right: -5px;
position: absolute;
right: -11px;
transform: rotate(20deg);
width: 30px;
z-index: -1;
}
<div class="speech-bubble">
<span>Hello Mike! Could you please call me back</span>
</div>
Here's the bubble's code
.speech-bubble {
display: inline-block;
padding: .5em 2em 2em 2em;
position: relative;
background: #dcf8c6;
border-radius: .4em;
font-family: 'Arial', sans-serif;
color: #888;
box-shadow: 2px 2px 1px rgba(0,0,0,0.2);
}
About the right arrow, what about using a background-image (png). If you want that shape you need to use border-radius. Using a .png image is way easier.
By the way, I wouldn't use a unique div to be a container and a text-wrapper...

Css : creating cornered border using css [duplicate]

This question already has answers here:
Speech bubble with arrow
(3 answers)
Closed 7 years ago.
I've to create something you see in attached image
right now i am using this as background image
background-image: url("corner.png");
background-size: cover;
and then added text but i know there does exist a css solution for creating this border for this so if someone please help me with this i tried to find but i did not find proper solution
You can also generate it from the below link and use it.
http://apps.eky.hk/css-triangle-generator/
.arrow {
width: 250px;
height: 60px;
position: relative;
background: #333;
}
.arrow:after {
content: '';
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-top: 15px solid #333;
position: absolute;
bottom: -15px;
left:25px;
}
<div class="arrow"></div>
Check this fiddle Hope you refer something like this.
a.tooltips {
position: relative;
display: inline;
}
a.tooltips span {
position: absolute;
width:140px;
color: #FFFFFF;
background: #000000;
height: 30px;
line-height: 30px;
text-align: center;
visibility: hidden;
border-radius: 6px;
}
a.tooltips span:after {
content: '';
position: absolute;
top: 100%;
left: 50%;
margin-left: -8px;
width: 0; height: 0;
border-top: 8px solid #000000;
border-right: 8px solid transparent;
border-left: 8px solid transparent;
}
a:hover.tooltips span {
visibility: visible;
opacity: 0.8;
bottom: 30px;
left: 50%;
margin-left: -76px;
z-index: 999;
}
.arrow-down {
width: 200px;
height: 50px;
position: relative;
background: red;
}
.arrow-down:after {
content: '';
width: 0;
height: 0;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
border-top: 20px solid #f00;
position: absolute;
bottom: -19px;
}
<div class='arrow-down'>fgdfgdfgfd</div>
This will help you.
it will create arrows using css.
https://css-tricks.com/snippets/css/css-triangle/

Button with Handlebar Design Pure CSS No Images

I want to design a button that looks like the one below:
I know it is a localized issue, but I can't seem to make it look like that without images
I have used both a :before and :after pseudo element in order to achieve and effect like this.
You could then use a combination of CSS transform properties. Something like a rotation with perspective should create the trapezium, and then use borders on another pseudo element to generate the lines.
A quick mockup demo would be:
.demowrapper {
margin: 0 auto;
height: 500px;
background: lightgray;
width: 300px;
box-shadow: 0 0 20px 5px dimgray;
position: relative;
}
button {
position: absolute;
bottom: 0;
width: 100%;
left: 0;
height: 30px;
background: tomato;
display: inline-block;
border: 0;
cursor: pointer;
}
button:before {
content: "";
position: absolute;
height: 20px;
width: 50px;
background: inherit;
top: -18px;
left: 50%;
border-radius: 5px 5px 0 0;
transform: translateX(-50%) perspective(50px) rotateX(45deg);
}
button:after {
content: "";
position: absolute;
height: 2px;
width: 40px;
border-top: 2px solid black;
border-bottom: 2px solid black;
top: -8px;
left: 50%;
transform: translate(-50%);
}
button:hover{
background:yellow;
<div class="demowrapper">
<button>SELECT your Button</button>
</div>

Duplicate tooltip fix?

Is there anything I can do to remove the default tooltip?
Screenshot:
This is my HTML:
<div class="filter-button"><img src="/themes/Phyre/css/img/work.png"></div>
... and this is my CSS:
.tooltip{
display: inline;
position: relative;
}
.tooltip:hover:after{
background: #6C8095;
border-radius: 5px;
bottom: 76px;
color: #fff;
text-align: center;
text-transform: uppercase;
content: attr(title);
left: 10%;
padding: 5px 10px;
position: absolute;
z-index: 98;
}
.tooltip:hover:before{
border: solid;
border-color: #6C8095 transparent;
border-width: 6px 6px 0 6px;
bottom: 70px;
content: "";
left: 40%;
position: absolute;
z-index: 99;
}
Replace
title="Work"
with
data="Work"
and
content: attr(title);
with
content: attr(data);

CSS borders brainteaser

I have the following CSS that creates a blue speech bubble (JS fiddle: http://jsfiddle.net/C5N2c/:
<div class="bubble">Content</div>
.bubble
{
cursor: pointer;
position: absolute;
left:30px;
width: 200px;
height: 50px;
padding: 0px;
background: blue;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border: blue solid 6px;
}
.bubble:after
{
content: '';
position: absolute;
border-style: solid;
border-width: 0 10px 10px;
border-color: blue transparent;
display: block;
width: 0;
z-index: 1;
top: -10px;
left: 26px;
}
.bubble:before
{
content: '';
position: absolute;
border-style: solid;
border-width: 0 15px 15px;
border-color: blue transparent;
display: block;
width: 0;
z-index: 0;
top: -21px;
left: 21px;
}
I want to add a 1px red border around the edge of this bubble, including the small speech arrow. How can I do this? It needs to be IE8 compliant.
Take a look a this Fiddle, though I havent been able to test in IE8..
The CSS:
.bubble
{
cursor: pointer;
position: absolute;
left:30px;
width: 200px;
height: 50px;
padding: 0px;
background: blue;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border: red solid 1px;
z-index:2;
}
.bubble:after
{
content: '';
position: absolute;
border-style: solid;
border-width: 0 9px 9px;
border-color: blue transparent;
display: block;
width: 0;
z-index: 1;
top: -9px;
left: 26px;
}
.bubble:before
{
content: '';
position: absolute;
border-style: solid;
border-width: 0 11px 12px;
border-color: red transparent;
display: block;
width: 0;
z-index: 0;
top: -12px;
left: 24px;
}
See working version on jsFidde
I did it sometime ago, you can just change the colours, It's not tested on IE, I am currently on OSX and it's a mess trying to view it on IE xD
html:
<div class="dialog">
<div class="triangleOutline">
<div class="triangle"></div>
</div>
<div class="dialogBox">
Hello!<br>
I'm a full CSS fancy dialog box :D
</div>
</div>
css:
body{
font-size: 100%;
font-family: "Arimo";
background: #eee;
}
.triangle,
.triangleOutline{
position:relative;
width: 0;
height: 0;
border: solid transparent;
border-width: 7px;
border-bottom-color: #aaf;
}
.triangleOutline{left: 15px;}
.triangle{
top: -6px; /* outline's width - 1 */
left: -7px; /* outline's width */
border-bottom-color: white;
}
.dialogBox{
background: white;
border: 1px solid #aaf;
padding: 0.75em;
border-radius: 3px;
min-height: 1.5em;
line-height: 1.5em;
}
Just change the colors as you like, I guess you are not using THOSE colors right? XD
Try this code:
.bubble
{
cursor: pointer;
position: absolute;
left:30px;
width: 200px;
height: 50px;
padding: 0px;
background: blue;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border: blue solid 6px;
box-shadow: 0 0 0 1px red;
}
.bubble:after
{
content: '';
position: absolute;
border-style: solid;
border-width: 0 15px 15px;
border-color: blue transparent;
display: block;
width: 0;
z-index: 0;
top: -19px;
left: 21px;
}
.bubble:before
{
content: '';
position: absolute;
border-style: solid;
border-width: 0 15px 15px;
border-color: red transparent;
display: block;
width: 0;
z-index: 0;
top: -21px;
left: 21px;
}
See this jsfiddle.