Magento2 创建页面添加Css Img Js

Magento2.4 创建新页面,如果css 、js文件只能在后台创建页面的时候定义的话,添加方法如下:

在样式1的写法 “<style><!– #q{ } –></style>”中,虽然可以这样写,运行代码效果也正常,但是在保存的时候,页面有提示信息:

css样式写法

上边的意思是:暂时允许保存包含受限元素的HTML值。允许的HTML标签有:div, a, p, span, em, strong, ul, li, ol, h5, h4, h3, h2, h1, table, tbody, tr, td, th, tfoot, img, hr, figure, button, i, u, br, b

如果没有什么讲究,可以暂时这样使用。

<style>
<!--
 * {
        padding: 0;
        margin: 0;
        text-decoration: none;
        list-style: none;
        color: rgba(61,61,61,1.0);
        font-size: 14px;
        border: 0;
    }
    .page-main {
        max-width: 100%;
        padding: 0;
    }
  #header{
    display:none;
   }
-->
</style>
<div class="a201214" style="background: url({{media url=wysiwyg/sale/211109-bodybg.jpeg"}}')fixed repeat center top rgba(216,212,209,1.0)">
<div class="headerbg-pc"><img class="headerbg-pc-img" src="{{media url="wysiwyg/sale/211117-headerbg.png"}}" alt=""></div>