HTML merge/overide rules-ThrowExceptions

Exception or error:

I am writing an app in which I generate HTML. However some of my HTML comes from an underlying app I cannot control (Flask-Bootstrap). Consequently I find myself wanting to modify some of the HTML that is handed to my app.

Specifically I need to know how HTML combines attributes. Here are two examples.

With metas, is

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="shrink-to-fit=no">

the same as

<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

With classes, is

<div class="abc" class="efg hij">

the same as

<div class="abc efg hij">


How to solve:

In the case of class:

<div class="abc" class="efg hij">

Here only first class abc will be applied to the element and rest all will be discarded. It is different from :

<div class="abc efg hij">

which would apply all abc, efg and hij classes on the element.

  • For meta tag, Both of them means the same.

Leave a Reply

Your email address will not be published. Required fields are marked *