Can you set or where is the local root of the document?

When opening a file from your hard drive to your browser, where is the document root? To illustrate, given the following HTML code, if the page is open from a local computer (file:///), then where should the cssbrowser file look like ?

<link href="/temp/test.css" rel="stylesheet" type="text/css" />
+3
source share
6 answers

It depends on which browser you use, but Internet Explorer, for example, will take you to the root directory of your hard drive (for example C:/), while browsers such as Firefox do nothing.

+1
source

, , , , :

<base href="my-root">
+6

Mac - , , . , CSS, .

, :

<link href="file:///temp/test.css" rel="stylesheet" type="text/css" />
+1

Eric, - , , .

0

html, , html, . , css, , .

css - . URL-, - - :

file:///blah/test.css
html:
<link href="file:///blah/test.css" rel="stylesheet" type="text/css">

, url html , .

.

0

, , - , (, Apache IIS), - (htdocs Apache, IIS). , , , (, local.mrwarshaw.com, - ).

If you work on Windows and don’t want to interfere with the server setup yourself, you can get a package like XAMPP or WAMPP, although keep in mind that they carry additional weight of PHP and MySQL with them. However, if you have space, this is a fairly simple development environment for your machine.

0
source

Source: https://habr.com/ru/post/1696471/


All Articles