Original source code of above element is looking like this:
<main>
<head>
some code...
</head>
<body>
<main>
some code...
</main>
</body>
<style>
some styling...
</style>
<script>
some script...
</script>
</main>

Note: HTML (mostly) auto-corrects this issue. Automated testing can verify the correct placement of style and script tags by ensuring they are within the head or body sections, or appropriately positioned elsewhere.