🥒
Dill's Knowledge Base
  • Hello World
  • 💻SQL
    • ❌Error Handling
    • 🧀Parameter Sniffing
      • Indexes
      • Query Hints
      • RECOMPILE
      • Branching
      • Memory Grants
      • Summary
      • Bonus
    • SQL Server Buffer Pool
  • 🖱️MongoDB
    • Instructor Led Training
      • DF100
      • DF200
      • DF300
      • DF400
    • MongoDB DBA University
      • DBA Admin Tools
      • DBA Basics
      • Metrics & Monitoring
  • 💻Web Design
    • Oxygen Tips
    • Bricks Builder
      • Tips
      • Discovery Call
      • Utility vs Custom Classes
      • Math Functions
      • Static vs Relative Units
  • Azure
    • AZ-900
      • Benefit of Cloud Computing
      • CapEx, OpEx and Consumption-based
      • Differences Between Cloud Service Categories
      • Identify The Right Service Type
      • Differences Between Types of Cloud Computing
      • Reliability and Predictability
      • Regions and Region Pairs
      • Availability Zones
      • Resource Groups
      • Subscriptions
      • Management Groups
      • Azure Resource Manager
      • Azure ARC
      • Resources Required for VM
      • Benefits and Usage of Core Compute Resources
      • Benefits and Usage of Core Network Resources
      • Public/Private Endpoints
      • Benefits and Usage of Storage Accounts
      • Benefits and Usage of Database Resources
      • Data Movement and Migration Options
      • Benefits and Usage of IoT Services
      • Benefits and Usage of Big Data and Analytics Services
      • Benefits and Usage of AI Services
      • Benefits and Usage of Serverless Technologies
      • Benefits and Usage of DevOps Technologies
      • Functionality of Azure Management Solutions
      • Functionality and Usage of Azure Advisor
      • Functionality and Usage of ARM Templates
      • Functionality and Usage of Azure Monitor
      • Functionality and Usage of Azure Service Health
      • Functionality of Microsoft Defender for Cloud
      • Functionality and Usage of Key Vault
      • Functionality and Usage of Microsoft Sentinel
      • Azure Dedicated Host
      • Defense in Depth
      • Describe the Concept of Zero Trust
      • Functionality and Usage of NSGs
      • Functionality and Usage of Azure Firewall
      • Functionality and Usage of Azure DDoS Protection
      • Explain Authentication and Authorization
      • Functionality and Usage of Azure AD
      • Microsoft Entra Overview
      • Functionality of Conditional Access, MFA and SSO
      • Functionality and Usage of RBAC
      • Functionality and Usage of Resource Locks
      • Functionality and Usage of Tags
      • Functionality and Usage of Azure Policy
      • Governance Hierarchy Constructs
      • Azure Blueprints
      • Describe Microsoft Privacy Statement, OST and DPA
      • Purpose of Trust Center and Azure Compliance Documentation
      • Purpose of Azure Sovereign Regions
      • Factors That Affect Costs
      • Factors to Reduce Cost
      • Functionality and Usage of Azure Cost Management
      • Purpose of Service Level Agreements
    • DP-900
      • Study Cram
    • DP-300
      • Deploy IaaS Soluton with Azure SQL
  • 📦Kubernetes
    • Udemy: Kubernetes for Beginners
Powered by GitBook
On this page
  1. Web Design
  2. Bricks Builder

Static vs Relative Units

Source: https://www.youtube.com/watch?v=cwfxZRLqyus

Pixels

  • Static unit

  • Not accessible (no font scaling)

  • Should still be used for media queries

  • "pixel perfect" design is a thing of the past

  • Pixels can be used for media queries

REM

  • Relative to the root font size (most browsers default to 16 px)

    • 1rem = 16px at 100% root font size

    • 1rem = 10px at 62.5% root font size

    • Best use for fixed values (e.g. 3rem of padding will always be equal to 30 pixels at normal font scaling)

    • Need to consider font scaling for things like border, padding, etc

EM

  • Relative to the element's calculated font size

    • Think of it as a ratio (1.5rem = 1.5x the font size)

  • Best used in situations where things need to respond to changes in calculated font size (e.g. buttons)

  • Caution: EM units compound and are influenced by the font size of parent containers

    • This is why the REM unit was introduced -- EMs are often undesirable as a relative unit

  • Don't use EMs for font sizes - it's what nightmares are made of!

  • Ex. If you have a div that is 6rem pixels, then another container that has 2em.. that is 120 px.. and then another div with 1.5... you now end up with 180px

Percent

  • Relative to the dimensions of the parent element

    • Ex. If a div is 100px wide, and the content is 50%, then the content will be 50px

  • Be careful because as it scales down it can get very narrow

CH

  • relative to the width of the "0" character of the current font

  • Normal paragraph text should have a width of between 50 and 75 characters (ch)

  • It is not an exact science, but it is very useful for dealing with text

Viewport Units

  • Relative to the size of the viewport

    • ex. desktop, mobile, etc

  • vw

    • 60vw is similar to 60%, but instead of being relative to the parent it is 60% of the viewport

  • vh

  • vmin

    • Ex. 60% of the smaller side so on a laptop that has a smaller y axis (screen size) a button with 60vmin will shrink vertically with the smallest size

  • vmax

    • opposite of vmin

PreviousMath FunctionsNextAZ-900

Last updated 1 year ago

💻