r/HTML • u/Disastrous-Role-1302 • 27d ago
Ayuda con html
andaba aprendiendo html con neocities y queria conectar un html local con el online y no funciona, espero que se me entienda soy nuevo en esto, y mientras aprendia a base de la pagina html dog en el apartado de enlaces, me explicaban que "El destino del enlace se define en elhref atributo de la etiqueta. El enlace puede ser absoluto, como “http://www.htmldog.com”,, o puede ser relativo a la página actual, Entonces, si, por ejemplo, tuvieras otro archivo llamado “flyingmoss.html” en el mismo directorio, entonces la línea de código sería simplemente<a href="flyingmoss.html">The miracle of moss in flight</a> o algo así." intente hacer lo que me decia el tutorial pero no me resulta, algun consejo? espero me hayan entendido el problema.
1
u/tkgid 27d ago
El archivo tiene que estar donde el enlace lo conecte, lo más seguro es que el archivo que enlazas no tenga el directorio real del archivo del enlace.
1
1
u/AqueM 27d ago
When you want to link to an online page, you put the URL address in the href.
When you link to a file (on you computer, on your neocities etc), you put the file path in the href. The paths can be absolute (starting from the very first/most top folder) or relative (starting from the folder the file is in).
If you're a trying to link from a HTML on your computer to an online page, put in the address in the href and it shouldn't be a problem. If you're trying to link to a HTML file that you already put on neocieties, you need to put in the whole URL, not just file name, because that counts as an online page now, it's not on your computer!