Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write very small text in HTML

Tags:

html

css

fonts

I would like to have a font smaller than an Arial 9px text.

I've tried to find other font name but I did not succeed to get a very small text. Is there a way to achieve this easily using css ?

EDIT : I can't go under 9px using Arial I have tried font-size, small, transform, scale, other fonts... everything as I am an experienced web developper.

like image 385
andrea06590 Avatar asked May 27 '19 08:05

andrea06590


People also ask

How do you make text super small in HTML?

The HTML <small> element is found within the <body> tag. The <small> tag is used to make the text one size smaller (ie: from x-large to large, large to medium, medium to small). The <small> tag can not make the text smaller than the browser's minimum font size.

How do you make small letters in HTML?

The <small> tag defines smaller text (like copyright and other side-comments).

What is the smallest text size in HTML?

browsers have a minimum font size, to avoid underhanded people displaying unreadable text for some reason. Some browsers let you adjust this, but you simply can't count on being able to display smaller than 9pt on anyone else's machine. Unless you opt for very old school: create your text as a graphic.

What is small element in HTML?

The <small> HTML element represents side-comments and small print, like copyright and legal text, independent of its styled presentation. By default, it renders text within it one font-size smaller, such as from small to x-small .


1 Answers

Set font-size to whatever you want - although you may find that any font less than 9px may be too small to read well. You could also do it with em's or rem's or percentages.

But you can set the font size as follows (for an example p element that you want to be 6px in size).

 p {font-size: 6px}

So note that you are not importing the smallest possible font - you are sizing the html elements to be a small font-size with CSS). Using this principle- you set the fontsize for all the elements you want to use it - eg: p, span, a, li, h etc.

But again - I must caution against this for accessibility purposes.

p {
 font-family: Arial;
 font-size: 6px;
}
<p>This is a test with Arial font at 6px and is NOT recommended</p>
like image 190
gavgrif Avatar answered Oct 06 '22 01:10

gavgrif