I have the following SCSS code:
main{
width: 100%;
height: 840px;
/*background: red;*/
margin: 10px auto;
position: relative;
padding: 5px 0;
}
section{
width: 98%;
height: 600px;
margin: auto;
display: flex;
align-items: center;
overflow-x: auto;
}
....
and this HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Simple responsive test</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<main>
<div class="text">
<h1>Simple Test</h1>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Veniam non atque adipisci est, recusandae aperiam, ullam minima quos nostrum animi voluptas sequi. At repellendus fuga reiciendis accusantium, dolor suscipit repellat?
</p>
</div>
<section>
<div class="product">
<img src="image/banner2.png" alt="">
<p>
<b>Product One</b><br>
<small>New arrival</small>
</p>
<samp>$45.00</samp>
</div>
</section>
</main>
</body>
In regular HTML, the browser renders the layout correctly.
However, when using Angular, we encounter an error main is not recognized
. Is there any specific action needed in Angular to resolve this issue?
The error message is as follows:
error NG8001: 'main' is not a known element: 1. If 'main' is an Angular component, then verify that it is part of this module. 2. If 'main' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. <main> </main>