且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何解决这个特定的嵌套元素?

更新时间:2022-10-31 18:39:19

" Timo" < TI ** @ anonymous.biz>写道:
"Timo" <ti**@anonymous.biz> wrote:
我将不胜感激这个元素解决问题的一些帮助。我想改变H的字体大小。 Hello World在下面的HTML中使用
第一个字母,但不能到达元素。

< div id ="拿破仑">
< div>
< a id =" 1000"类= QUOT;炸药&QUOT; href =" test.htm"> Hello World< / a>
< / div>
< / div>

如何解决锚点使用组合类
.dynamite和id #napoleon以及A和DIV选择器?这个简单的CSS没有效果:.dynamite:第一个字母{font-size:medium}
I''d be grateful for some help on this element addressing question. I want to
change the font-size of the "H" of "Hello World" in the following HTML using
first-letter, but cannot "reach" the element.

<div id="napoleon">
<div>
<a id="1000" class="dynamite" href="test.htm">Hello World</a>
</div>
</div>

How do I address the contents of the anchor using a combination class
.dynamite and id #napoleon and the A and DIV selectors? This simple CSS has
no effect: .dynamite:first-letter{ font-size: medium}




来自规范:


":第一个字母的伪元素适用于block,list-item,

table-cell,table-caption和inline-block元素。"


-

Spartanicus



From the spec:

"The :first-letter pseudo-element applies to block, list-item,
table-cell, table-caption and inline-block elements."

--
Spartanicus


Spartanicus< me@privacy.net>写道:
Spartanicus <me@privacy.net> wrote:
" Timo" &LT; TI ** @ anonymous.biz&GT;写道:
"Timo" <ti**@anonymous.biz> wrote:
我很感激这个元素解决问题的一些帮助。
我想改变H的字体大小。 Hello World在
下面的HTML使用第一个字母,但不能到达元素。

< div id ="拿破仑"> < div>
< a id =" 1000"类= QUOT;炸药&QUOT; href =" test.htm"> Hello World< / a>
< / div> < / div>

如何使用组合.dynamite和id #napoleon以及A和DIV选择器来解决锚点的内容?这个简单的CSS没有效果:.dynamite:首字母{font-size:
medium}
I''d be grateful for some help on this element addressing question.
I want to change the font-size of the "H" of "Hello World" in the
following HTML using first-letter, but cannot "reach" the element.

<div id="napoleon"> <div>
<a id="1000" class="dynamite" href="test.htm">Hello World</a>
</div> </div>

How do I address the contents of the anchor using a combination
class .dynamite and id #napoleon and the A and DIV selectors? This
simple CSS has no effect: .dynamite:first-letter{ font-size:
medium}



来自规范:

table-cell,table-caption和inline-block元素。"



From the spec:

"The :first-letter pseudo-element applies to block, list-item,
table-cell, table-caption and inline-block elements."


>
实际上,这是来自CSS 2.1草案(状态:候选人

推荐)。正式地说,当前的规范是CSS 2.0,

模糊地说::第一个字母的伪元素仅匹配

块级元素的部分。


无论如何,它不适用于< a>元素默认。这里有一个简单的

解决方案是使用


#napoleon a {display:block; }

#napoleon a:第一个字母{...}


或者,可以使用伪元素作为封闭的

阻止:


#napoleon div:第一个字母{...}


使用#napoleon:第一个字母不似乎工作(在IE 6或

Mozilla),也许是因为介入< div>标记。


-

Yucca, http://www.cs.tut.fi/~jkorpela/


" Jukka K. Korpela" &LT; JK ****** @ cs.tut.fi&GT;写道:
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote:
来自规范:

":第一个字母的伪元素适用于块,列表 - item,
table-cell,table-caption和inline-block元素。
From the spec:

"The :first-letter pseudo-element applies to block, list-item,
table-cell, table-caption and inline-block elements."



实际上,这是来自CSS 2.1草案(状态:候选人>推荐)。正式地说,当前的规范是CSS 2.0,它晦涩地说::第一个字母的伪元素只匹配
块级元素的部分。



Actually that''s from the CSS 2.1 draft (status: Candidate
Recommendation). Formally the current specification is CSS 2.0, which
obscurely says: "The :first-letter pseudo-element matches parts of
block-level elements only."




对于不熟悉的人来说:2.1规格是使用的规格,无论它是什么,

官方身份。


-

Spartanicus



For the uninitiated: the 2.1 spec is the spec to use regardless of it''s
official status.

--
Spartanicus