Jump to content

WORKING WITH CSS AND HINT? [SOLVED]


Alessandro

Recommended Posts

 
Hello everybody, I would like to know how to work with CSS.
What I do:
Place a Hint customized as per attached.
 
I have the following CSS code, which for all I know, we put in SeverModule.
 
.tooltip {
border-bottom: 1px dotted #000000; color: #000000; outline: none; cursor: help; text-decoration: none;
position: relative;
}
.tooltip span {
position: absolute;
}
.tooltip:hover span {
border-radius: 5px 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; 
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1);
font-family: Calibri, Tahoma, Geneva, sans-serif;
position: absolute; left: 1em; top: 2em; z-index: 99;
margin-left: 0; width: 250px;
}
.tooltip:hover img {
border: 0; margin: -10px 0 0 -55px; float: left; position: absolute;
}
.tooltip:hover em {
font-family: Candara, Tahoma, Geneva, sans-serif; font-size: 1.2em; font-weight: bold;
display: block; padding: 0.2em 0 0.6em 0;
}
.classic { padding: 0.8em 1em; }
.custom { padding: 0.5em 0.8em 0.8em 2em; }
* html a:hover { background: transparent; }
.classic {background: #FFFFAA; border: 1px solid #FFAD33; }
.critical { background: #FFCCAA; border: 1px solid #FF3334; }
.help { background: #9FDAEE; border: 1px solid #2BB0D7; }
.info { background: #9FDAEE; border: 1px solid #2BB0D7; }
.warning { background: #FFFFAA; border: 1px solid #FFAD33; }
 
 
Now, how to make my UniLabel1 to show you the hint as the attached?
 
Grateful for the help
 
 
 
================================================
 
 
COMO TRABALHAR COM CSS?
Olá pessoal, eu gostaria de saber como trabalhar com o CSS.
O que quero fazer:
Colocar um Hint personalizado conforme a figura em anexo.
 
Eu tenho o Código CSS a seguir, que pelo que sei, nós colocamos no SeverModule.
 
 
Agora, como fazer com que meu UniLabel1 mostre para o usuário o hint como a figura em anexo?
 
Grato pela ajuda
 

 

Fonte: http://sixrevisions.com/css/css-only-tooltips/

post-2783-0-93545800-1447437811_thumb.png

Link to comment
Share on other sites

Hi Alessandro

 

First thing you need to do is change some codes in your css.

 

Change

.tooltip span {
; position: absolute;
}

to

.tooltip span {

 display:none;
}

and add

display:inline;

into " .tooltip:hover span "

 

after add this code in UniLabel's Caption (I copied from the website you add)

Classic<span class="classic">This is just an example of what you can do using a CSS tooltip, feel free to get creative and produce your own!</span>

and change UniLabel's TextConversion properties to txtHTML.

 

Last thing you gonna do is add this code bellow in your FormCreate event

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
 UniSession.AddJS(UniLabel1.JSName+'.addCls("tooltip");');
end;

But you can only use UniLabel Component for this. It doesn't fit other components.

  • Like 1
  • Upvote 1
Link to comment
Share on other sites

Hi Alessandro

 

First thing you need to do is change some codes in your css.

 

Change

.tooltip span {
; position: absolute;
}

to

.tooltip span {

 display:none;
}

and add

display:inline;

into " .tooltip:hover span "

 

after add this code in UniLabel's Caption (I copied from the website you add)

Classic<span class="classic">This is just an example of what you can do using a CSS tooltip, feel free to get creative and produce your own!</span>

and change UniLabel's TextConversion properties to txtHTML.

 

Last thing you gonna do is add this code bellow in your FormCreate event

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
 UniSession.AddJS(UniLabel1.JSName+'.addCls("tooltip");');
end;

But you can only use UniLabel Component for this. It doesn't fit other components.

 

 

Bugra Yener Sahinoglu, Thank you, it worked perfect!
Link to comment
Share on other sites

  • 2 years later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...