相关疑难解决方法(0)

如何使CSS文本修饰覆盖工作?

有些日子我发誓我会发疯.这是其中一天.我认为我的CSS在这里相当简单,但它似乎并没有起作用.我错过了什么?

我的CSS看起来像这样:

ul > li {
    text-decoration: none;
}
ul > li.u {
    text-decoration: underline;
}
ul > li > ul > li {
    text-decoration: none;
}
ul > li > ul > li.u {
    text-decoration: underline;
}
Run Code Online (Sandbox Code Playgroud)

我的HTML看起来像这样:

<ul>
  <li>Should not be underlined</li>
  <li class="u">Should be underlined
    <ul>
      <li>Should not be underlined</li>
      <li class="u">Should be underlined</li>
    </ul>
  </li>
</ul>
Run Code Online (Sandbox Code Playgroud)

然而它出现了这样的:

图片

html css text-decorations

31
推荐指数
2
解决办法
2万
查看次数

无法解除嵌套元素的直线操作

我想对标签内的<td>标签除了标签之外的<a>标签内容应用直通.我申请的风格似乎不起作用......任何想法?

这是一个可以玩的例子(我在IE8中测试): http ://jsfiddle.net/9qbsq/

这是标记的样子......

HTML

<table border=1>
  <tr class="highlight">
      <td>hello</td>
      <td><a href="#">world</a></td>
  </tr>
  <tr>
      <td>foo</td>
      <td>bar</td>
  </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

CSS

.highlight td { text-decoration:line-through; }
.highlight td a { text-decoration:none; }
Run Code Online (Sandbox Code Playgroud)

html css

5
推荐指数
3
解决办法
263
查看次数

无法从ap内部的跨度中删除下划线

基本上我有一个span在里面p,在CSSI上有p下划线,但我似乎无法删除下划线span,你会在下面找到一些代码示例:

p{text-decoration:underline;} span{text-decoration:none;}
Run Code Online (Sandbox Code Playgroud)
<p>Hello World <span> I'm spanning... </span> </p>
Run Code Online (Sandbox Code Playgroud)

所有文字都有下划线.你能帮我个忙吗?

html css

3
推荐指数
1
解决办法
367
查看次数

标签 统计

css ×3

html ×3

text-decorations ×1