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

HTML | DOM Style columnRuleWidth Property

Last Updated : 08 Aug, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

The Style columnRuleWidth property in HTML DOM is used to define or determine the width of the rule between the columns.

Syntax:

  • It returns the columnRuleWidth property.
object.style.columnRuleWidth
  • It is used to set columnRuleWidth property.
object.style.columnRuleWidth = "medium|thin|thick|length| initial|inherit"

Property Values:

  • thin: It is used to set a thin rule between the columns.
  • medium: It is used to create a medium width rule between the columns. It is the default width.
  • thick: It creates a thick width rule between the columns.
  • length: It is used to set the width by length. It does not takes negative value.
  • initial: It is used to set columnRuleWidth property to its default value.
  • inherit: This property is inherited from its parent.

Return Value: It returns a string that represents the column-rule-width property of the element. 

Example 1: This example describes the length property value. 

html
<!DOCTYPE html> <html>      <head>     <title>         HTML | DOM Style columnRuleWidth Property     </title>     <style>         #GFG {                          /* For old Chrome and Safari browsers */             -webkit-column-count:4;             -webkit-column-rule: 1px green solid;                          /* For Firefox browser */             -moz-column-count:4;             -moz-column-rule: 1px green solid;                          -webkit-column-count:4;             -webkit-column-rule: 1px green solid;             text-align:justify;         }     </style> </head>  <body>     <div id = "GFG">         Prepare for the Recruitment drive of product          based companies like Microsoft, Amazon, Adobe          etc with a free online placement preparation          course. The course focuses on various MCQ's           & Coding question likely to be asked in the           interviews & make your upcoming placement          season efficient and successful.      </div>      <p>         Click on the button to change the         column-rule width     </p>      <button onclick = "myGeeks()">         Click Here!     </button>      <script>         function myGeeks() {             document.getElementById("GFG").style.columnRuleWidth                     = "10px";         }     </script> </body>  </html>                                 

Output: 

Before Click on the button: 

After Click on the button: 

Example 2: This example describes medium property value. 

html
<!DOCTYPE html> <html>      <head>     <title>         HTML | DOM Style columnRuleWidth Property     </title>     <style>         #GFG {                          /* For old Chrome and Safari browsers */             -webkit-column-count:4;             -webkit-column-rule: 1px green solid;                          /* For Firefox browser */             -moz-column-count:4;             -moz-column-rule: 1px green solid;                          -webkit-column-count:4;             -webkit-column-rule: 1px green solid;             text-align:justify;         }     </style> </head>  <body>     <div id = "GFG">         Prepare for the Recruitment drive of product          based companies like Microsoft, Amazon, Adobe          etc with a free online placement preparation          course. The course focuses on various MCQ's           & Coding question likely to be asked in the           interviews & make your upcoming placement          season efficient and successful.      </div>      <p>         Click on the button to change the         column-rule width     </p>      <button onclick = "myGeeks()">         Click Here!     </button>      <script>         function myGeeks() {             document.getElementById("GFG").style.columnRuleWidth                     = "medium";         }     </script> </body>  </html>                     

Output: 

Before Click on the button: 

After Click on the button: 

Supported Browsers: The browser supported by DOM Style columnRuleStyle property are listed below:

  • Google Chrome 50 and above
  • Edge 12 and above
  • Firefox 52 and above
  • Internet Explorer 10 and above
  • Opera 11.1 and above
  • Apple Safari 9 and above

E

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

Similar Reads

    HTML | DOM Input Reset Object
    The Input Reset Object in HTML DOM is used to represent the HTML <input> element with type="reset". This tag is used to access or create the <input> element. This element can be accessed by using getElementById() method. Syntax: document.getElementById("Input_ID"); This Input_ID is assig
    2 min read
    HTML | DOM Style outline Property
    The Style outline property in HTML DOM is used to set or return all outline properties in one declaration. This property draws a line around an element. It sets or returns the one or more border property in short form. The outline can be set the following properties: outline-widthoutline-styleoutlin
    2 min read
    HTML | DOM Textarea Object
    The Textarea Object in HTML DOM is used to represent the HTML <textarea> Element. The textarea element can be accessed by using getElementById() method.Syntax: document.getElementById("ID"); Where ID is assigned to the <textarea> element.Property Values: autofocus: It is used to set or r
    3 min read
    HTML | DOM Style animationPlayState Property
    The HTML DOM Style animationPlayState Property is used to specify whether an animation is running or paused. Syntax : animation-play-state: running|paused|initial|inherit; Return Values: It returns a string that represents the animation-play-state property of an element Property Values: running: Thi
    3 min read
    HTML | DOM Map Object
    The Map Object in HTML DOM is used to create and access the <map> element. The Map Object create the portion of image clickable and accessible.Syntax: It is used to return Map object.var x = document.getElementById("myMap");It is used to create Map Object.var x = document.createElement("MAP");
    2 min read
    HTML | DOM Style backgroundImage Property
    The DOM Style backgroundImage Property is used to set or return the background image of an element. Syntax: To get the backgroundImage propertyobject.style.backgroundImageTo set the backgroundImage propertyobject.style.backgroundImage = "image | none | initial | inherit" Return Values: It returns a
    3 min read
    HTML | DOM TableRow Object
    The TableRow Object in HTML DOM is used to represent the HTML <tr> element. The <tr> element can be accessed by using getElementById() method. Syntax: document.getElementById("id"); The tr element can be created by using the document.createElement() method. Syntax: document.createElement
    3 min read
    HTML DOM Style order Property
    The HTML DOM Style order property specifies the order of a flexible element relative to the rest of the flexible elements inside the same container element.  SyntaxSet the order property.object.style.order = "number | initial | inherit"Return the order property.object.style.orderReturn ValuesIt retu
    1 min read
    HTML | DOM Embed Object
    The Embed Object in HTML DOM is used to represent the <embed> element. The <embed> element can be accessed by using getElementById() method. Note: This object is new in HTML 5. Property Values: height: It sets or returns the value of the height attribute. src: It sets or returns the valu
    2 min read
    HTML DOM Anchor Object
    The Anchor Object in HTML DOM is used to represent the <a> element. The anchor element can be accessed by using getElementById() method. Syntax: document.getElementById("ID"); Where ID is assigned to the anchor tag. Property Values: Property Description charset Set or return the character set.
    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