
- HTML 教程
- HTML - 首页
- HTML - 路线图
- HTML - 简介
- HTML - 历史与发展
- HTML - 编辑器
- HTML - 基本标签
- HTML - 元素
- HTML - 属性
- HTML - 标题
- HTML - 段落
- HTML - 字体
- HTML - 块
- HTML - 样式表
- HTML - 格式化
- HTML - 引用
- HTML - 注释
- HTML - 颜色
- HTML - 图片
- HTML - 图片地图
- HTML - Iframes
- HTML - 短语元素
- HTML - 元标签
- HTML - 类
- HTML - ID
- HTML - 背景
- HTML 表格
- HTML - 表格
- HTML - 表头与标题
- HTML - 表格样式
- HTML - 表格 Colgroup
- HTML - 嵌套表格
- HTML 列表
- HTML - 列表
- HTML - 无序列表
- HTML - 有序列表
- HTML - 定义列表
- HTML 链接
- HTML - 文本链接
- HTML - 图片链接
- HTML - 邮箱链接
- HTML 颜色名称与值
- HTML - 颜色名称
- HTML - RGB
- HTML - HEX
- HTML - HSL
- HTML 表单
- HTML - 表单
- HTML - 表单属性
- HTML - 表单控件
- HTML - 输入属性
- HTML 多媒体
- HTML - 视频元素
- HTML - 音频元素
- HTML - 嵌入多媒体
- HTML 头部
- HTML - Head 元素
- HTML - 添加 Favicon
- HTML - Javascript
- HTML 布局
- HTML - 布局
- HTML - 布局元素
- HTML - 使用 CSS 进行布局
- HTML - 响应式设计
- HTML - 符号
- HTML - 表情符号
- HTML - 样式指南
- HTML 图形
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - 拖放 API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web 存储
- HTML - 服务器发送事件
- HTML 其他
- HTML - 文档对象模型 (DOM)
- HTML - MathML
- HTML - 微数据
- HTML - IndexedDB
- HTML - Web 消息传递
- HTML - Web CORS
- HTML - Web RTC
- HTML 演示
- HTML - 音频播放器
- HTML - 视频播放器
- HTML - 网页幻灯片
- HTML 工具
- HTML - Velocity Draw
- HTML - 二维码
- HTML - Modernizer
- HTML - 验证
- HTML - 颜色拾取器
- HTML 参考
- HTML - 速查表
- HTML - 标签参考
- HTML - 属性参考
- HTML - 事件参考
- HTML - 字体参考
- HTML - ASCII 码
- ASCII 码表查询
- HTML - 颜色名称
- HTML - 实体
- MIME 媒体类型
- HTML - URL 编码
- 语言 ISO 代码
- HTML - 字符编码
- HTML - 已弃用的标签
- HTML 资源
- HTML - 快速指南
- HTML - 有用资源
- HTML - 颜色代码生成器
- HTML - 在线编辑器
HTML - DOM样式对象 orphans 属性
HTML DOM 样式对象 **orphans** 属性设置或返回元素在页面底部可见的最小行数。它只影响块级元素。
语法
设置 orphans 属性object.style.orphans= "number | initial | inherit";获取 orphans 属性
object.style.orphans;
属性值
值 | 描述 |
---|---|
数字 | 指定最小可见行数。其默认值为 2,不接受负值。 |
initial | 用于将此属性设置为其默认值。 |
inherit | 用于继承其父元素的属性。 |
返回值
它返回一个字符串值,表示在页面底部打印的最小行数。
HTML DOM 样式对象 'orphans' 属性示例
以下示例为 div 元素设置 orphans 属性,该属性显示对子元素(即 span 元素)的影响。您可以设置 orphans 值以查看页面末尾的行数,最初设置为 3 并以绿色突出显示。
您需要在 **自己的系统上运行此代码**才能查看效果。
<!DOCTYPE html> <html> <head> <title> HTML DOM Style Object orphans Property </title> <style> #orphan { columns: 12em 3; column-gap: 3em; } span { color: #04af2f; } </style> </head> <body> <label for="orphans">Nnumber of orphans: </label> <input type="number" id="orphans" name="orphans" min="3" max="7"> <button onclick="fun()">Orphans</button> <div id="orphan"> <p> JavaScript is a lightweight, interpreted programming language. It is commonly used to create dynamic and interactive elements in web applications. JavaScript is very easy to implement because it is integrated with HTML. It is open and cross-platform. </p> <p> <span> This JavaScript tutorial has been designed for beginners as well as working professionals to help them understand the basic to advanced concepts and functionalities of JavaScript. It covers most of the important concepts related to JavaScript such as operators, control flow, functions, objects, OOPs, Asynchronous JavaScript, Events, DOM manipulation and much more. </span> </p> <p> JavaScript is a MUST for students and working professionals to become a great Software Engineer, especially when they are working in Web Development Domain. We will list down some of the key advantages of learning JavaScript.There could be 1000s of good reasons to learn JavaScript Programming. </p> <p> But one thing for sure, to learn any programming language, not only JavaScript, you just need to code, and code, and finally code until you become an expert. As mentioned before, JavaScript is one of the most widely used programming languages (Front-end as well as Back-end). It has its presence in almost every area of software development. </p> </div> <script> function fun() { let x = document.getElementById("orphans").value; document.getElementById("orphan") .style.orphans = x; } </script> </body> </html>
支持的浏览器
属性 | ![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
orphans | 是 25 | 是 12 | 否 | 是 1.3 | 是 9.2 |
html_dom_style_object_reference.htm
广告