Question:
Can CSS styles be declared outside the “HEAD” element of an “HTML” page ?
While working within a CMS where access to the header tag is restricted, is there a method to include CSS rules within the <BODY>
of the document?
The objective is to...
.ClassName
{
border: 2px solid red;
margin: 5px;
padding: 5px;
}
One option is to embed the style rules "inline" within the element, but it is preferred to avoid this approach due to the possibility of reusing the CSS rules in multiple elements.
The preferable option is to avoid using...
<div style="border: 2px solid red; margin: 5px; padding: 5px">content</div>