How to apply CSS to Magento CMS Page

本小妞迷上赌 提交于 2019-12-13 21:28:37

问题


I have followed every tutorial that came up in Google search to add a simple CSS styling to a Magento CMS page.

I simply want to add the following CSS

.list-checkmark{
    list-style-image: url("../images/Check-Mark-2.png");
    margin-left: 3em;
}

to my page http://demo.txsystems.com/index.php/integration-service This is a CMS page, and I have added the following

<reference name="head">
  <action method="addItem">
    <type>skin_css</type><script>MyCss.css</script>
  </action>
</reference>

To the layout update XML of this page in Magento admin.

I have added the file myCss.css to /var/www/html/skin/frontend/default/hellogamez/css

Please can someone help me to understand, what else I am missing, the said image is in the appropriate image folder.

And of course in the CMS page here is the UL list that I am trying to apply the formatting, I am in Magento 1.7

<ul class="list-checkmark">
<li>PCs (laptop, desktop, tablet)</li>
<li>Portable and Desktop Printing Systems</li>
<li>First Responder Devices</li>
<li>Vending Machines</li>
<li>Handhelds</li>
<li>Medical Devices and Testing Equipment</li>
<li>Multifunctional Printers</li>
<li>Industrial Control Systems</li>
<li>Storage and Locker Systems</li>
<li>Event Ticketing</li>
<li>Asset Tracking</li>
<li>Commercial Ovens</li>
</ul>

Thanks


回答1:


The idea is good, but looks like you may be pulling from the wrong spot.

<reference name="head">
  <action method="addItem">
    <type>skin_css</type><script>MyCss.css</script>
  </action>
</reference>

...will pull from the core code folders. Rather use:

<reference name="head">
<action method="addCss"><stylesheet>css/MyCss.css</stylesheet></action>
</reference>

...which will load from the location you described: skin/frontend/default/hellogamez/css/MyCss.css ...and inject into your pageload in the same cluster as the other css calls.

Then make sure your image is in the images folder on the same level as that css folder ie: skin/frontend/default/hellogamez/images/Check-Mark-2.png

Also note that if you use the local.xml method to have it load site wide, you can use this same code snippet.



来源:https://stackoverflow.com/questions/17050668/how-to-apply-css-to-magento-cms-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!