/    Sign up×
Community /Pin to ProfileBookmark

Question of Internal Style Sheets

I’ve always been told to avoid using internal style sheets, but what if they contain code that is used [I]for that page only[/I]?

I have a few such pages that contain inline stylesheets; in particular, two that have stylesheets generated via PHP (specifically, [url]http://mrinitialman.com/TestSite/furcadia.php?section=Active[/url] and [url]http://mrinitialman.com/TestSite/furcadia.php?section=Inactive[/url] , where the CSS takes care of the portraits displayed).

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@jedaisoulFeb 18.2017 — The main advantage of external style sheets is that they can be cached by the browser. However, there are disadvantages as each file has to be separately loaded, at least the first time. Perhaps the optimum arrangement in many cases is:

  • - A single monolithic external style sheet containing the style code that is common to the site.


  • - Page-specific style code to be internal to the relevant page, so it is only loaded when needed by that page, and is cached with the page.


  • That said, there could be some style code that is common to some pages but not others, etc... So we need to be guided by the objective, which is to minimize the load time, particularly the initial load.
    Copy linkTweet thisAlerts:
    @direct_destinatFeb 20.2017 — In some cases, there is recommended to inline not very large CSS code in <head> - if it's the above-the-fold content. But always avoid to inline CSS attributes in HTML code
    ×

    Success!

    Help @Mr_Initial_Man spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.4,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...