{"id":23199,"date":"2024-01-24T17:27:12","date_gmt":"2024-01-24T16:27:12","guid":{"rendered":"https:\/\/nelkodev.com\/blog\/texto-etiqueta-html-mark-subrayado-y-resaltado-en-html\/"},"modified":"2024-06-03T17:31:58","modified_gmt":"2024-06-03T16:31:58","slug":"texto-etiqueta-html-mark-subrayado-y-resaltado-en-html","status":"publish","type":"post","link":"https:\/\/nelkodev.com\/en\/blog\/text-tag-html-mark-underline-and-highlight-in-html\/","title":{"rendered":"Text Tag HTML Mark: Underline and Highlighting in HTML"},"content":{"rendered":"<p>HTML elements offer multiple options for formatting and styling text on a web page. Among these options is the HTML &quot;mark&quot; tag, which allows you to underline and highlight the content of a document.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ffffff;color:#ffffff\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #ffffff;color:#ffffff\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/nelkodev.com\/en\/blog\/text-tag-html-mark-underline-and-highlight-in-html\/#%C2%BFComo_utilizar_la_etiqueta_HTML_%22mark%22\" >How to use the HTML &quot;mark&quot; tag?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/nelkodev.com\/en\/blog\/text-tag-html-mark-underline-and-highlight-in-html\/#Como_subrayar_texto_en_HTML\" >How to underline text in HTML<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/nelkodev.com\/en\/blog\/text-tag-html-mark-underline-and-highlight-in-html\/#Como_cambiar_el_color_del_texto_en_HTML\" >How to change text color in HTML<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/nelkodev.com\/en\/blog\/text-tag-html-mark-underline-and-highlight-in-html\/#Consejos_adicionales_sobre_el_uso_de_la_etiqueta_HTML_%22mark%22\" >Additional tips on using the HTML &quot;mark&quot; tag<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/nelkodev.com\/en\/blog\/text-tag-html-mark-underline-and-highlight-in-html\/#Preguntas_frecuentes\" >Frequently asked questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/nelkodev.com\/en\/blog\/text-tag-html-mark-underline-and-highlight-in-html\/#%C2%BFEs_recomendable_abusar_del_uso_de_la_etiqueta_%22mark%22_en_una_pagina_web\" >Is it advisable to abuse the use of the &quot;mark&quot; tag on a web page?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/nelkodev.com\/en\/blog\/text-tag-html-mark-underline-and-highlight-in-html\/#%C2%BFPuedo_combinar_la_etiqueta_%22mark%22_con_otras_etiquetas_para_lograr_efectos_visuales_mas_complejos\" >Can I combine the &quot;mark&quot; tag with other tags to achieve more complex visual effects?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/nelkodev.com\/en\/blog\/text-tag-html-mark-underline-and-highlight-in-html\/#%C2%BFPuedo_cambiar_el_color_del_texto_subrayado_o_resaltado\" >Can I change the color of underlined or highlighted text?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/nelkodev.com\/en\/blog\/text-tag-html-mark-underline-and-highlight-in-html\/#%C2%BFPuedo_utilizar_la_etiqueta_%22mark%22_para_subrayar_texto_sin_resaltarlo_al_mismo_tiempo\" >Can I use the &quot;mark&quot; tag to underline text without highlighting it at the same time?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%C2%BFComo_utilizar_la_etiqueta_HTML_%22mark%22\"><\/span>How to use the HTML &quot;mark&quot; tag?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The &quot;mark&quot; tag is very easy to use. Simply place the text you want to underline or highlight between the opening tags.&quot;<mark>&quot;and closing&quot;<\/mark>&quot;. For example:<\/p>\n<pre>\n<code>&lt;p&gt;This is a &lt;mark&gt;Underlined text&lt;\/mark&gt; in HTML.&lt;\/p&gt;<\/code>\n<\/pre>\n<p>This code will generate a paragraph where the phrase &quot;underlined text&quot; will be underlined in the browser. It is important to note that underlining is not a characteristic of the &quot;mark&quot; element, although it is commonly used for this purpose.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Como_subrayar_texto_en_HTML\"><\/span>How to underline text in HTML<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Underlining text in HTML is done by using the &quot; tag<u>&quot;. This tag creates a horizontal line below the text that is between the opening and closing tags. Let&#039;s look at an example:<\/p>\n<pre>\n<code>&lt;p&gt;This is a &lt;u&gt;Underlined text&lt;\/u&gt; in HTML.&lt;\/p&gt;<\/code>\n<\/pre>\n<p>With this code, the &quot;underlined text&quot; text in the paragraph will be presented with a horizontal line below it. If you want to apply both styles, underlined and highlighted, you can use the combination of both tags:<\/p>\n<pre>\n<code>&lt;p&gt;This is a &lt;mark&gt;&lt;u&gt;underlined and highlighted text&lt;\/u&gt;&lt;\/mark&gt; in HTML.&lt;\/p&gt;<\/code>\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Como_cambiar_el_color_del_texto_en_HTML\"><\/span>How to change text color in HTML<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you want to change the color of the underlined or highlighted text, you can use the CSS &quot;color&quot; property within the &quot;style&quot; tag. For example:<\/p>\n<pre>\n<code>&lt;p&gt;This is a &lt;mark style=&quot;color: red;&quot;&gt;red underlined text&lt;\/mark&gt; in HTML.&lt;\/p&gt;<\/code>\n<\/pre>\n<p>With this line of code, the underlined text in the paragraph will be presented in red. Additionally, any valid value can be used for the &quot;color&quot; attribute, such as color names, hexadecimal codes, or RGBA values.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Consejos_adicionales_sobre_el_uso_de_la_etiqueta_HTML_%22mark%22\"><\/span>Additional tips on using the HTML &quot;mark&quot; tag<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u2013 It is important to use the &quot;mark&quot; tag sparingly and semantically. Its excessive or unnecessary use can negatively affect the user experience and the readability of the content.<br \/>\n\u2013 The &quot;mark&quot; tag is especially useful for highlighting key terms, quotes, or highlighted pieces of text in a document.<br \/>\n\u2013 For more control over the layout and styling of underlining and highlighting, it is recommended to use CSS instead of basic HTML tags.<\/p>\n<p>In conclusion, the HTML &quot;mark&quot; tag offers a simple and fast way to underline and highlight text on a web page. With its proper use and with the help of CSS, it is possible to achieve attractive visual effects and improve the navigability of the content. Always remember to use these options responsibly, thinking about the user experience and the readability of the text.<\/p>\n<p>&#8212;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Preguntas_frecuentes\"><\/span>Frequently asked questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%C2%BFEs_recomendable_abusar_del_uso_de_la_etiqueta_%22mark%22_en_una_pagina_web\"><\/span>Is it advisable to abuse the use of the &quot;mark&quot; tag on a web page?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>No, it is recommended to use the &quot;mark&quot; tag sparingly and semantically. Excessive use can affect readability and user experience.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%C2%BFPuedo_combinar_la_etiqueta_%22mark%22_con_otras_etiquetas_para_lograr_efectos_visuales_mas_complejos\"><\/span>Can I combine the &quot;mark&quot; tag with other tags to achieve more complex visual effects?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, you can combine the &quot;mark&quot; tag with other tags and use CSS to achieve more personalized and stylized designs.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%C2%BFPuedo_cambiar_el_color_del_texto_subrayado_o_resaltado\"><\/span>Can I change the color of underlined or highlighted text?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, you can change the color of the text using the CSS &quot;color&quot; property inside the &quot;style&quot; tag along with the &quot;mark&quot; tag.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%C2%BFPuedo_utilizar_la_etiqueta_%22mark%22_para_subrayar_texto_sin_resaltarlo_al_mismo_tiempo\"><\/span>Can I use the &quot;mark&quot; tag to underline text without highlighting it at the same time?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, you can use the &quot;mark&quot; tag independently to underline text without applying any other visual styling. <\/p>\n<p>I hope this article was helpful to you in understanding how to use the HTML &quot;mark&quot; tag to underline and highlight text on your web pages. If you have any other questions, please feel free to contact me through my website [nelkodev.com](https:\/\/nelkodev.com).<\/p>","protected":false},"excerpt":{"rendered":"<p>Los elementos HTML ofrecen m\u00faltiples opciones para dar formato y estilizar el texto en una p\u00e1gina web. Entre estas opciones, se encuentra la etiqueta HTML &quot;mark&quot;, que permite subrayar y resaltar el contenido de un documento. \u00bfC\u00f3mo utilizar la etiqueta HTML &quot;mark&quot;? La etiqueta &quot;mark&quot; es muy sencilla de utilizar. Simplemente se coloca el texto [&hellip;]<\/p>","protected":false},"author":1,"featured_media":23200,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[420,1124],"tags":[205,606,475,996,997,995,736],"class_list":["post-23199","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-html","tag-blog","tag-etiqueta","tag-html","tag-mark","tag-resaltado","tag-subrayado","tag-texto"],"_links":{"self":[{"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/posts\/23199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/comments?post=23199"}],"version-history":[{"count":0,"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/posts\/23199\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/media\/23200"}],"wp:attachment":[{"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/media?parent=23199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/categories?post=23199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nelkodev.com\/en\/wp-json\/wp\/v2\/tags?post=23199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}