{"id":150,"date":"2022-11-24T21:07:30","date_gmt":"2022-11-24T21:07:30","guid":{"rendered":"http:\/\/javigomez.org\/?p=150"},"modified":"2025-09-29T20:34:20","modified_gmt":"2025-09-29T20:34:20","slug":"colocar-con-flex-un-div-a-la-derecha-con-el-texto-centrado-horizontal-y-verticalmente","status":"publish","type":"post","link":"https:\/\/javigomez.org\/index.php\/2022\/11\/24\/colocar-con-flex-un-div-a-la-derecha-con-el-texto-centrado-horizontal-y-verticalmente\/","title":{"rendered":"Colocar con Flex un div a la derecha con el texto centrado horizontal y verticalmente"},"content":{"rendered":"\n<p>En el siguiente c\u00f3digo se utiliza <strong>flex-direction: row-reverse<\/strong> o <strong>justify-content: flex-end<\/strong>, para colocar la capa a la derecha.<\/p>\n\n\n\n<p>Para centrar el texto dentro de ese div se vuelve a poner <strong>display:flex<\/strong> y se centra con <strong>align-items:center<\/strong> y <strong>justify-content:center<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"http:\/\/javigomez.org\/wp-content\/uploads\/2022\/11\/image-29-2-14-1.png\" alt=\"\" class=\"wp-image-151\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div class=\"container\"&gt; \n  &lt;div class=\"item\"&gt;Bot\u00f3n&lt;\/div&gt; \n&lt;\/div&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>.item{\n  width:150px;   height:50px;\n  border: 1px solid black;\n  display:flex;\n  align-items:center;\n  justify-content:center;\n}\n.container{\n  border: 1px solid blue;\n  display:flex;\n\/* Se puede utilizar una de las dos instrucciones siguientes *\/\n  flex-direction: row-reverse;\n  justify-content:flex-end;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>En el siguiente c\u00f3digo se utiliza flex-direction: row-reverse o justify-content: flex-end, para colocar la capa a la derecha. Para centrar el texto dentro de ese &hellip; <\/p>\n","protected":false},"author":1,"featured_media":151,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[23,106,153,155,209,210,293],"class_list":["post-150","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css","tag-alig-items","tag-css","tag-flex","tag-flex-direction","tag-justify-conent","tag-justify-content","tag-row-reverse"],"_links":{"self":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":1,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"predecessor-version":[{"id":976,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/posts\/150\/revisions\/976"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media\/151"}],"wp:attachment":[{"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/javigomez.org\/index.php\/wp-json\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}