3 Replies Latest reply on Dec 19, 2012 12:48 PM by Jon Fritz II

    Question about the html5 display rule

    fourwhitesocks Level 1

      /*html5 display rule*/

       

      article, aside canvas, details, figcaption, figure, header, hgroup, menu, nav, section, summary {

           display:  block;

      }  

       

       

      I have an html5 site that has both and internal and external style sheet.  Does the above rule need to be in BOTH style sheets, or just the external one...?

        • 1. Re: Question about the html5 display rule
          Jon Fritz II Adobe Community Professional & MVP

          HTML5 or not, CSS rules don't typically need to be duplicated across multiple stylesheets, except when using Media Queries.

           

          Keep in mind that something written in an external stylesheet can be overwritten in another or by styles within the page though.

          • 2. Re: Question about the html5 display rule
            fourwhitesocks Level 1

            Ok, think I understand; but I'm specifically asking about that particular display rule for html5, should I put that in my internal style or my external style sheet? 

            • 3. Re: Question about the html5 display rule
              Jon Fritz II Adobe Community Professional & MVP

              I'm sorry, the point I was trying to make was it honestly doesn't matter "where" you put it (external or embedded), as long as it's there  and isn't being overwritten by css from another source.

               

              Which stylesheet do you use for the actual layout of the page?

               

              That's where I would put it. Whether you want it there is up to you, it could be in either, but it's not needed in both. Your code will be lighter if you put it in the external file, since you would use the same file on every page, seems a waste to have to paste it into every page in the head section.

               

              I usually put all of my css in one external file. Unless that file gets huge, then I will separate out layout from content style and have two external files.

               

              There is literally no reason I can find to have your css embeeded in the <head> section of a page.