Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>CSS is <strong>'cascading'</strong>. Say you built some modularized code that's not always on the page. You'd like to change some of the default behaviors of your style without destroying any of the CSS up to that point. Well, you could inject it as the first stylesheet entry and it will serve as the base style for the rest of the stylesheets to add upon.</p> <p><strong>For Example:</strong></p> <p><code>* { padding: 0; margin: 0; }</code>. </p> <p>If you put that in the middle of your page, it would <strong>destroy</strong> any margin and padding that has 'cascaded' that was set for those properties on any element up to that point on you page; however, if you would have used <code>$this-&gt;headStyle()-&gt;prependStyle("* { padding: 0; margin: 0; }")</code>, it would have reset the margin and padding for all elements, but the rest of the style on the page would have had a chance to override those properties.</p> <p>More reasons:</p> <ul> <li>http:// framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.headstyle</li> <li><a href="http://www.engfers.com/2008/10/30/internet-explorer-doesnt-evaluate-any-more-than-31-style-elements/" rel="nofollow noreferrer">http://www.engfers.com/2008/10/30/internet-explorer-doesnt-evaluate-any-more-than-31-style-elements/</a> <strong>(big reason)</strong></li> </ul> <hr> <p>Why JavaScript?</p> <ul> <li>http:// framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.headscript</li> <li>It's just good practice for modularized design. Magento eCommerce uses this method heavily</li> </ul> <p>Inline JavaScript should use this: </p> <ul> <li>http:// framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.inlinescript.</li> </ul> <blockquote> <p>HeadScript's sibling helper, InlineScript, should be used when you wish to include scripts inline in the HTML body. Placing scripts at the end of your document is a good practice for speeding up delivery of your page, particularly when using 3rd party analytics scripts.</p> </blockquote> <p>Hope this helps. Sorry I had to fudge the URL's because I'm a 'new' user.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload