CSS text-align
最编程
2024-08-10 12:58:43
...
CSS text-align 属性定义与用法
text-align属性指定元素文本的水平对齐方式。
默认值: | left if direction is ltr, and right if direction is rtl |
---|---|
继承: | yes |
版本: | CSS1 |
JavaScript 语法: | object.style.textAlign="right" |
CSS text-align 属性值
值 | 描述 |
---|---|
left | 把文本排列到左边。默认值:由浏览器决定。 |
right | 把文本排列到右边。 |
center | 把文本排列到中间。 |
justify | 实现两端对齐文本效果。 |
inherit | 规定应该从父元素继承 text-align 属性的值。 |
CSS text-align 浏览器支持
所有主流浏览器都支持text-align属性。
注意:IE7和更早的版本不支持"inherit"的值。IE8需要定义!DOCTYPE。IE9支持"inherit"。
CSS text-align 实例
h1, h2, 和 h3元素设置文本的对齐方式:
h1 {text-align:center}
h2 {text-align:left}
h3 {text-align:right}
在线运行
相关文章
CSS 教程: CSS 文本
上一篇: 实战演示:CSS文本装饰颜色的应用
下一篇: CSS text-indent
推荐阅读
-
CSS3手撸特效登录页面:让我们一起分享
-
手撸一个在线css三角形生成器-在线css三角形生成器预览
-
css padding 简写 - 码农教程
-
教你创建 CSS 图片廊 - 码农教程
-
CSS :active选择器用于设置被点击的链接的样式
-
2048小游戏:全面解析并提供HTML、CSS、JavaScript源代码
-
Java 8新特性探究(十三)JavaFX 8新特性以及开发2048游戏-JavaFX历史## 跟java在服务器端和web端成绩相比,桌面一直是java的软肋,于是Sun公司在2008年推出JavaFX,弥补桌面软件的缺陷,请看下图JavaFX一路走过来的改进 从上图看出,一开始推出时候,开发者需使用一种名为JavaFX Script的静态的、声明式的编程语言来开发JavaFX应用程序。因为JavaFX Script将会被编译为Java bytecode,程序员可以使用Java代码代替。 JavaFX 2.0之后的版本摒弃了JavaFX Script语言,而作为一个Java API来使用。因此使用JavaFX平台实现的应用程序将直接通过标准Java代码来实现。 JavaFX 2.0 包含非常丰富的 UI 控件、图形和多媒体特性用于简化可视化应用的开发,WebView可直接在应用中嵌入网页;另外 2.0 版本允许使用 FXML 进行 UI 定义,这是一个脚本化基于 XML 的标识语言。 从JDK 7u6开始,JavaFx就与JDK捆绑在一起了,JavaFX团队称,下一个版本将是8.0,目前所有的工作都已经围绕8.0库进行。这是因为JavaFX将捆绑在Java 8中,因此该团队决定跳过几个版本号,迎头赶上Java 8。 ##JavaFx8的新特性 ## ###全新现代主题:Modena 新的Modena主题来替换原来的Caspian主题。不过在Application的start方法中,可以通过setUserAgentStylesheet(STYLESHEET_CASPIAN)来继续使用Caspian主题。 参考http://fxexperience.com/2013/03/modena-theme-update/ ###JavaFX 3D 在JavaFX8中提供了3D图像处理API,包括Shape3D (Box, Cylinder, MeshView, Sphere子类),SubScene, Material, PickResult, LightBase (AmbientLight 和PointLight子类),SceneAntialiasing等。Camera类也得到了更新。从JavaDoc中可以找到更多信息。 ###富文本 强化了富文本的支持 ###TreeTableView ###日期控件DatePicker 增加日期控件 ###用于 CSS 结构的公共 API
-
混淆 Java WAR Maven 中的 CSS/JS Class 实现加密
-
浏览 Bootstrap CSS 的总览
-
探索未知的CSS:发现新奇的特性