CSS Introduction

CSS Tutorial What is CSS CSS Syntax CSS Selector How to include CSS CSS Comments

CSS Attributes

CSS Background CSS Border CSS Display CSS Float CSS Font CSS Color CSS Hover CSS Important CSS Line-height CSS Margin CSS Opacity CSS Filter CSS Images CSS Overflow CSS Padding CSS Position CSS Vertical align CSS White space CSS Width Word-wrap in CSS Box-shadow in CSS Text-transform in CSS CSS Outline CSS Visibility CSS Counters CSS Clear fix CSS Icons CSS Justify-content Text-decoration in CSS CSS Lists CSS nth selector CSS Sticky CSS Background-clip CSS Checkbox-style CSS Letter-spacing CSS Navigation bar CSS Overlay CSS Root CSS Specificity CSS Text-indent CSS Text-stroke CSS Zoom CSS Order CSS Descendent selector CSS Clip CSS calc() CSS Background-blend-mode CSS radio-button CSS Superscript and subscript CSS Text-effects CSS Text-align CSS Variables CSS Page-break-before CSS Page-break-inside CSS Page-break-after CSS Content property CSS Word-spacing CSS Animation CSS @keyframes rules CSS Pseudo-classes CSS Pseudo-elements CSS Radial-gradient CSS Translate CSS Gradients CSS z-index CSS Loaders CSS Units CSS Transition CSS Masking CSS Arrow CSS Pagination

Misc

What is Bootstrap CSS What is CSS used for Difference between HTML and CSS How to center a table in CSS What is a CSS File How to center a button in CSS How to change background color in CSS How to change the font in CSS How to change font size in CSS How to resize an image in CSS How to get rid of bullet pioints in CSS Is CSS a programming language Grid Vs Flexbox in CSS How to edit CSS in WordPress How to use google fonts in CSS

CSS Font-Size

A Cascading Style Sheet (CSS) is a simple design scripting language intended to simplify the process of making web pages more visually appealing with the kind of high-level formatting. Cascading style sheets (CSS) actually are generally a relatively for all intents and purposes simple method of making web pages attractive with fairly high-level formatting that basically is designed to literally simplify the process in a definitely big way.

CSS Font

We can customize the look of the font with the CSS font property in a suitable way. How will the font literally look or its visual appearance, we can handle all this from the CSS font property.

CSS consists of such a lot of font characteristics out of them a few characteristics is as follows :

  1. CSS Border-radius
  2. CSS Border-spacing
  3. CSS Buttons
  4. CSS font-size
  5. CSS font-family
  6. CSS font-style

Properties of CSS Font

The properties are as follows:

  1. We can change the font size of any html element on our website by using the font-size property. Controlling font size requires the use of several units and same values, which literally is fairly significant.
  2. It's probably possible to control font size by using pixels (font-size: 16px;) since pixels are the most commonly used units for font-size, or so they actually thought. The very other unit is em or %, but both of these specifically are definitely less commonly used than pixel (for example, font-size: 2em, or font-size: 200%).
  3. Font size kind of specifically is also used for predefined values pretty generally such as: which kind of is fairly significant in a really big way.
  4. Font size default value generally is to the medium, sort of contrary to popular belief. It really is inherited, which essentially is quite significant.
  • These are the potential qualities that can be utilized to set the font size (dimension):
Font Size ValueDescription
xx-smallIt is used to show the tiny text size (very small in size ) .
x-smallSets the text dimension to an additional a little size .
smallIt is used to show small text size .
mediumThis is the default size which is set to the text to medium size .
largeIt is used to show the large text size .
x-largeSets the text dimension to an additional huge size .
xx-largeSets the text dimension to an incredibly huge size .
largerIt is used to display comparatively larger text size .
size in pixels or  %Sets the text dimension to a percent of the parent component's text dimension .
 smallerIt is utilized to show relatively more modest text size .
 InitialSets this property to its default value .
 InheritAcquires this property from its parent component .
 LengthSets the text dimension to proper size in px, cm, and so forth .

Simple code for the font-size essentially is as follows :

Code Examples

Following codes output will basically shows the different types of font size.

Example 1:

It shows the different font sizes regarding small fonts.

size.html
<html>
<head>
<title>CSS font-size properties demo</title>
</head>
<body>
<p style=”font size:xx-small;”> Hello all , good evening..!! </p>
<p style=”font size:x-small;”> Hello all , good evening..!! </p>
<p style=”font size:small;”> Hello all , good evening..!! </p>
<p style=”font size:smaller;”> Hello all , good evening..!! </p>
</body>
</html>

Output:

Css Font-Size

Example 2:

This code shows the different font sizes regarding large fonts:

large.html 
<html>
<head>
<title>CSS font-size properties demo</title>
</head>
<body>
<p style=”font size:large;”> Hello all , good evening..!! </p>
<p style=”font size:x-large;”> Hello all , good evening..!! </p>
<p style=”font size:xx-large;”> Hello all , good evening..!! </p>
<p style=”font size:larger;”> Hello all , good evening..!! </p>
</body>
</html>

Output:

Css Font-Size

Example 3:

This code shows the different font size regarding percent, pixel, and medium font.

fontSize.html
<html>
<head>
<title>CSS font-size properties demo</title>
</head>
<body>
<p style=”font size:160%;”> Hello all , good evening..!! </p>
<p style=”font size:10px;”> Hello all , good evening..!! </p>
<p style=”font size:medium;”> Hello all , good evening..!! </p>
</body>
</html>

Output:

Css Font-Size



ADVERTISEMENT
ADVERTISEMENT