Which HTML5 tags are more appropriate to represent money amount


A variable is represented by the var element. This could be a real variable in a programming or mathematical expression, an identifier for a constant, a function parameter,

Depending on what you want to achieve, but it appears that your possibilities are −

  • Use microdata, such as a product's pricing, as an example.

  • If you want to emphasise the price without implying that it is more significant, use <b>.

  • If the price is crucial, such as the entire cost of an itemised receipt, use the <strong> style.

  • If you require an element to design the pricing differently, use <span> with a class.

If the user want to display financial information in the table,make sure they’re in a column headed for accessibility.

<th scope="col">Income</th>
     or
<th scope="col">Price</th>

Use of Definition list

The HTML element contains a list of terms and descriptions in pairs. This element is frequently used to display metadata or to construct a glossary (a list of key-value pairs)

<dl> 
   <dt>Income:</dt> 
   <dd>1.200,00 $</dd> 
</dl>

Use of data

A machine−readable version of the data element's contents is also represented in the value property.

The element serves to give both a machine−readable value for data processors and a human−readable value for rendering in a Web browser when paired with microformats or microdata.

<p>The Salary Is:
<data class="amount" value="18000.00">
$18000</data>.</p>

Updated on: 15-Dec-2022

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements