Grow your CSS skills. Land your dream job.

How many media queries is too many?

  • # December 12, 2012 at 11:43 am

    Yeah, @djdaniel150 no offense but using `

    # December 12, 2012 at 12:34 pm

    > Actually it could be a maintainability nightmare either way. It depends on the structure of your site and what you are designing for. If your site consists of 500+ pages that is divided into 30 sections, all with different formatting, then external style sheets are nothing more than a headache. I have some pages that share the same formatting as others, but once you bring multimedia into the mix, a single page may no longer share the same formatting as other pages in its section. A “static” website where every page is the same should use external style sheets. Otherwise, who wants to edit 2 pages for every single one webpage? Some people cannot code all that fast, in this case they should use external style sheets. I can code a page out in seconds, practically with my eyes shut, I have no need for external anything. Also, alot of the time I just simply copy and paste a page to retain its formatting, then simply replace the content (this takes about 5 seconds of time), and the pages load fast because I’m not linking to a million style sheets.

    First you say you use different formatting on each page, then you say you copy and paste entire pages because the formatting is the same. I simply cannot see a need for a site that is so void of any consistency that you require separate styles for each page, especially one of 30 sections and 500+ pages. Are the header and footers on the sites the same or very similar? I find that the majority of my CSS is dedicated to just those two elements on every site I work with.

    > There’s site popping up everywhere that have literally hundreds of external style sheets, goofy.

    I’ve seen sites with too many stylesheets (15-20) but I have never seen any with close to 100 stylesheets. I’m sorry, but I need to see some live examples of sites that have so many different pages that they need their own styles/stylesheets.

    Also, wouldn’t each page having its own inline styles make each page lose most of the benefits of caching items like images and stylesheets and therefore erase any performance benefit of using inline styles on every page.

    # December 12, 2012 at 12:38 pm

    On a side note: Things like slideshows that consume a lot of JS and CSS but are generally only used on one page, I tend to give them their own stylesheet. I only include the stylesheet on the page that it is on via PHP. Thats the only time I have more than 2 stylesheets (normalize.css & the main stylesheet) and I don’t even do that unless the slider consumes a very large portion of my stylesheet.

    # December 12, 2012 at 3:46 pm

    @pmac when did I state that I had a website with 30 sections and 500 pages? I didn’t, that was an example of a situation that might cause problems if someone was using external style sheets, I think you need to re-read the post. Also, when did I say I used different formatting on every page? I guess you are putting words into my mouth.

    @thedoc When did I state “but you seem to be suggesting that we abandon external stylesheets in favour of keeping everything required in a single document.”

    I never stated not to use external style sheets. Again, you are also putting words into my mouth. Re-read the post! Actually I believe I stated that some people should use external style sheets, it depends on their situation.

    # December 12, 2012 at 3:48 pm

    Sounds to me like you guys are just trying to start a fight, yawn.

    # December 12, 2012 at 3:52 pm

    @djdaniel150 I’m not trying to start a fight, just making a point that you should have really good reasons to ever use `

    # December 12, 2012 at 3:57 pm

    > Actually I believe I stated that some people should use external style sheets, it depends on their situation.

    In what situation should a user *not* use external stylesheets? You are either trolling this forum hard or you are severely disconnected from the reality of web development.

    # December 12, 2012 at 4:00 pm

    I actually was not referring to you Gaber. I was referring to @pmac and @thedoc
    They are trying to start a fight, but I care nothing for it. It’s obvious they don’t think much before they act.

    As far as whether to use an external style sheet or internal style blocks, this is a matter of choice, and I never stated what people should or should not do. They can design however they like. I’ve been doing this for the last 6 years, and I’ve never seen 2 people who design the same way, so everyone has their style I guess.

    # December 12, 2012 at 4:03 pm

    There is a difference between personal preference and best practice. What you are suggesting is crazy.

    > If your site consists of 500+ pages that is divided into 30 sections, all with different formatting, then external style sheets are nothing more than a headache.

    How on earth can you have a site that has 500 pages and *not* have styles that apply across all of those pages. That is *exactly* the reason for external stylesheets.

    # December 12, 2012 at 4:23 pm

    @thedoc Again, you failed to comprehend what I stated.

    # December 12, 2012 at 4:53 pm

    >or you are severely disconnected from the reality of web development.

    Based on comments in this thread and others…I think we have an answer.

    :)

    # December 12, 2012 at 5:03 pm

    @TheDoc I’m 99% sure that @djdaniel150 is trolling. I base this on the content of his comments, and the markup of the site he linked to in his first comment. I fail to believe that that is the product of someone who has been doing web design for the past six years.

    # December 12, 2012 at 5:13 pm

    Simple fact’s,
    inline styling and style tags shouldn’t be chosen over external stylesheets, because
    a) it will cause massive specificity issues
    b) it will actually cause harm to your sites performance, your html response won’t be cached your css file will
    c) if your duplicating styling over several different pages your forcing browsers to basically download duplicate content that could have been just called from an already cached css file.

Viewing 13 posts - 16 through 28 (of 28 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".