Posted On May 7, 2019

CSS: Units of Measurement

kimconnect 0 comments
blog.KimConnect.com >> Codes >> CSS: Units of Measurement
Common Values of Measurement

px :pixel
in :inches
mm :millimeters
em :relative to nearest parent element’s set value (font-size, div, etc)
rem :Root EM, only relative to the root (html) set values
!important :over-ride parent’s presets and enforce preceding values

Example CSS for Illustration
<style>
.sometext {
margin-bottom: -50px;
text-align: center;
font-size: 2in!important;
}

.box {
border-style: dotted;
border-color: red;
border-width: 5px;
text-align: center;
}

.parent-box {
background-color: yellow;
}

.box1 {
background-color: grey;
margin: 20px 10px 20px 10px;
padding: 1.5em
}

.box2 {
background-color: white;
margin: 20px 10px 20px 10px;
padding: 1.5rem
}
</style>
<h5 class="sometext">Some Text</h5>

<div class="box parent-box">
<h5 class="box box1">padding</h5>
<h5 class="box box2">padding</h5>
</div>
Output

Some Text
padding
padding
padding

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Sendmail Batch File

1. Download: 2. Place it in C:\Windows\System32   sendmail.bat --------------------------- senditquiet.exe -s smtp.gmail.com -port 587…

WordPress: Gold Price Widget CSS

Here's a sample of CSS Code to customize the display of the WordPress' Gold Pricing…

PowerShell: Compare Time Stamps of Items in Mirroring Directories

# compareTimeStamps.ps1# Set variables$source="T:\DIRECTORY1"$destination="\\FILESHERVER\DIRECTORY1"$sampleSize=100$logFile="\\FILESHERVER\SHERVER1\sampleTimeStampLog.txt"function sampleTimeStamp{ param( [string]$sourceDirectory=$source, [string]$destinationDirectory=$destination, [int]$sampleCount=$sampleSize, [string]$timeStampLog=$logFile ) $timeStampTimer=[System.Diagnostics.Stopwatch]::StartNew() # Enable Remote…