Friday, June 25, 2021
There are often times when you see the measurement in CSS that looks something like this font-size: 2em; what does that actually mean? Well an em simply means its the multiplier of the font-size of the element. For instance 2em means that it will multiply the font-size of the element by 2x.
Let's say we have a div with a font-size of 15px, and there's a span tag with a font-size of 2em. The span font-size of the span would be 30px, because the span is part of the div element.
Let's say have the following styles:
div {
font-size: 15px;
}
span {
font-size: 2em;
}
And with the following HTML markup:
<div>The font-size of the div element. <span>The span font-size</span>.</div>
The output is the following:
As you can see the span font-size is twice as big as the font-size of the div element. Most people mistakenly think that em means the multiplier of the element size, but it is actually the size of the font of the element.
Here is the entire HTML markup:
Previous: CSS: inherit and initial Keywords
Let's say we have a div with a font-size of 15px, and there's a span tag with a font-size of 2em. The span font-size of the span would be 30px, because the span is part of the div element.
Let's say have the following styles:
div {
font-size: 15px;
}
span {
font-size: 2em;
}
And with the following HTML markup:
<div>The font-size of the div element. <span>The span font-size</span>.</div>
The output is the following:
As you can see the span font-size is twice as big as the font-size of the div element. Most people mistakenly think that em means the multiplier of the element size, but it is actually the size of the font of the element.
Here is the entire HTML markup:
<!DOCTYPE html> <html> <head> <style> div { font-size: 15px; } span { font-size: 2em; } </style> </head> <body> <div>The font-size of the div element. <span>The span font-size</span>.</div> </body> </html>
Previous: CSS: inherit and initial Keywords
Subscribe to:
Post Comments (Atom)
Search This Blog
Tags
Web Development
Linux
Javascript
DATA
CentOS
ASPNET
SQL Server
Cloud Computing
ASP.NET Core
ASP.NET MVC
SQL
Virtualization
AWS
Database
ADO.NET
AngularJS
C#
CSS
EC2
Iaas
System Administrator
Azure
Computer Programming
JQuery
Coding
ASP.NET MVC 5
Entity Framework Core
Web Design
Infrastructure
Networking
Visual Studio
Errors
T-SQL
Ubuntu
Stored Procedures
ACME Bank
Bootstrap
Computer Networking
Entity Framework
Load Balancer
MongoDB
NoSQL
Node.js
Oracle
VirtualBox
Container
Docker
Fedora
Java
Source Control
git
ExpressJS
MySQL
NuGet
Blogger
Blogging
Bower.js
Data Science
JSON
JavaEE
Web Api
DBMS
DevOps
HTML5
MVC
SPA
Storage
github
AJAX
Big Data
Design Pattern
Eclipse IDE
Elastic IP
GIMP
Graphics Design
Heroku
Linux Mint
Postman
R
SSL
Security
Visual Studio Code
ASP.NET MVC 4
CLI
Linux Commands
Powershell
Python
Server
Software Development
Subnets
Telerik
VPC
Windows Server 2016
angular-seed
font-awesome
log4net
servlets
tomcat
AWS CloudWatch
Active Directory
Angular
Blockchain
Collections
Compatibility
Cryptocurrency
DIgital Life
DNS
Downloads
Google Blogger
Google Chrome
Google Fonts
Hadoop
IAM
KnockoutJS
LINQ
Linux Performance
Logging
Mobile-First
Open Source
Prototype
R Programming
Responsive
Route 53
S3
SELinux
Software
Unix
View
Web Forms
WildFly
XML
cshtml
githu
Ace4sure is the website that deals in preparation material for the exam for many years. According to my exposure and research, this is the right platform where you can get exact 220-1001 Dumps Questions.
ReplyDeletesd
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteApartments for sale in Nallagandla Gated people group lofts in Nallagandla offer something other than a permanent spot for yourself as well as your loved ones. It ensures top quality administrations, protection, security and elite admittance to conveniences like clubhouse, pool, Vaastu agreeable, recreation center, utility stores and substantially more.
ReplyDelete