
{"id":6063,"date":"2017-05-13T01:19:34","date_gmt":"2017-05-13T01:19:34","guid":{"rendered":"http:\/\/tapchicntt.com\/?p=6063"},"modified":"2023-09-18T15:14:15","modified_gmt":"2023-09-18T08:14:15","slug":"tao-menu-bang-cach-tuy-chinh-pseudo-elements-css3","status":"publish","type":"post","link":"https:\/\/tapchicntt.com\/tao-menu-bang-cach-tuy-chinh-pseudo-elements-css3\/","title":{"rendered":"T\u1ea1o menu b\u1eb1ng c\u00e1ch t\u00f9y ch\u1ec9nh Pseudo Elements CSS3"},"content":{"rendered":"\n<p>Trong b\u00e0i h\u01b0\u1edbng d\u1eabn n\u00e0y, t\u00f4i s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng CSS3 b\u1eb1ng c\u00e1ch t\u00f9y ch\u1ec9nh Pseudo Element<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u0110\u1ea7u ti\u00ean ch\u00fang ta t\u1ea1o HTML sau:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;nav class=&quot;ph-lift&quot;&gt;\n    &lt;ul&gt;\n        &lt;li class=&quot;active&quot;&gt;\n            &lt;a href=&quot;#home&quot; data-title=&quot;Home&quot;&gt;Home&lt;\/a&gt;\n        &lt;\/li&gt;\n        &lt;li&gt;\n            &lt;a href=&quot;#portfolio&quot; data-title=&quot;My works&quot;&gt;My works&lt;\/a&gt;\n        &lt;\/li&gt;\n        &lt;li&gt;\n            &lt;a href=&quot;#about&quot; data-title=&quot;Who am I?&quot;&gt;Who am I?&lt;\/a&gt;\n        &lt;\/li&gt;\n        &lt;li&gt;\n            &lt;a href=&quot;#contact&quot; data-title=&quot;Contact me&quot;&gt;Contact me&lt;\/a&gt;\n        &lt;\/li&gt;\n    &lt;\/ul&gt;\n&lt;\/nav&gt;\n<\/pre><\/div>\n\n\n<p>T\u1ea1o hi\u1ec7u \u1ee9ng hover thay \u0111\u1ed5i m\u00e0u n\u1ec1n v\u00e0 th\u00eam hi\u1ec7u \u1ee9ng \u0111\u1ed7 b\u00f3ng v\u00e0o b\u00ean trong:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\nnav.ph-lift ul li {\n    float: left;\n    height: 90px;\n    line-height: 90px;\n    background: white;\n    overflow: hidden;\n    transition: all.6s ease; }\n    nav.ph-lift ul li:hover {\n      box-shadow: 0 0 15px rgba(0, 0, 0, 0.3) inset;\n      background: teal; }\n\nnav.ph-lift ul li a {\n  display: block;\n  text-decoration: none;\n  color: #007e7e;\n  padding: 0 45px;\n  margin-top: 0;\n  transition: all.6s ease; }\n\nnav.ph-lift ul li:hover a {\n      margin-top: -90px;\n      color: white;\n      text-shadow: 0 1px 2px  black; }\n\nnav.ph-lift ul li a:after {\n      content: attr(data-title);\n      display: block; }\n<\/pre><\/div>\n\n\n<p>T\u1ea1o HTML th\u1ee9 2 c\u00f3 menu con:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;nav class=&quot;ph-lift1&quot;&gt;\n    &lt;ul&gt;\n        &lt;li class=&quot;active&quot;&gt;&lt;a href=&quot;#home&quot; data-title=&quot;Home&quot;&gt;&lt;span data-title=&quot;Home&quot;&gt;Home&lt;\/span&gt;&lt;\/a&gt;\n            &lt;ul&gt;\n                &lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;span data-title=&quot;Featured&quot;&gt;Featured&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;\n                &lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;span data-title=&quot;Top 10&quot;&gt;Top 10&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;\n            &lt;\/ul&gt;\n        &lt;\/li&gt;\n        &lt;li&gt;&lt;a href=&quot;#portfolio&quot;&gt;&lt;span data-title=&quot;My works&quot;&gt;My works&lt;\/span&gt;&lt;\/a&gt;\n            &lt;ul&gt;\n                &lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;span data-title=&quot;Web design&quot;&gt;Web design&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;\n                &lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;span data-title=&quot;Illustrations&quot;&gt;Illustrations&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;\n                &lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;span data-title=&quot;Patterns&quot;&gt;Patterns&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;\n            &lt;\/ul&gt;\n        &lt;\/li&gt;\n        &lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;span data-title=&quot;Who am I?&quot;&gt;Who am I?&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;span data-title=&quot;Contact me&quot;&gt;Contact me&lt;\/span&gt;&lt;\/a&gt;\n            &lt;ul&gt;\n                &lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;span data-title=&quot;Email me&quot;&gt;Email me&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;\n                &lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;span data-title=&quot;Network&quot;&gt;Network&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;\n            &lt;\/ul&gt;\n        &lt;\/li&gt;\n    &lt;\/ul&gt;\n&lt;\/nav&gt;\n<\/pre><\/div>\n\n\n<p>CSS ch\u00ednh b\u1ea1n v\u1eabn v\u1eabn l\u00e0m nh\u01b0 tr\u00ean nh\u01b0ng th\u00eam v\u00e0o t\u00ednh n\u0103ng overflow:hidden cho ph\u1ea7n t\u1eed<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\nnav.ph-lift1 &gt; ul &gt; li {\n   float: left; }\n nav.ph-lift1 ul li {\n   height: 80px;\n   line-height: 80px;\n   background: white;\n   -webkit-transition: all.6s ease;\n   -moz-transition: all.6s ease;\n   -o-transition: all.6s ease;\n   -ms-transition: all.6s ease;\n   transition: all.6s ease; }\n   nav.ph-lift1 ul li ul {\n     max-height: 0;\n     -webkit-transition: all.6s ease;\n     -moz-transition: all.6s ease;\n     overflow: hidden;\n     display: block; }\n   nav.ph-lift1 ul li:hover {\n     box-shadow: 0 0 15px rgba(0, 0, 0, 0.3) inset;\n     background: darkolivegreen; }\n   nav.ph-lift1 ul li:hover ul {\n     max-height: 300px; }\n   nav.ph-lift1 ul li a {\n     display: block;\n     overflow: hidden;\n     text-decoration: none;\n     color: #546a2f;\n     height: 80px; }\n   nav.ph-lift1 ul li ul li a {\n     color: #7e7e00; }\n   nav.ph-lift1 ul li ul li:hover {\n     background: olive; }\n   nav.ph-lift1 ul li a span {\n       -webkit-transition: all.6s ease;\n       -moz-transition: all.6s ease;\n       -o-transition: all.6s ease;\n       -ms-transition: all.6s ease;\n       transition: all.6s ease;\n       display: block;\n       padding: 0 40px; }\n   nav.ph-lift1 ul li:hover &gt; a span {\n     margin-top: -80px;\n     color: white;\n     text-shadow: 0 1px 2px  black; }\n     nav.ph-lift1 ul li a span:after {\n       content: attr(data-title);\n       display: block; }\n<\/pre><\/div>\n\n\n<p>Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Trong b\u00e0i h\u01b0\u1edbng d\u1eabn n\u00e0y, t\u00f4i s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng CSS3 b\u1eb1ng c\u00e1ch t\u00f9y ch\u1ec9nh Pseudo [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":8659,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[145],"tags":[],"class_list":["post-6063","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html-css"],"views":459,"_links":{"self":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/6063","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/comments?post=6063"}],"version-history":[{"count":11,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/6063\/revisions"}],"predecessor-version":[{"id":8670,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/6063\/revisions\/8670"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/media\/8659"}],"wp:attachment":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/media?parent=6063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/categories?post=6063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/tags?post=6063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}