- 浏览: 802541 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (360)
- Java (101)
- JPA/Hibernate (10)
- Spring (14)
- Flex/BlazeDS (37)
- Database (30)
- Lucene/Solr/Nutch (0)
- Maven/Ant (25)
- CXF/WebService (3)
- RPC/RMI/SOAP/WSDL (1)
- REST (6)
- TDD/BDD/JUnit (1)
- Servlet/JSP (2)
- AI/MachineLearning (3)
- Resource (1)
- 字符编码 (2)
- OOA/OOPS/UML (5)
- DesignPattern (8)
- 算法与数据结构 (11)
- Web&App Server (13)
- 并发&异步&无阻塞 (7)
- Entertainment (4)
- JavaScript/ExtJS (45)
- CodeStyle&Quality (1)
- svn/git/perforce (8)
- JSON (2)
- JavaScriptTesting (4)
- Others (6)
- RegularExpression (2)
- Linux/Windows (12)
- Protocal (2)
- Celebrities (1)
- Interview (1)
- 计算机语言 (1)
- English (2)
- Eclipse (5)
- TimeZone/时区 (1)
- Finance (1)
- 信息安全 (1)
- JMS/MQ (2)
- XSD/XML/DTD (3)
- Android (4)
- 投资 (3)
- Distribution (3)
- Excel (1)
最新评论
-
qdujunjie:
如果把m换成具体的数字,比如4或者5,会让读者更明白
m阶B树中“阶”的含义 -
java-admin:
不错,加油,多写点文章
关于Extjs的mixins和plugin -
xiehuaidong880827:
你好,我用sencha cmd打包完本地工程后,把app.js ...
ExtJS使用Sencha Cmd合并javascript文件为一个文件 -
KIWIFLY:
lwpan 写道inverse = "true&qu ...
Hibernate中什么时候使用inverse=true -
luedipiaofeng:
good
消除IE stop running this script弹出框
If you define a style in only one place in a document, Flex uses that definition to set a property’s value. However, an application can have several style sheets, local style definitions, external style properties, and style properties set directly on component instances. In such a situation, Flex determines the value of a property by looking for its definition in all these places in a specific order.
Lower-level styles take precedence over higher-level or external styles. If you set a style on an instance, and then set the style globally, the global style does not override the local style, even if you set it after you set the local style.
Style inheritance order
The order in which Flex looks for styles is important to understand so that you know which style properties apply to which controls.
Flex looks for a style property that was set inline on the component instance. If no style was set on the instance using an inline style, Flex checks if a style was set using an instance’s setStyle() method. If it did not directly set the style on the instance, Flex examines the styleName property of the instance to see if a style declaration is assigned to it.
If you did not assign the styleName property to a style declaration, Flex looks for the property on type selector style declarations. If there are no type selector declarations, Flex checks the global selector. If all of these checks fail, the property is undefined, and Flex applies the default style.
In the early stages of checking for a style, Flex also examines the control’s parent container for style settings. If the style property is not defined and the property is inheritable, Flex looks for the property on the instance’s parent container. If the property isn’t defined on the parent container, Flex checks the parent’s parent, and so on. If the property is not inheritable, Flex ignores parent container style settings.
The order of precedence for style properties, from first to last, is as follows:
If you later call the setStyle() method on a component instance, that method takes precedence over all style settings, including inline.
Style definitions in <fx:Style> tags, external style sheets, and the defaults.css style sheet follow an order of precedence. The same style definition in defaults.css is overridden by an external style sheet that is specified by an <fx:Style source="stylesheet"/> tag, which is overridden by a style definition within an <fx:Style> tag.
注意点,如果你用styleManager.loadStyleDeclarations("assets/dynamicStyle.swf",true)的方式动态加载样式,那么动态加载的样式在生命周期内将会覆盖上述定义的样式,当然如果某些样式并没有出现在动态加载的样式里面,当然是不会被覆盖的,可以多次动态加载样式。
Lower-level styles take precedence over higher-level or external styles. If you set a style on an instance, and then set the style globally, the global style does not override the local style, even if you set it after you set the local style.
Style inheritance order
The order in which Flex looks for styles is important to understand so that you know which style properties apply to which controls.
Flex looks for a style property that was set inline on the component instance. If no style was set on the instance using an inline style, Flex checks if a style was set using an instance’s setStyle() method. If it did not directly set the style on the instance, Flex examines the styleName property of the instance to see if a style declaration is assigned to it.
If you did not assign the styleName property to a style declaration, Flex looks for the property on type selector style declarations. If there are no type selector declarations, Flex checks the global selector. If all of these checks fail, the property is undefined, and Flex applies the default style.
In the early stages of checking for a style, Flex also examines the control’s parent container for style settings. If the style property is not defined and the property is inheritable, Flex looks for the property on the instance’s parent container. If the property isn’t defined on the parent container, Flex checks the parent’s parent, and so on. If the property is not inheritable, Flex ignores parent container style settings.
The order of precedence for style properties, from first to last, is as follows:
- Inline
- Class selector
- Type selectors (most immediate class takes precedence when multiple selectors apply the same style property)
- Ancestor class’s type selector
- Parent chain (inheriting styles only)
- Theme defaults.css file
- global selector
If you later call the setStyle() method on a component instance, that method takes precedence over all style settings, including inline.
Style definitions in <fx:Style> tags, external style sheets, and the defaults.css style sheet follow an order of precedence. The same style definition in defaults.css is overridden by an external style sheet that is specified by an <fx:Style source="stylesheet"/> tag, which is overridden by a style definition within an <fx:Style> tag.
注意点,如果你用styleManager.loadStyleDeclarations("assets/dynamicStyle.swf",true)的方式动态加载样式,那么动态加载的样式在生命周期内将会覆盖上述定义的样式,当然如果某些样式并没有出现在动态加载的样式里面,当然是不会被覆盖的,可以多次动态加载样式。
发表评论
-
Panel高度为0但里面的组件依旧显示
2013-04-24 14:34 1118解决办法: 把Panel中的内容组件用<s:Scroll ... -
约束布局constraint layout
2013-03-01 14:02 1850约束布局constraint layout要点: 1)只有支持 ... -
根据屏幕分辨率动态调整组件大小
2013-02-22 17:34 1550将代码写在组件的preInitialize事件监听器里面 简化 ... -
设置Flex组件的尺寸大小
2013-02-21 16:17 1574深红色部分标明了需注意的地方 另外要注意组件和容器的生命周 ... -
Flex minWidth minHeight
2013-02-04 16:17 1560minWidth 这个值并不是给组件自己用的,而是给组件的父容 ... -
ActionScript遍历绑定(BindProperty,BindSetter,ChangeWatcher)
2013-02-01 10:11 2494注意: 为防止内存益处,记得调用watcherInstance ... -
Flex程序适应不同屏幕尺寸和分辨率(滚动条)
2013-01-31 15:02 9860FlashBuilder编译后自动生成的xx.html里面定义 ... -
FlexContext, FlexClient,FlexSession
2013-01-15 15:05 2417使用了BlazeDS后,可以从FlexContext中获取一系 ... -
防止RemoteObject批处理AMF消息
2013-01-14 17:01 1310问题描述: 如果你在短时内调用同一个java对象上的两个方法, ... -
自动检测http和https的RemoteObject
2013-01-13 10:30 1812package { import util.Bro ... -
flex浏览器相关辅组类
2012-12-06 13:39 1282package util { import flash. ... -
Flex可变参数带来的问题
2012-12-06 13:34 1524当你在flex的方法中用了可变参数后,你会发现这些参数传到ja ... -
flex如何通过类名称实例化对象
2012-11-30 13:52 2765Getting the class from an objec ... -
flexlib的treeGrid用法
2012-11-30 13:46 1321为了使用treeGrid,通常你需要定义自己的DataDesc ... -
自定义flex tree的DataDescriptor
2012-11-30 13:42 1439public class EnvironmentDataDes ... -
关于Boolean类型在flex与java中间传递的问题
2012-11-30 13:38 1283/** *为简化,只列举两个字段 */ publi ... -
给Flex的Tree赋值方式(XML和ArrayCollection)
2012-11-30 09:33 40571)方式一,mxml内嵌xml数据赋值方式,Embedded ... -
Custom Alert
2012-11-26 19:21 0<?xml version="1.0&qu ... -
Flex服务端分页
2012-11-14 17:00 1084Structure: model event ... -
Flex可携带数据的Aler组件(DataCarriableAlert)
2012-11-14 16:52 1363package component.alert { ...
相关推荐
- `auto`:如果没有设置该属性,则继承父元素的`align-items`属性。 - 其他值:`flex-start`, `flex-end`, `center`, `baseline`, `stretch`。 #### 四、Flex项目属性 除了容器属性外,还可以通过设置项目自身的...
<mx:Style source="style.css" /> 移动图片" click="myMove.play()"/> ``` 在这个例子中,`<mx:Move>`定义了一个Move动画,`target`属性指定了动画作用的对象,`xFrom`和`xTo`定义了动画中的起点和终点坐标...
本项目使用SASS(Syntactically Awesome Style Sheets)预处理器语言,进一步提高了CSS的可维护性和可扩展性。同时,借助gulp作为前端构建工具,可以自动化地完成样式编译、压缩等任务,提高开发效率。 1. **...
标准盒模型的宽度等于style里的width+margin+border+padding的总和,而怪异盒模型的宽度等于style里的width。 三、CSS选择器 CSS选择器包括: 1. 通配符:* 2. ID选择器:#ID 3. 类选择器:.class 4. 元素选择器...
1. **顺序规则**:当设置速记属性时,通常遵循特定的顺序,如`margin`是`top right bottom left`,`padding`和`border`相同,`font`是`font-size font-weight font-style font-variant font-family`。 2. **部分覆盖...
CSS(Cascading Style Sheets,层叠样式表)是一种用于描述网页样式的语言,广泛应用于Web开发领域。本文总结了常见的CSS面试题,涵盖了CSS基础知识、布局相关、样式控制、选择器、css引入方式、动画、性能优化等多...
- **层叠性**:当两个或多个CSS规则应用于同一个元素并且它们具有相同的权重时,会根据CSS的层叠顺序来决定哪个规则生效。 - **继承性**:某些CSS属性可以被子元素继承。 #### 特殊性计算 - **HTML内样式**:具有...
2. 盒模型布局(display: block/inline-block/flex/grid):现代CSS提供了更灵活的布局方式,如Flexbox(弹性盒子)和Grid(网格布局)。 六、响应式设计 使用媒体查询(@media)实现不同设备和屏幕尺寸下的样式...
在网页设计领域,CSS(Cascading Style Sheets)布局是构建网页结构的关键技术。它允许开发者将样式与内容分离,使网页更具可读性、可维护性和灵活性。本压缩包"css布局实例.rar"提供了丰富的实例,对于初学者来说,...
6. **层叠和继承**:CSS的层叠特性使得样式可以按特定顺序应用,而继承则让子元素可以继承父元素的某些样式,简化了代码维护。 在"经典CSS+DIV布局模板"中,你可能会看到各种布局结构,如: - **一栏布局**:适用...
在网页设计领域,CSS(Cascading Style Sheets)和DIV元素是构建现代网页布局不可或缺的工具。本篇文章将深入探讨CSS的使用以及如何利用DIV进行布局。 首先,CSS是一种样式表语言,用于描述HTML或XML(包括如SVG、...
在网页设计领域,CSS(Cascading Style Sheets)是至关重要的技术,用于定义HTML或XML(包括SVG、MathML等各种XML方言)文档的呈现。本教程将深入解析CSS的细节,帮助你理解如何有效地定义样式规则,从而创建美观且...
在网页设计领域,CSS(Cascading Style Sheets)是不可或缺的一部分,它负责定义网页元素的样式、布局和视觉呈现效果。通过学习CSS,你可以掌握如何创建美观、响应式的网页,并提高用户体验。以下是一份详细的CSS...
3. Flex布局:通过`display: flex`实现灵活的弹性布局,可调整元素大小和顺序。 4. Grid布局:使用`display: grid`创建二维网格布局,适用于复杂网页设计。 5. 响应式设计:利用媒体查询(@media rule)根据设备屏幕...
CSS,全称Cascading Style Sheets(层叠样式表),是网页设计中的核心技术之一,用于控制网页元素的样式、布局和呈现。它与HTML或XML等标记语言结合使用,为网页添加视觉效果和结构化表现。在本篇内容中,我们将深入...
9. CSS优先级和继承:CSS中的选择器优先级决定了样式应用的顺序。理解这一点对于调试和优化样式至关重要。同时,CSS的继承特性使得子元素可以继承父元素的某些样式。 10. 浏览器兼容性:编写CSS时,需要注意不同...
继承性 必须是父子(有层叠嵌套的关系)结构 大部分的css效果是可以 2.优先级 1.浏览器默认样式 2.内部样式和外部样式(就近原则) 3.内联样式 4.!important; 绝对优先使用() 格式 p{ color:red !...
- **层叠**:当多个样式应用到同一个元素时,CSS根据特定的层叠级别(如源顺序、特异性、重要性等)决定最终样式。 - **继承**:某些属性可以被子元素继承,如字体、颜色,但不是所有属性都能继承,如`margin`、`...
3. Flex布局:弹性盒子模型,适用于一维布局,可自动调整元素大小和顺序,实现响应式设计。 4. Grid布局:网格布局,适用于二维布局,可精确控制元素在网格中的位置和大小,是现代网页布局的新标准。 四、响应式...