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: Windows Automated Disk Cleanup

##################################################################################     <#      This script is created to automate the cleanup activity. Doing so will benefit to reduce the size of disk.     This script will perform the following   1. Clear windows temp and user temp folder   2. Empty recycle bin   3. Disk Cleanup   4. Clear CBS cabinet log files   5. Clear downloaded patches   6. Clear downloaded driver   7. Clean download folder      Note:  …

PowerShell: Update CSV File Using Active Directory

# adAccountsCsvUpdate.ps1 $originalCsv='C:\Users\rambo\Desktop\kimconnectUsers.csv' $newCsv='C:\Users\rambo\Desktop\kimconnectUsers-processed.csv' $newEmailSuffix='@kimconnect.com' $newOu='OU=Test,DC=kimconnect,DC=com' function adAccountsCsvUpdate{ param( $originalCsv, $newCsv, $newEmailSuffix, $newOu ) function…

Tasks to Perform After Windows 10 Upgrade

Target for Windows upgrade cleanup: C:\$Windows.~BT\* C:\$Windows.~LS\* C:\$Windows.~WS\* C:\ESD\Download\* C:\ESD\Windows\* C:\$WINDOWS.~Q\* C:\$INPLACE.~TR\* C:\Windows.old\* C:\Windows\Panther Please…