Closed blu28 closed 4 years ago
What is wrong with using header_include for this purpose?
I believe the problem is that header_include
is used only in pageheader.jspf
which is only included in <div id="header">
which is in <body>
so you cannot add there your own css settings which would override the default ones for the whole page.
It seems this used to be possible in the past (#2062).
Also, anyone feel free to submit pull request for this, the change itself should be simple by using getFileContent()
and mimicking what is already being done for header/body/footer includes.
I believe the problem is that
header_include
is used only inpageheader.jspf
which is only included in<div id="header">
which is in<body>
so you cannot add there your own css settings which would override the default ones for the whole page.
Yes it is included in the <div id="header">
, but you can always override the default styles included in the <head>
by defining new ones in the <div id="header">
. So placing the new styles in the header_include
should work although it is not the best-practise way to do it.
I'm not very skilled in css but here https://www.w3schools.com/html/html_css.asp they mention no use of css in <body>
. So I googled a bit, I came across this https://stackoverflow.com/questions/2830296/using-style-tags-in-the-body-with-other-html and this https://softwareengineering.stackexchange.com/questions/224422/will-it-be-a-wrong-idea-to-have-style-in-body where they mention that many browsers support it but it is not valid. They also mention scoped
attribute which does not seem to be supported. Therefore, I think it would be more proper to allow css in the <head>
.
Therefore, I think it would be more proper to allow css in the
<head>
.
Yes, it would.
Just as there are other include files, header_include, etc. there should be a way to include a block of text in the HEAD portion of the page to allow CSS in a compliant manner.