As I've been reading, HREF
is meant to point to something external (outside the page) that the user requests, or that the page containing it needs to use it (in the case of style sheets).
That is, in the case of style sheets, when pointed to with HREF
the browser does not pause rendering or DOM loading to apply the style sheet if it is not used at some point.
While SRC
it pauses rendering to dump the contents of the called file.
On what I have said above, I ask you:
- If I have a function that gives a
append
of an HTML structure of a Newsletter for example, it would be more efficient to call the style sheet do you design this Newsletter byHREF
?
Since at the first moment of the user's entry in the site, there is no use of this sheet, which will only be used if the user requests it (click on a button / link to open the Newsletter ), so .. There would be no need to pause the rendering to dump the CSS which at first will not be used ..
Did you get confused ?! If I'm confusing something, tell me!
I saw this discussion here: link
And until then I did not know that stylesheets could be called with the HREF attribute, I've always used SRC and I never really knew the difference in application for both.