Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App
Next Article:
HTML DOM Style orphans Property
Next article icon

HTML DOM Style orphans Property

Last Updated : 17 Aug, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report
The DOM Style orphans property controls the minimum number of lines in a paragraph split on the old page. The default value for orphans is inherited or 2(which means a minimum of 2 lines will be left on the page if a paragraph is going to get split). The DOM Style orphans property controls the minimum number of lines in a paragraph split on the old page. The default value for orphans is inherited or 2(which means a minimum of 2 lines will be left on the page if a paragraph is going to get split). Syntax:
  • Return the orphans property:
    object.style.orphans
  • Set the orphans property:
    object.style.orphans = "number|initial|inherit"
    Property Values:
    • Number: An integer which specifies the number of lines that can be left at the end of a page or column. Negative values are not allowed.Default value is 2.
    • Initial: Sets the element to its initial value.
    • Inherit: The Element inherits its orphans property from parent element.
    Example-1: Set number of liones for orphans property. html
    <!DOCTYPE html> <html>  <head>     <title>         HTML | DOM Style orphans Property     </title>     <div id="element">         <p>           Cascading Style Sheets (CSS) is a style           sheet language used for describing the            presentation of a document written in a           markup language like HTML.[1] CSS is a            cornerstone technology of the World Wide            Web, alongside HTML and JavaScript.         </p>          <p>            <span style="color: red; font-weight: bold">             CSS is designed to enable the separation              of presentation and content, including              layout,colors, and fonts.CSS has a simple             syntax and uses a number of English keywords             to specify the names of various style              properties.A style sheet consists of a list              of rules. Each rule or rule-set consists of             one or more selectors,and a declaration block.           </span>         </p>          <p>           This separation can improve content accessibility,           provide more flexibility and control in the            specification of presentation characteristics,           enable multiple web pages to share formatting            by specifying the relevant CSS in a separate .css            file, and reduce complexity and repetition in            the structural content.         </p>          <p>           Separation of formatting and content also makes           it feasible to present the same markup page in            different styles for different rendering methods,            such as on-screen, in print, by voice            (via speech-based browser or screen reader),            and on Braille-based tactile devices. CSS also           has rules for alternate formatting if the content           is accessed on a mobile device.         </p>         <p>           The name cascading comes from the specified            priority scheme to determine which style rule           applies if more than one rule matches a particular           element. This cascading priority scheme is predictable.         </p>      </div>     <style>         #element {             columns: 12em 3;             column-gap: 3em;         }     </style>      <script>         function myFunction() {              // Number of lines that can be left at the end              // of a page or column.             document.getElementById("element").style.orphans =                                                            "5";         }         myFunction()     </script>  </head>  </html> 
    Output : As per orphans property, minimum of 5 lines will be left on the page or column(as we set orphans property "5" in the code) if a paragraph is going to split. Supported Browsers: The browser supported by HTML | DOM Style orphans Property are listed below:
    • Google Chrome 25+
    • Internet Explorer 8+
    • Opera 9.2+

    Next Article
    HTML DOM Style orphans Property

    C

    ChinkitManchanda
    Improve
    Article Tags :
    • Web Technologies
    • HTML
    • HTML-DOM

    Similar Reads

      HTML | DOM Style opacity Property
      The Style opacity property in HTML DOM used to set opacity level for an element. Opacity level defines the transparency level where value 1 represents not transparent, 0.5 represents 50% transparency and 0 represents completely transparent.It also returns opacity level of an element. Syntax: It retu
      2 min read
      HTML | DOM Style outlineStyle Property
      The Style outlineStyle property in HTML DOM is used to set or return the style of the outline around an element. Syntax: It is used to return the outlineStyle property.object.style.outlineStyleIt is used to set the outlineStyle property.object.style.outlineStyle = value Property Values: none: This i
      2 min read
      HTML | DOM Style listStyle Property
      The Style listStyle Property in HTML DOM used to set up to three list properties namely list-style-typelist-style-positionlist-style-image Syntax: It returns the listStyle property.object.style.listStyleIt used to set the listStyle property.object.style.listStyle = "type position image|initial|inher
      2 min read
      HTML | DOM Style outlineColor Property
      The DOM Style outlineColor Property is used to sets or returns the color of the outline around an Element. Syntax: It is used to Return the outlineColor propertyobject.style.outlineColor it is used to Set the outlineColor propertyobject.style.outlineColor = "color|invert|initial|inherit" Property Va
      2 min read
      HTML DOM Style widows Property
      The widows property is used to set or return the minimum number of lines. These lines must be visible at the top of a page for an element. The widows property only affects block-level elements. Syntax: Return the widows property:object.style.widowsSet the widows property:object.style.widows = "numbe
      2 min read
  • geeksforgeeks-footer-logo
    Corporate & Communications Address:
    A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
    Registered Address:
    K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
    GFG App on Play Store GFG App on App Store
    Advertise with us
    • Company
    • About Us
    • Legal
    • Privacy Policy
    • In Media
    • Contact Us
    • Advertise with us
    • GFG Corporate Solution
    • Placement Training Program
    • Languages
    • Python
    • Java
    • C++
    • PHP
    • GoLang
    • SQL
    • R Language
    • Android Tutorial
    • Tutorials Archive
    • DSA
    • Data Structures
    • Algorithms
    • DSA for Beginners
    • Basic DSA Problems
    • DSA Roadmap
    • Top 100 DSA Interview Problems
    • DSA Roadmap by Sandeep Jain
    • All Cheat Sheets
    • Data Science & ML
    • Data Science With Python
    • Data Science For Beginner
    • Machine Learning
    • ML Maths
    • Data Visualisation
    • Pandas
    • NumPy
    • NLP
    • Deep Learning
    • Web Technologies
    • HTML
    • CSS
    • JavaScript
    • TypeScript
    • ReactJS
    • NextJS
    • Bootstrap
    • Web Design
    • Python Tutorial
    • Python Programming Examples
    • Python Projects
    • Python Tkinter
    • Python Web Scraping
    • OpenCV Tutorial
    • Python Interview Question
    • Django
    • Computer Science
    • Operating Systems
    • Computer Network
    • Database Management System
    • Software Engineering
    • Digital Logic Design
    • Engineering Maths
    • Software Development
    • Software Testing
    • DevOps
    • Git
    • Linux
    • AWS
    • Docker
    • Kubernetes
    • Azure
    • GCP
    • DevOps Roadmap
    • System Design
    • High Level Design
    • Low Level Design
    • UML Diagrams
    • Interview Guide
    • Design Patterns
    • OOAD
    • System Design Bootcamp
    • Interview Questions
    • Inteview Preparation
    • Competitive Programming
    • Top DS or Algo for CP
    • Company-Wise Recruitment Process
    • Company-Wise Preparation
    • Aptitude Preparation
    • Puzzles
    • School Subjects
    • Mathematics
    • Physics
    • Chemistry
    • Biology
    • Social Science
    • English Grammar
    • Commerce
    • World GK
    • GeeksforGeeks Videos
    • DSA
    • Python
    • Java
    • C++
    • Web Development
    • Data Science
    • CS Subjects
    @GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
    We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
    Lightbox
    Improvement
    Suggest Changes
    Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
    geeksforgeeks-suggest-icon
    Create Improvement
    Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
    geeksforgeeks-improvement-icon
    Suggest Changes
    min 4 words, max Words Limit:1000

    Thank You!

    Your suggestions are valuable to us.

    What kind of Experience do you want to share?

    Interview Experiences
    Admission Experiences
    Career Journeys
    Work Experiences
    Campus Experiences
    Competitive Exam Experiences