使用CSS设置工具提示箭头的边框颜色(Set Border Color of Tooltip Arrow with CSS)
我试图将工具提示的箭头键的边框颜色设置为白色。 我能够将工具提示的底部边框颜色设置为白色,如何设置箭头的底部边框颜色呢? 这是我尝试过的:
.hint { position: relative; display: inline-block; } .hint:before, .hint:after { position: absolute; opacity: 0; z-index: 100; -webkit-transition: 0.3s ease; -moz-transition: 0.3s ease; pointer-events: none; } .hint:hover:before, .hint:hover:after { opacity: 1; } .hint:before { content: ''; position: absolute; background: transparent; border: 6px solid transparent; position: absolute; transform: translateX(-50%); } .hint:after { content: attr(data-hint); background: rgba(0, 0, 0, 0.8); border-bottom-left-radius: 20px; border-top-right-radius: 20px; color: white; padding: 8px 10px; font-size: 16px; font-style: italic; white-space: nowrap; box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.4); transform: translateX(-50%); } /* top mouse-icon*/ .hint--top:before { bottom: 100%; left: 50%; margin: 0 0 -18px 0; border-top-color: rgba(0, 0, 0, 0.8); } .hint--top:after { bottom: 100%; left: 50%; margin: 0 0 -6px -10px; } /*arrow key*/ .hint--top:hover:before { margin-bottom: -12px; border-width: 12px; /*margin-left: -56px;*/ border-color: rgba(194, 225, 245, 0); border-top-color: rgba(0, 0, 0, 0.8); } .hint--top:hover:after { margin-bottom: 12px; border-width: 10px; /*margin-left: -50px;*/ border-top-color: rgba(0, 0, 0, 0.8); border-bottom: 1px solid #f0f0f0; }
<br /><br /><br /><br /> <div class="hint hint--top" data-hint="May Peace, Mercy and Blessings of Allah be Upon You" class="intro-sub"> <a>Assalaamu 'Alaikum</a> </div>
为了澄清,我在这里包括样本图片。 现在我有这个:
但我需要类似下面给出的图像:
I was trying to set border colour white of my tooltip's arrow key. I was able to set tooltips bottom border colour white, how can I set bottom border colour of arrow too? Here is what I tried:
.hint { position: relative; display: inline-block; } .hint:before, .hint:after { position: absolute; opacity: 0; z-index: 100; -webkit-transition: 0.3s ease; -moz-transition: 0.3s ease; pointer-events: none; } .hint:hover:before, .hint:hover:after { opacity: 1; } .hint:before { content: ''; position: absolute; background: transparent; border: 6px solid transparent; position: absolute; transform: translateX(-50%); } .hint:after { content: attr(data-hint); background: rgba(0, 0, 0, 0.8); border-bottom-left-radius: 20px; border-top-right-radius: 20px; color: white; padding: 8px 10px; font-size: 16px; font-style: italic; white-space: nowrap; box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.4); transform: translateX(-50%); } /* top mouse-icon*/ .hint--top:before { bottom: 100%; left: 50%; margin: 0 0 -18px 0; border-top-color: rgba(0, 0, 0, 0.8); } .hint--top:after { bottom: 100%; left: 50%; margin: 0 0 -6px -10px; } /*arrow key*/ .hint--top:hover:before { margin-bottom: -12px; border-width: 12px; /*margin-left: -56px;*/ border-color: rgba(194, 225, 245, 0); border-top-color: rgba(0, 0, 0, 0.8); } .hint--top:hover:after { margin-bottom: 12px; border-width: 10px; /*margin-left: -50px;*/ border-top-color: rgba(0, 0, 0, 0.8); border-bottom: 1px solid #f0f0f0; }
<br /><br /><br /><br /> <div class="hint hint--top" data-hint="May Peace, Mercy and Blessings of Allah be Upon You" class="intro-sub"> <a>Assalaamu 'Alaikum</a> </div>
For clarification, I am including sample picture here. Right now I have this:
But I need something like the given image below:
原文:https://stackoverflow.com/questions/47430098
最满意答案
median
需要一个var-arg参数。 您可以使用_*
语法扩展列表,如下所示:import Numeric._ import grizzled.math.stats._ val l = List[Double](123.0, 133.0, 155.0, 166.0, 177.0) println(median(l: _*))
这编译并输出155.0。
median
expects a var-arg argument. You could expand the list with_*
syntax, like this:import Numeric._ import grizzled.math.stats._ val l = List[Double](123.0, 133.0, 155.0, 166.0, 177.0) println(median(l: _*))
This compiles and outputs 155.0.
相关问答
更多-
从https://stackoverflow.com/a/30843682/4496364的方法: import play.api.Play.current import play.api.i18n.Messages.Implicits._ 第一行已被弃用,因为Play现在可以在任何地方使用DI。 我的方法(不能说好坏): case class HttpMessage(key: String, message: String) object HttpMessage { implicit val jso ...
-
无法找到隐含的价值(Unable to find implicit value)[2021-01-26]
你必须编写println(equality(MyClass(), MyClass())因为MyClass是伴随对象(类型为MyClass.type )而不是MyClass的实例。 you have to write println(equality(MyClass(), MyClass()) since MyClass is the companion object (of type MyClass.type) instead of an instance of MyClass. -
def foo[T, HL <: HList](instance: T)( implicit gen: Generic.Aux[T, HL] ) = { val values = gen to instance println(values) } case class Bar(x: String, y: String) 您通常需要使用Aux模式,泛型是宏实现的,但会生成一个作为抽象类型成员公开的任意类型。 如果您还没有理解这里的所有单词,请在此处阅读更多内容。 def ...
-
事实证明,lift-json正在对幕后的构造函数映射做一些类的memoization,忽略了类型args。 当使用不同的类型参数对同一个类执行查找时,将返回旧的构造函数,从而导致此处出现混淆。 神秘解决了(虽然问题不是)。 It turns out lift-json is doing some memoization of class to constructor mappings behind the scenes, ignoring type args. When the lookup is perf ...
-
问题是您正在尝试使用本身需要相同隐式对象的类来定义隐式对象。 这意味着: class MyClass[T] (x: T, y: T)(implicit num: CustomNumeric[T]) 需要存在隐式CustomNumeric[T] 。 您无法使用该类型定义IntIsCustomNumeric : implicit object IntIsCustomNumeric extends customNumeric[MyClass[Int]] 实现IntIsCustomNumeric ,需要为Int ...
-
使用Scala创建更具体的隐式结构类型(Creating a more specific implicit using a structural type with Scala)[2023-07-03]
我终于找到了我失踪的那部分。 为了让隐式匹配,我不得不添加下面的类型参数: T[Dummy <: Container[_]] <: ObservableValue[Dummy] 由此产生的对象: object ObservableValue { implicit class Mappable[A](o: ObservableValue[A]) { def map[B](f: A => B): ObservableValue[B] = new ObservableValue[B] { ... -
median需要一个var-arg参数。 您可以使用_*语法扩展列表,如下所示: import Numeric._ import grizzled.math.stats._ val l = List[Double](123.0, 133.0, 155.0, 166.0, 177.0) println(median(l: _*)) 这编译并输出155.0。 median expects a var-arg argument. You could expand the list with _* syntax ...
-
您正在尝试调用Post方法,该方法将implicit Marshaller作为参数。 请注意,只要编译器可以在作用域中找到一个隐式参数,就不必提供隐式参数(请查看此内容以获取有关implicits的更多信息: Scala在哪里查找implicits? ) 但是,您的代码没有定义任何隐式Marshaller,因此编译器不知道如何将您的case class转换为HttpEntity 。 在您的情况下,您希望将其转换为带有Content-Type: application/json的HttpEntity Cont ...
-
将参数类型参数A添加到Subnamer (在Subnamer继承中)对我Subnamer (Scala版本2.10.7): class SubNamer[A <% Nameish](e: Class[A]) extends Namer[A](e) 顺便说一句,没有修改的示例仅适用于Scala版本2.11.5。 希望这可以帮助。 Adding parameter type parameter A to Namer (in the Subnamer inheritance) worked for me (Sc ...
-
REPL无法找到隐含的(REPL could not find implicit)[2022-05-14]
我认为你implicitly误解了。 它被定义为: def implicitly[T](implicit e: T): T = e 这大致意味着, implicitly[T]将返回一个类型为T的对象,该对象在当前范围内可用(范围不是精确的单词。编译器查看许多地方 ) 在你的情况下implicitly[String]只是意味着某些String类型的对象可用。 例如,这是有效的: scala> implicit val x = "Hey" x: String = Hey scala> implicitly[ ...