{"id":67,"date":"2024-05-20T21:44:12","date_gmt":"2024-05-20T19:44:12","guid":{"rendered":"https:\/\/blog.sutilweb.eu\/?page_id=67"},"modified":"2024-05-20T22:01:38","modified_gmt":"2024-05-20T20:01:38","slug":"08-estilos","status":"publish","type":"page","link":"https:\/\/sutilweb.eu\/index.php\/lenguajes\/html5\/html5-manual\/08-estilos\/","title":{"rendered":"08. Estilos"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">El atributo HTML <strong><em>style<\/em> <\/strong>es usado para a\u00f1adir <strong>estilos<\/strong> a un elemento, como el color, la fuente, el tama\u00f1o&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">La configuraci\u00f3n del estilo de un elemento HTML se puede hacer con el atributo <strong><em>style<\/em><\/strong>. Dicho atributo tiene la siguiente sintaxis.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;<em>etiqueta <\/em><em>style<\/em>=\"<em>propiedad: valor;<\/em>\"&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">La propiedad es una propiedad CSS, lo mismo que el valor.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Color de fondo<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">La propiedad CSS <strong><em>background-color<\/em><\/strong> define el color de fondo de un elemento.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;body&nbsp;style=\"background-color:powderblue;\"&gt;\n\n&lt;h1&gt;Esto es un encabezado&lt;\/h1&gt;\n&lt;p&gt;Esto es un p\u00e1rrafo.&lt;\/p&gt;\n\n&lt;\/body&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Color de texto<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">La propiedad CSS <strong><em>color<\/em> <\/strong>define el color de texto para un elemento HTML.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;h1&nbsp;style=\"color:blue;\"&gt;This is a heading&lt;\/h1&gt;\n&lt;p&nbsp;style=\"color:red;\"&gt;This is a paragraph.&lt;\/p&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Fuentes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">La propiedad CSS <strong><em>font-family<\/em><\/strong> define la fuente que va a ser usada para un elemento HTML.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;h1&nbsp;style=\"font-family:verdana;\"&gt;This is a heading&lt;\/h1&gt;\n&lt;p&nbsp;style=\"font-family:courier;\"&gt;This is a paragraph.&lt;\/p&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Tama\u00f1o del texto<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">La propiedad CSS <strong><em>font-size<\/em><\/strong> define el tama\u00f1o de texto para un elemento HTML.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;h1&nbsp;style=\"font-size:300%;\"&gt;This is a heading&lt;\/h1&gt;\n&lt;p&nbsp;style=\"font-size:160%;\"&gt;This is a paragraph.&lt;\/p&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Alineaci\u00f3n de texto<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">La propiedad CSS <strong><em>text-align<\/em><\/strong> define la alineaci\u00f3n de texto de un elemento HTML.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Ejm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;h1&nbsp;style=\"text-align:center;\"&gt;Centered Heading&lt;\/h1&gt;\n&lt;p&nbsp;style=\"text-align:center;\"&gt;Centered paragraph.&lt;\/p&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Resumen<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Utilizar el atributo <strong><em>style<\/em><\/strong> para dise\u00f1ar elementos HTML<\/li>\n\n\n\n<li>Usar <strong><em>background-color<\/em><\/strong> para el color de fondo<\/li>\n\n\n\n<li>Usar <strong><em>color<\/em> <\/strong>para los colores del texto<\/li>\n\n\n\n<li>Utilizar <strong><em>font-family<\/em><\/strong> para fuentes de texto<\/li>\n\n\n\n<li>Utilizar <strong><em>font-size<\/em><\/strong> para los tama\u00f1os de texto<\/li>\n\n\n\n<li>Utilizar <strong><em>text-align<\/em><\/strong> para la alineaci\u00f3n del texto<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>El atributo HTML style es usado para a\u00f1adir estilos a un elemento, como el color, la fuente, el tama\u00f1o&#8230; La configuraci\u00f3n del&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":41,"menu_order":7,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","footnotes":""},"class_list":["post-67","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":"El atributo HTML style es usado para a\u00f1adir estilos a un elemento, como el color, la fuente, el tama\u00f1o&#8230; La configuraci\u00f3n del...","_links":{"self":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/67","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=67"}],"version-history":[{"count":2,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/67\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/67\/revisions\/76"}],"up":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/41"}],"wp:attachment":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/media?parent=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}