Alessandro Posted November 13, 2015 Posted November 13, 2015 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/ Quote
sobakava Posted November 13, 2015 Posted November 13, 2015 I think we are trying to do something similar. My posts here might help but it is not completely solved. I can show the custom tooltip but it is clipped by the parent divs (Tunipanel) if you place it in a Tunicontainerpanel on a form, it works. http://forums.unigui.com/index.php?/topic/5915-how-to-add-css-attributes-to-the-unigui-components/ Quote
bugra Posted November 16, 2015 Posted November 16, 2015 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. 1 1 Quote
Alessandro Posted November 16, 2015 Author Posted November 16, 2015 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! Quote
mroustaei Posted September 24, 2018 Posted September 24, 2018 On 11/16/2015 at 8:44 PM, Alessandro said: Bugra Yener Sahinoglu, Thank you, it worked perfect! thank you Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.