I have implemented a basic layout using the default layout pattern in Grails.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><g:layoutTitle default="my website" /></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="${resource(dir: 'images', file: 'favicon.ico')}" type="image/x-icon" />
<link rel="stylesheet" href="${resource(dir: 'css', file: 'main.css')}" type="text/css" />
<g:layoutHead />
<r:layoutResources />
</head>
<body id="mainContainer">
<g:render template="/templates/headerTemplate"></g:render>
<g:render template="/templates/menuTemplate"></g:render>
<g:layoutBody />
<r:layoutResources />
</body>
</html>
From what I understand, the <g:layoutBody /> tag is responsible for rendering the body content. However, I am facing an issue where custom styling applied to the <body> tag is not reflecting in the rendered view. If I add a div inside the body and apply the same styling, it works fine.
<!DOCTYPE html>
<html>
<head>
<meta name="layout" content="mainLayout"/>
<title>Match List</title>
<script type="text/javascript" src="${resource(dir:'js',file:'matchDetailsJS.js')}"></script>
</head>
<body class="myclass"> </body>
</html>
My CSS file is being included as other elements are styled correctly. However, the custom styling for the body seems to be overlooked. Could there be any issue with my g:layout setup? I have tried referencing the documentation but couldn't find a solution yet. Please let me know if my query is unclear. Thank you!