Is there any way for CSS to override style in HTML? [duplicate]

0

I have an archiver containing about 82k HTML files, where there is a need to apply a CSS with structuring and visual standardization.

However, I noticed that many of these files are styled via html using the style parameter.

Is there any way to override the settings defined in style via CSS?

<html>
<head>
<style>
   body{margin:2em;}
   h1{text-align:center; font-weight: bold; color:#000;}
   p{text-align:justify; color:#000; font-size:10pt; text-indent:1em;}

</style>
</head>
<body>
<h1 align="justify" style="color: yellow; text-indent: 30; text-align:right;"> teste </h1>

<p style="text-indent: 40px; margin-top: 10px" align="center">
<font face="Arial" style="font-size: 9pt; font-weight:700; color:red;">Texto</font>
</p>
<p style="text-indent: 32pt; margin-top: 7pt" align="justify">
<font face="Arial" style="font-size: 9pt; font-weight:700; color:green;">Texto</font>
</p>
</body>
</html>
    
asked by anonymous 27.04.2018 / 23:38

1 answer

-2

You can use !important

h1 {
  color: green !important;
}
<h1 style='color: red;'> TESTE </h1>

Or remove the style attribute via JavaScript

document.getElementsByTagName('h1')[0].removeAttribute('style');
<h1 style='color: red !important;'> TESTE </h1>
    
27.04.2018 / 23:44