×

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

Related Topics

CSS Important

CSS Important: CSS !important property is used to provide more importance, as compared to other CSS properties. The meaning of this property is “This is important.” This property enables CSS...

2 minutes read.

CSS Box-shadow

CSS Box-shadow This property is referred to include effects as shadow-like around an element’s frame. Syntax box-shadow: h-offset v-offset blur spread color |inset|inherit|none; Property values Following are the various property values which can be used...

3 minutes read.

CSS Filter

CSS Filter CSS filter is used to apply visual effects on the images, text, and other factors of the webpage. This filter property in CSS allows us to admit the effects like...

7 minutes read.

CSS Dropdowns

Dropdowns are one of the maximum crucial parts of an interactive internet site. CSS is a kind used to design the drop-down menus. A drop-down essentially is a group of...

5 minutes read.

CSS @keyframes rule

CSS @keyframes rule It describes the rule of animation that depicts the properties of CSS for the components at every state along with the timeline. We may make the properties of complex...

4 minutes read.

What is CSS used for

What is CSS used for? CSS stands for Cascading Style Sheet. CSS is a stylesheet language for web pages. It specifies how a document created in a markup language looks and...

4 minutes read.

How to resize an image in CSS

How to resize an image in CSS? The resize image attribute is used in responsive web design to resize images to fit within the div container automatically. The resize image attribute...

3 minutes read.

CSS Hover

CSS Hover: CSS :hover is used to select the various elements whenever we point the mouse on these elements. We can also use this selector on all the HTML elements,...

3 minutes read.

CSS Position

CSS Position: The position property in CSS is applied to set the position of the elements. It can be used to position the backside of an element. It is also...

3 minutes read.

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...

3 minutes read.

CSS Font

CSS Font: CSS has font property, which makes the text more attractive. We can alter the entire look by changing font color, font size, font style, and much more. In...

5 minutes read.

CSS Form

You can create attractive HTML form by using CSS. Style input Fields The Input Field width properties are used to determine the width of the input field. Let us see an example of CSS style...

2 minutes read.

CSS Pseudo-class

Pseudo-class The pseudo-class may be depicted as the keyword which can be mixed to any selector that specifies the elected element’s unique state. It can be included to a selector to...

6 minutes read.

CSS Text Effects

Text Effects in CSS We can use distinct text effects used inside the HTML document. Few attributes can be applied to insert the text effects. We can also style various web documents...

5 minutes read.

How to get rid/remove of bullet pioints in CSS

We include a list of items on the web pages that were sometimes numbered and sometimes bulleted in various styles. In HTML, there are two kinds of lists: ordered and unordered...

3 minutes read.

CSS Functions

CSS functions are used for different CSS properties. Every front-end developer should have knowledge of all CSS functions. It makes the coding easier. FunctionsExplanationattr().It returns the value of an attribute of...

5 minutes read.

CSS Browser Support

The desk underneath lists of all CSS properties and the way each belongs to it is supported in the generally unique browsers: - The quantity to the right of the browser...

2 minutes read.

CSS :root selector

CSS :root selector This CSS pseudo-class matches any document’s root element. It chooses the parent of the highest-level inside the document DOM or tree. An element of <html> is always a...

2 minutes read.

CSS Background

CSS Background The properties of CSS background are applied to describe the effects of background on the element. Here are five properties of background that affects various elements of HTML: Background-colorBackground-imageBackground-repeatBackground-attachment Background-position Background-color The color of the background...

7 minutes read.

CSS Ellipsis

The CSS ellipsis kind of is the value that mostly is used by the property: text-overflow. Here, we will discuss the following: What is CSS Ellipsis? Syntax for CSS ellipsis How to...

3 minutes read.