Announcement

Collapse
No announcement yet.

CSS loading order

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    CSS loading order

    Does anyone know how to set the load order of css in miva 9?

    #2
    The order is determined by the order your CSS is called in via your global head tag. If you are using a ReadyTheme this order can be changed in the /themes/levels/css/all.php file (or css.php)
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Just for my own curiosity, why is the load order important? Is there some kind of conflict or side effect that can occur?

      Thanks --
      Kent Multer
      Magic Metal Productions
      http://TheMagicM.com
      * Web developer/designer
      * E-commerce and Miva
      * Author, The Official Miva Web Scripting Book -- available on-line:
      http://www.amazon.com/exec/obidos/IS...icmetalproducA

      Comment


        #4
        The last CSS rule will override any previous rule.

        Code:
        .someclass {color:black;}
        .someclass {color: red;}
        
        <p class="someclass"> text </p>
        someclass will display as color red.

        Any inline stlye will override an imported style sheet.

        Code:
        <p class="someclass" style="color:blue;"> text </p>
        will display as blue

        Any !important will override all.

        Code:
        <p class="someclass" style="color:purple !important" style="color:blue"> text </p>
        will display as purple

        http://www.alphabetsigns.com/

        Comment


          #5
          Alphabet, if you use the Style Resources tab under User Interface there is no way I have found to order that list of CSS files.

          The best way to add styles to your head tag is to hard code them in the HEAD Tag Content box.
          Calvin Nelson
          Director of Web Development
          2C Development Group

          Comment


            #6
            And just to be clear:

            IF YOU HAVE

            .colorMe { color:red }

            in myStyle.css

            and

            .colorMe { color:blue }

            in otherStyles.css

            and you call them in this order:

            myStyle.css
            otherStyles.css

            then

            <p class="colorMe">Hi!</p>

            is blue

            while,

            otherStyles.css
            myStyle.css

            is red.


            This is why the best way to managed style changes is to load your OWN stylesheet last, and copy any styles you need to modify in the built in styles sheets into your own stylesheet and make the changes there. So, when built in styles are changed, you just copy over the updated styles sheets. And unless you are doing something really different like change the structure of those styles (which you actually shouldn't), then you are done updating.
            Bruce Golub
            Phosphor Media - "Your Success is our Business"

            Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
            phosphormedia.com

            Comment

            Working...
            X