css - 如何将CSS样式应用到标签的弹出标题元素

标签 css forms element

我的表单标签如下:

<label id="jform_email-lbl" for="jform_email" class="hasTip required" 
title="Email Address::Please enter the email address associated with your User 
account.&lt;br /&gt;A verification code will be sent to you. Once you have 
received the verification code, you will be able to choose a new password for 
your account.">Email Address:<span class="star">&#160;*</span></label>

我想对弹出框“标题”元素应用不同的样式 (#000)。

不是表单上显示的“电子邮件地址:”标签(#fff)。

我以为我可以执行以下操作,但它不起作用:

label#jform_email-lbl[type="title"] { 
    color: #000; 
}

****已编辑** 答案如下 - 对于任何其他试图找到正确 css 的人:**

div.tip .tip-title {
   color: #E77600 !important;
   font-weight: bold;
}
div.tip .tip-text {
   color: #979797 !important;
   font-weight: bold;
}

最佳答案

后来编辑,我明白了这个问题:

<!DOCTYPE html>
<html>
<head>
<style>
label {
  color: #900;
  text-decoration: none;
}

label:hover {
  color: red;
  position: relative;
}

label[title]:hover:after {
  content: attr(title);
  padding: 4px 8px;
  color: red;
  position: absolute;
  left: 0;
  top: 100%;
  white-space: nowrap;
  z-index: 20px;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  border-radius: 5px;
  -moz-box-shadow: 0px 0px 4px #222;
  -webkit-box-shadow: 0px 0px 4px #222;
  box-shadow: 0px 0px 4px #222;
  background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));
  background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
  background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
}


</style>
</head>

<label id="jform_email-lbl" for="jform_email" class="hasTip required" title="something">Email Address:<span class="star">&#160;*</span></label>

</html>

关于css - 如何将CSS样式应用到标签的弹出标题元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19424655/

相关文章:

html - 如何通过 CSS 实现 "break line"?

javascript - 用于表单验证的 JS 函数

javascript - Angular - DOM .contains() 找不到元素且 ParentNode 为 null

javascript - http GET 从浏览器的 DOM 元素上返回完全不同的 HTML 元素和 innerHTML

jquery - 响应式导航子标题重叠

css - Twitter Bootstrap 3 导航栏

php - 通过添加到购物车 paypal 购买多件商品

arrays - PostgreSQL:通过函数将对象添加到jsonb数组

javascript - 使用 ng-repeat 的网格问题

php - 此表单输入需要多少卫生处理?