

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Setting Tab Sizes in HTML with CSS tab-size Property
CSS tab-size property allows us to set the amount of whitespace used in tabs. The following examples illustrate CSS tab-size property.
Example
<!DOCTYPE html> <html> <head> <style> body { display: flex; flex-direction: column; } p { white-space: pre; } p:last-of-type { tab-size: 32; -moz-tab-size: 32; } </style> </head> <body> <p> Ut sed felis lobortis, fermentum magna vitae, imperdiet lectus.</p> <p> Ut sed felis lobortis, fermentum magna vitae, imperdiet lectus.</p> </body> </html>
Output
This will produce the following result −
Example
<!DOCTYPE html> <html> <head> <style> pre { margin: 2%; box-shadow: inset 0 0 12px lime; } p { background: lavender; tab-size: 1; -moz-tab-size: 1; } </style> </head> <body> <pre> 4 tabs of size 1 paragraph .|.|.|. <p> Ut sed felis lobortis, fermentum magna vitae, imperdiet lectus. </p> </pre> </body> </html>
Output
This will produce the following result −
- Related Questions & Answers
- CSS tab-size Property
- Fade in tab with Bootstrap
- Set the width of a tab character with CSS
- How to create tab headers with CSS and JavaScript?
- Setting Font Size with Em in CSS
- Setting Font Size with Pixels in CSS
- Setting Font Size with Keywords in CSS
- Setting Font Size with Pixels using CSS
- Setting Font Size with Em Using CSS
- Setting Font Size with Keywords Using CSS
- Replace Tab with space in SAP ABAP
- C Sharp with Selenium - How to Switch one tab to another tab in Csharp Selenium?
- How to create a vertical tab menu with CSS and JavaScript?
- Insert a tab after the first tab of a JTabbedPane container
- C Malloc 2D tab
Advertisements