{"id":357,"date":"2024-05-21T12:35:45","date_gmt":"2024-05-21T10:35:45","guid":{"rendered":"https:\/\/blog.sutilweb.eu\/?page_id=357"},"modified":"2024-05-21T12:35:45","modified_gmt":"2024-05-21T10:35:45","slug":"18-enlaces","status":"publish","type":"page","link":"https:\/\/sutilweb.eu\/index.php\/lenguajes\/html5\/html5-practico\/18-enlaces\/","title":{"rendered":"18. Enlaces"},"content":{"rendered":"\n<p>Los <strong>enlaces<\/strong> son aquellos <strong>textos<\/strong> o elementos (por ejm <strong>im\u00e1genes&#8230;)<\/strong> que apuntan a otras rutas de nuestros documentos o de documentos externos. Nos van a dar interactividad entre diferentes <strong>documentos HTML.<\/strong><\/p>\n\n\n\n<p>Los <strong>enlaces<\/strong> est\u00e1n representados por la etiqueta <strong><em>&lt;a&gt;.<\/em><\/strong> Dichos <strong>enlaces<\/strong> pueden ser relativos al mismo documento, o apunten a otra p\u00e1gina de nuestro sitio o de otro sitio web.<\/p>\n\n\n\n<p>Veamos su sintaxis.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;a href=\"https:\/\/sutilweb.eu\"&gt;Visita Sutil Web&lt;\/a&gt;<\/pre>\n\n\n\n<p>Los enlaces pueden ser:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Internos:<\/strong> apuntan al mismo sitio web, incluso a la misma p\u00e1gina del sitio web.<\/li>\n\n\n\n<li><strong>Externos:<\/strong> apuntan a otro sitio web, para lo cual hay que incluir el protocolo <strong>HTTP<\/strong>\/<strong>HTTPS.<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Los <strong>enlaces<\/strong> son <strong>etiquetas<\/strong> que trabajan en linea. Se suele utilizar el atributo <strong><em>rel=\u00bbnofollow\u00bb<\/em><\/strong> que lo que le dice a los rastreadores es que este enlace no forma parte del sitio en el que estamos. Tambi\u00e9n podemos utilizar el atributo <strong><em>target<\/em><\/strong> que indica como se abrir\u00e1 el enlace.<\/p>\n\n\n\n<p><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;a href=\"https:\/\/google.es\" rel=\"nofollow\" target=\"_blank\"&gt;Visita Google&lt;\/a&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Enlaces internos<\/h2>\n\n\n\n<p>Un <strong>enlace interno<\/strong> es un enlace que apunta al mismo documento o <strong>URL,<\/strong> en una distinta ubicaci\u00f3n. Se pueden construir enlaces internos utilizando un identificador al texto donde queremos ir, y la almohadilla (#) que nos ayuda a distinguir las diferentes anclas internas que puedan existir. Veamos un ejm.<\/p>\n\n\n\n<p><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;a href=\"#identificador\"&gt;Haz clic aqu\u00ed para ir al p\u00e1rrafo con el id=\"identificador&lt;\/a&gt;\n&lt;p id=\"identificador\"&gt;El enlace de arriba nos llevar\u00e1 a este p\u00e1rrafo&lt;\/p&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Acceder a otros protocolos<\/h2>\n\n\n\n<p>Los <strong>enlaces<\/strong> permiten acceder hacia otros <strong>protocolos,<\/strong> por ejm, abrir la aplicaci\u00f3n que tengamos predeterminada para el correo electr\u00f3nico para poder mandar un mensaje, tambi\u00e9n acceder a marcar un <strong>tlfo,<\/strong> protocolo que desde un <strong>tlfo m\u00f3vil<\/strong> funciona autom\u00e1ticamente. Veamos un ejm.<\/p>\n\n\n\n<p><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;a href=\"mailto:info@sutilweb.eu\">info@sutilweb.eu&lt;\/a><br>&lt;a href=\"tel:34647914089\">+34 647 914 089&lt;\/a><br>&lt;a href=\"https:\/\/api.whatsapp.com\/send?phone=52622242187&amp;text=Hola\">WhatsApp&lt;\/a><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Los enlaces son aquellos textos o elementos (por ejm im\u00e1genes&#8230;) que apuntan a otras rutas de nuestros documentos o de [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":89,"menu_order":17,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-357","page","type-page","status-publish","hentry"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Sutil Web","author_link":"https:\/\/sutilweb.eu\/index.php\/author\/sutilweb\/"},"uagb_comment_info":0,"uagb_excerpt":"Los enlaces son aquellos textos o elementos (por ejm im\u00e1genes&#8230;) que apuntan a otras rutas de nuestros documentos o de [&hellip;]","_links":{"self":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/comments?post=357"}],"version-history":[{"count":2,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/357\/revisions"}],"predecessor-version":[{"id":359,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/357\/revisions\/359"}],"up":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/89"}],"wp:attachment":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/media?parent=357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}