Can be placed element title for Google link fonts?


Please explain, what are you trying to achieve?


Hi there toplisek,

perhaps something like this…

<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">

<title>Untitled document</title>

<link id="google-font" href="" rel="stylesheet" media="screen">

(function( d ) {
   'use strict';
	d.title = d.querySelector('#google-font').href.split('?')[1];
	//change split('?') to split('='), if you just require the family name
}( document ));


I have seen websites which use title for a font and thought this is programming mistake. In your example it can be reduced browser request as a Javascript code can be compressed into one file.

Maybe I’m wrong. Fonts contribute to page speed.

I have seen websites which use title for a font
and thought this is programming mistake.

I fully realise that I am getting very old, but I’m
afraid that I do not understand one word of that. :wonky:

Hopefully one of our many members may come
to my assistance with a simple explanation. :wink:


I’m not sure I’ve understood you correctly, but it certainly sounds like a mistake to me.

<title></title> is a meta tag, which should be used for a unique page title. Most browsers will display that title in the title bar or tab. Any other use would be incorrect.


It does appear to be a mistake. Typically a Google font would be loaded in a stylesheet link, as in coothead’s example.

Loading any external resource can have an effect on page speed. The server will have to make an extra request to the Google server, then the client will have to download the data for the font.
Using default fonts, that reside on people’s computers is faster.

I see an option explained at the following URL:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.