小白教程
所有教程
关于
Search
172.69.58.90
172.69.58.90
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Css3 pr text align last”的源代码
本页内容
上一节:
Css3_pr_punctuation_trim
下一节:
Css3_pr_text_justify
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:text-align-last}}[[Category:css reference|194]] = CSS text-align-last 属性 = [[css reference|CSS 参考手册]] 把段落的最后一行向右对齐: <sample title="" desc="" lang="html" hererun="1"> p { text-align: justify; text-align-last: right; -moz-text-align-last: right; } /* 针对 Firefox 的代码 */ } </sample> <run name=""> <!DOCTYPE html> <html> <head> <style> div { text-align: justify; text-align-last: right; -moz-text-align-last: right; /* 针对 Firefox 的代码 */ } </style> </head> <body> <div> You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. </div> <p><b>注意:</b>只有 Internet Explorer 支持 text-align-last 属性。</p> <p><b>注意:</b>Firefox 支持另一个可替代该属性的属性,即 -moz-text-align-last 属性。</p> </body> </html> </run> == 浏览器支持 == 表格中的数字表示支持该属性的第一个浏览器版本号。 -moz- 后指定的数字为支持该函数的第一个版本号前缀。 {| class="table table-striped table-hover" ! 属性 ! Chrome ! Internet Explorer / Edge ! Firefox ! Safari ! Opera |- | text-align-last | 47.0 | 5.5 | 12.0 -moz- | 不支持 | 34.0 |} == 定义和用法 == text-align-last 属性规定如何对齐文本的最后一行。 '''注意:'''text-align-last 属性只有在 text-align 属性设置为 "justify" 时才起作用。 {| class="table table-striped table-hover" |width="50%"| 默认值: |width="50%"| auto |- | 继承: | 是 |- | 可动画化: | 否。请参阅 [[css animatable|可动画化(animatable)]]。 |- | 版本: | CSS3 |- | JavaScript 语法: | object.style.textAlignLast="right" <run name=""> <!DOCTYPE html> <html> <head> <style> #myDIV {text-align: justify; } </style> </head> <body> <div id="myDIV"> You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. You can use the text-align-last property to align the last line of a text, if the text has the text-align property set to justify. This text is where you will see the result of the text-align-last property. </div> <p>点击“尝试一下”按钮,改变 DIV 元素的 text-align-last 属性。</p> <button onclick="myFunction()">尝试一下</button> <script> function myFunction() { document.getElementById("myDIV").style.textAlignLast = "right"; document.getElementById("myDIV").style.MozTextAlignLast = "right"; // 针对 Firefox 的代码 } </script> <p><b>注意:</b>目前只有 Internet Explorer 支持 textAlignLast 属性。</p> <p><b>注意:</b>Firefox 支持另一个可替代该属性的属性,即 MozTextAlignLast 属性。</p> </body> </html> </run> |} == CSS 语法 == <pre> text-align-last: auto|left|right|center|justify|start|end|initial|inherit;</pre> == 属性值 == {| class="table table-striped table-hover" ! 值 ! 描述 ! 测试 |- | auto | 默认值。最后一行被调整,并向左对齐。 | [[playit.php?f=playcss_text align last&preval=auto|测试 »]] |- | left | 最后一行向左对齐。 | [[playit.php?f=playcss_text align last&preval=left|测试 »]] |- | right | 最后一行向右对齐。 | [[playit.php?f=playcss_text align last&preval=right|测试 »]] |- | center | 最后一行居中对齐。 | [[playit.php?f=playcss_text align last&preval=center|测试 »]] |- | justify | 最后一行被调整为两端对齐。 | [[playit.php?f=playcss_text align last&preval=justify|测试 »]] |- | start | 最后一行在行开头对齐(如果 text-direction 是从左到右,则向左对齐;如果 text-direction 是从右到左,则向右对齐)。 | [[playit.php?f=playcss_text align last&preval=start|测试 »]] |- | end | 最后一行在行末尾对齐(如果 text-direction 是从左到右,则向右对齐;如果 text-direction 是从右到左,则向左对齐)。 | [[playit.php?f=playcss_text align last&preval=end|测试 »]] |- | initial | 设置该属性为它的默认值。请参阅 [[css initial|initial]]。 | [[playit.php?f=playcss_text align last&preval=initial|测试 »]] |- | inherit | 从父元素继承该属性。请参阅 [[css inherit|inherit]]。 | |} [[css reference|CSS 参考手册]]
返回至“
Css3 pr text align last
”。
上一节:
Css3_pr_punctuation_trim
下一节:
Css3_pr_text_justify