<SOLVED> href="file: syntax?

About programming and getting involved with Linux Mint development
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
72nCounting
Level 2
Level 2
Posts: 78
Joined: Fri Jan 25, 2019 10:20 am
Location: Pennsylvania, USA

<SOLVED> href="file: syntax?

Post by 72nCounting »

What is the syntax for href to refer to your own computer?
I just moved my diary from a Windows 10 machine to a machine on which I just installed Linux Mint, (Vanessa, Cinnamon 22). On the Windows machine, this worked:

Code: Select all

<link rel="stylesheet" href="file://///della/Users/barry/barrys-files/businesses/pannebaker-com/website/root/public_html/styles/box-layout.css" type="text/css">
On my Mint machine, I tried:

Code: Select all

<link rel="stylesheet" href="file:///home/barry/barrys-files/businesses/pannebaker-com/website/root/public_html/styles/box-layout.css" type="text/css">
But, the diary's not formatted when Firefox displays it.

Note: I have a folder in my path named "root". That's not an attempt to access the root there; it just tells me that everything beyond that is what's on the web server. My diary's only on my computer; and I use my local copy of the same styles I use for my website.

Also, I won't be responding to you tonight. (I have a doctor appointment in the morning, and have to get to bed.) But, suggestions are appreciated.
Last edited by LockBot on Fri Feb 17, 2023 11:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29459
Joined: Wed Jul 06, 2011 3:58 am

Re: href="file: syntax?

Post by xenopeek »

I think it should work like that, don't know. You could open the browser console (Ctrl+Shift+J) to see if it gives any error about the stylesheet link that may provide a clue.

I'd use a relative path. Say you have a directory structure like this:

Code: Select all

public_html/
├── styles/
│   └── box-layout.css
└── content/
    └── subcontent/
        └── index.html
In the index.html file you'd have the link as:

Code: Select all

<link rel="stylesheet" href="../../styles/box-layout.css" type="text/css">
Bonus that this works also for the online website, without need to change the URI.
Image
User avatar
TheyLive
Level 4
Level 4
Posts: 290
Joined: Wed Jun 03, 2020 1:47 pm
Location: Russia

Re: href="file: syntax?

Post by TheyLive »

Open Firefox
Menu > File > Open File > Select your CSS
Copy path from address bar

That is all. This works for me.
>>>>> Goodly Mint <<<<< Only browser addon for this forum
User avatar
72nCounting
Level 2
Level 2
Posts: 78
Joined: Fri Jan 25, 2019 10:20 am
Location: Pennsylvania, USA

Re: href="file: syntax?

Post by 72nCounting »

xenopeek wrote: Thu Aug 18, 2022 4:51 am I think it should work like that
It does. In Text Editor, I was editing the copy of my diary I wanted to edit, but in Firefox, I was displaying a backup copy. So, of course it didn't change.

I do appreciate both of you responding to me.
Locked

Return to “Programming & Development”