CSS | Length Data Type Last Updated : 13 Jul, 2022 Comments Improve Suggest changes Like Article Like Report Length is the measurement of distance followed by a length unit. There is no space between the number and unit. It can be positive or negative. The length unit is optional after 0. There are two types of length units which are absolute and relative. Lengths are used in many CSS properties, such as padding, border-width, font-size, text-shadow, width, height, and margins. Syntax: <length> It takes number followed by a unit of length as a parameter. Note: No space should be given between the number and its unit. Example 1: The following example demonstrates the use of length as value using CSS. html <!DOCTYPE html> <html> <head> <style> div { height: 200px; width: 150px; } </style> <title> CSS | Length Data Type </title> </head> <body> <h2> Set the height and width of an element </h2> <div> <img src= "https://media.geeksforgeeks.org/wp-content/cdn-uploads/20190710102234/download3.png" alt="GFG"> </div> </body> </html> Output: Example 2: The following example demonstrates the length as a value for margins of a div element. html <!DOCTYPE html> <html> <head> <style> div { border: 1px solid black; margin-top: 50px; margin-bottom: 50px; margin-right: 50px; margin-left: 80px; background-color: lightblue; } </style> </head> <body> <h2>CSS Value | Length</h2> <div> This div element has a top margin of 50px, a right margin of 50px, a bottom margin of 50px, and a left margin of 80px. </div> </body> </html> Output: Supported Browsers: Google Chrome 1 and aboveEdge 12 and aboveInternet Explorer 3 and aboveFirefox 1 and aboveOpera 3.5 and aboveSafari 1 and above Comment More infoAdvertise with us Next Article CSS | Length Data Type V vipinyadav15799 Follow Improve Article Tags : Web Technologies CSS CSS-Misc Similar Reads C++ Numeric Data Type There are mainly 3 types of Numeric Data Types in C++ int unsigned intshort intunsigned short int long intunsigned long intlong long intunsigned long long intfloat double long double1. Integer (int) An integer is a type of datatype that can store integer values. Integer acquires 4 bytes in memory an 4 min read PHP Data Types In PHP, data types define the kind of value a variable can hold. PHP is a loosely typed language, meaning you donât need to declare the data type of a variable. It is automatically assigned based on the value. But it is important to understand data types because it is important for writing reliable, 4 min read SAP ABAP | Data Types Before Understanding the Data type first understand the Data object. Data objects are variables that we declare in the program. It occupies some memory where you can store the data from external sources. Data can be of different types, so data types are responsible for defining the type of data of t 6 min read HTML DOM length Property The DOM length property in HTML is used to get the number of items in a NodeList object. A NodeList is a collection of child Nodes. For example, the NodeList of the body will contain all the child nodes in the body i.e. paragraphs, comments, headings, script, etc.Syntax: nodelist.lengthReturn Value: 2 min read Data Types in Programming In Programming, data type is an attribute associated with a piece of data that tells a computer system how to interpret its value. Understanding data types ensures that data is collected in the preferred format and that the value of each property is as expected. Data Types in Programming Table of Co 11 min read Like