Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include css stylesheet in electron app

Tags:

html

css

electron

I created a style.css file. To include it in a .html file I tried :

<link rel="stylesheet" href="https://github.com/karinakozarova/HealthCalc/blob/master/style.css">

and

<base href="/style.css">

and

<href="/style.css">

None of them seem to work. Any ideas how to add CSS to my app via external file will be appreciated.

like image 674
Karina Kozarova Avatar asked May 25 '17 18:05

Karina Kozarova


People also ask

Does electron use CSS?

ElectronJS is an Open Source Framework used for building Cross-Platform native desktop applications using web technologies such as HTML, CSS, and JavaScript which are capable of running on Windows, macOS, and Linux operating systems.


1 Answers

I think you may be missing a "type" attribute within that link. Try the markup below:

<link rel="stylesheet" type="text/css" href="https://github.com/karinakozarova/HealthCalc/blob/master/style.css">
like image 116
TCharb Avatar answered Sep 30 '22 17:09

TCharb