ari fattal
ari fattal

Reputation: 25

How can I change web page's font using Chrome dev console?

I'm am looking for the easiest way to view a web page in a different font. I managed to do this through Chrome dev tools, but my method was messy. Is there any line I can simply paste into the console to achieve this? The site does use jQuery.

Upvotes: 0

Views: 1778

Answers (1)

terrymorse
terrymorse

Reputation: 7086

This will change the font family for the body to Comic Sans:

    let newStyle = document.createElement('style');
    newStyle.innerHTML = 'body { font-family: "Comic Sans MS"}'
    document.head.appendChild(newStyle);

If other elements on the page (h1, etc.) have font family assigned to them, you will need to add those element names after "body" (body, h1, ...).

Upvotes: 1

Related Questions