Class In


public class In extends Units
CSS in (inch) unit value.

The in unit is an absolute-length unit equal to one inch. In CSS, 1in equals 96px or 2.54cm. Inches are primarily useful for print stylesheets where physical measurements corresponding to real-world dimensions are important.

Usage:


 Units size = new In(2);
 element.setWidth(new In(8.5f));  // US Letter width
 element.setMargin(new In(1));
 
Since:
2016
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • In

      public In(float value)
      Constructs an In unit with the specified value.
      Parameters:
      value - the inch value
  • Method Details

    • sizeToString

      public String sizeToString()
      Returns the CSS string representation of this inch value.
      Specified by:
      sizeToString in class Units
      Returns:
      the CSS value string (e.g., "2in")