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

PowerShell: Perform DISM Restore Health on Remote Servers

# This script will use a Windows ISO image to Repair Remote Computers$isoPath="\\FILESHERVER007\F$\Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO"$remoteComputers="TESTKOMPUTER","TESTKOMPUTER2"function restoreServerHealth($iso){ #…

PowerShell: Detect Microsoft SQL Version and Installed Location

function getSqlInfo{ $results=@() $instances=(get-itemproperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server').InstalledInstances foreach ($i in $instances){ $p=(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance…

How To Use Command Line to Configure iDrac Settings

Step 1: Install RacADM $computerlist=@' SERVER1 SERVER2 '@ $computernames=@($computerlist -split "`n")|%{$_.Trim()} $fileURL="https://dl.dell.com/FOLDER08543783M/1/DellEMC-iDRACTools-Web-WINX64-10.3.0.0-4945.exe" $expectedExecutable='racadm.exe' $expectedInstallPath='C:\Program Files\Dell\SysMgt\iDRACTools\racadm'…