热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

AS3的CSS标识符中的错误?-AbuginCSSidentifiersforAS3?

Imnotsureifitsabug,butisthereanywaytotargettheclassorididentifiertostyleh

I'm not sure if it's a bug, but is there any way to target the "class" or "id" identifier to style heading tags (h1 to h6) using ActionScript 3.0 CSS? It works fine with all the other tags.

我不确定它是否是一个bug,但有没有办法使用ActionScript 3.0 CSS将“class”或“id”标识符定位到样式标题标签(h1到h6)?它适用于所有其他标签。

eg.:

text

// I can use .style1 or p in the CSS

text //我可以在CSS中使用.style1或p

text

// I can't use .style2 in the CSS, only h1

text //我不能在CSS中使用.style2,只有h1

2 个解决方案

#1


h1 is an html-element that implies some kind of hierarchy. In flash there are no such tags as they only use them for how things look like and not how they are structured.

h1是一个隐含某种层次结构的html元素。在flash中没有这样的标签,因为它们只使用它们来表示事物的样子而不是它们的结构。

You can achieve what you might want to with something similar to the following:

您可以使用类似于以下内容的方式实现您可能想要的目标:

The html:

Headline

Text

The css:

p.headline {font-size: 20pt; font-weight: bold;}
p.text {font-size: 12pt;}

#2


It looks like h1 is not supported by the TextField class. Look in the docs for the htmlText property for a list of supported tags.

看起来TextField类不支持h1。在htmlText属性的文档中查找支持的标记列表。


推荐阅读
author-avatar
鱼影沫1457
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有