Title: &#039;before&#039; argument
Last modified: August 30, 2016

---

# 'before' argument

 *  [Ramanan](https://wordpress.org/support/users/superpoincare/)
 * (@superpoincare)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/before-argument/)
 * Hi Jan,
 * loadCSS recommends a before argument so that one doesn’t need to worry about 
   cascade effects because of inlining. I think it also helps in faster painting
   as not using it will make the browser repaint somethings because of some styles
   being invalidated.
 * Optional Arguments
 * before: By default, your stylesheet will be inserted before the first script 
   tag in the DOM (which may be the one shown above). This is risky because users’
   browser extensions can place scripts in the head of your page and unintentionally
   change the insertion point for the CSS, which can mess up your intended CSS cascade.
   If possible we recommend, using the optional before argument to specify a particular
   element to use as an insertion point. The stylesheet will be inserted before 
   the element you specify. For example, here’s how that can be done by simply applying
   an id attribute to your script.
 * <head>
    … <script id=”loadcss”> // include loadCSS here… function loadCSS( href,
   before, media ){ … } // load a file loadCSS( “path/to/mystylesheet.css”, document.
   getElementById(“loadcss”) ); </script> <noscript><link href=”path/to/mystylesheet.
   css” rel=”stylesheet”></noscript> … </head>
 * [https://github.com/filamentgroup/loadCSS](https://github.com/filamentgroup/loadCSS)
 * Maybe you can have a script id and a before argument in your later versions.
 * [https://wordpress.org/plugins/above-the-fold-optimization/](https://wordpress.org/plugins/above-the-fold-optimization/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [optimalisatie](https://wordpress.org/support/users/optimalisatie/)
 * (@optimalisatie)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/before-argument/#post-6472934)
 * Hi superpoincare!
 * My appologies for the late reply. My laptop got stolen so I lost a lot of time…
 * I have added the feature in the next update. The load pattern is as following:
 * — Above the fold CSS
    — LoadCSS script code with ID _atfcss_ — LoadCSS scripts
   with target _atfcss_
 * _[ [Signature moderated](http://codex.wordpress.org/Forum_Welcome#Signatures)]_

Viewing 1 replies (of 1 total)

The topic ‘'before' argument’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/above-the-fold-optimization_fcfbf6.
   svg)
 * [Page Speed Optimization](https://wordpress.org/plugins/above-the-fold-optimization/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/above-the-fold-optimization/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/above-the-fold-optimization/)
 * [Active Topics](https://wordpress.org/support/plugin/above-the-fold-optimization/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/above-the-fold-optimization/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/above-the-fold-optimization/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [optimalisatie](https://wordpress.org/support/users/optimalisatie/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/before-argument/#post-6472934)
 * Status: not resolved