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
  • CSS Tutorial
  • CSS Exercises
  • CSS Interview Questions
  • CSS Selectors
  • CSS Properties
  • CSS Functions
  • CSS Examples
  • CSS Cheat Sheet
  • CSS Templates
  • CSS Frameworks
  • Bootstrap
  • Tailwind
  • CSS Formatter
Open In App

CSS tab-size Property

Last Updated : 28 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The tab-size property in CSS is used to specify the width of the tab character. The tab-size usually displays a single space character in an HTML document. Some elements like <textarea> and <pre> elements display the tab-size.

Syntax: 

tab-size: number|length|initial|inherit;

Property Value: The value of tab-size property is listed below: 

  • number: It is used to set the number of space characters in a tab. Its default value is 8.
  • length: It is used to set the length character. But it is not supported by most of the browsers.
  • initial: This property is used to set its default value.
  • inherit: It is used to inherit the property from its parent.

Example: In this example, we are using the above-explained properties.

html
<!DOCTYPE html> <html> <head>     <title>tab-size Property</title>     <style>         /* CSS property for tab-size */         #geeks {              /* Used for Firefox support */             -moz-tab-size: 6;              /* Used for Opera 10.6-12.1 support */             -o-tab-size: 6;             tab-size: 6;         }          body {             text-align: center;         }          h1 {             color: green;         }     </style> </head>  <body style="text-align:center">      <h1 style="color:green">         GeeksforGeeks     </h1>      <h2>         The tab-size Property     </h2>      <!-- tab-size property used here -->     <pre id="Geeks1">          GeeksforGeeks: A computer science portal    </pre> </body> </html> 

Output: 

Supported Browsers: The browser supported by tab-size property are listed below: 

  • Google Chrome 21.0
  • Edge 79.0
  • Firefox 91.0 
  • Opera 15.0
  • Safari 7.0

R

R_Raj
Improve
Article Tags :
  • Web Technologies
  • CSS
  • Web technologies
  • CSS-Properties

Similar Reads

    CSS border-left-color Property
    The border-left-color Property is used to set the color of the left-border in an Element. It is mandatory to declare the border-style or the border-left-style property before the border-left-color property. Syntax:border-left-color: color|transparent|initial|inherit; Property Valuescolor: It sets th
    3 min read
    CSS padding-bottom Property
    An element's padding is the space between its content and its border. The padding-bottom CSS property is used to set the height of the padding area on the bottom of an element. Syntax:padding-bottom: length|percentage;Property values:length: This value is used to specify the size of padding as a fix
    3 min read
    CSS margin-bottom Property
    The CSS margin-bottom property is used to specify the amount of margin to be used on the bottom of an element. The margin can be set in terms of length or percentage. Syntax:margin-bottom: <length> | <percentage> | autoProperty values:Length: This value specifies the length of the margin
    3 min read
    CSS border Property
    CSS border property are used to style the borders of elements. They include border-width, border-style, and border-color, allowing control over border thickness, style, and color respectively.CSS Border Property Syntax:border: border-width border-style border-color|initial|inherit;CSS border propert
    6 min read
    CSS padding-right Property
    Padding is the space between its content and its border. The padding-right property in CSS is used to set the width of the padding area on the right of an element.Syntax: padding-right: length | percentage | initial | inherit;Property values: length: This mode is used to specify the size of padding
    3 min read
    CSS padding-left Property
    Padding is the space between its content and its border. The padding-left property in CSS is used to set the width of the padding area on the left of an element. Syntax:padding-left: length|percentage|initial|inherit;Property values:length: This mode is used to specify the size of padding as a fixed
    3 min read
    CSS Styling Images
    CSS allows you to apply various styles to images, making them more responsive, visually appealing, and interactive. You can modify the appearance and behaviour of images on your webpage by using CSS properties like border-radius, box-shadow, filter, and others.Thumbnail ImagesThe border property hel
    2 min read
    CSS writing-mode Property
    The writing-mode CSS property is used to signify whether the lines of text are laid out horizontally or vertically and also the direction in which the block progress. Syntax:writing-mode: horizontal-tb|vertical-rl|vertical-lr;Default Value: Its default value is horizontal-tb.Property values:horizont
    3 min read
    CSS font-family Property
    The CSS font-family property specifies the font for an element. It can list multiple fonts as fallbacks. If the browser doesn't support the first font, it tries the next. It includes specific font names like "Arial" and generic families like "serif" or "sans-serif".Types of Font Familyfamily-name: S
    4 min read
    CSS z-index Property
    CSS z-index is used to control the stacking order of overlapping elements, which decides whether an element appears on top or behind others based on their assigned value.It works only on positioned elements (relative, absolute, or fixed).Default stacking order applies if no z-index is defined.The z-
    4 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