{"id":2520,"date":"2022-04-06T04:42:24","date_gmt":"2022-04-06T04:42:24","guid":{"rendered":"https:\/\/migoda.vn\/toi-uu-css-cho-website-1649220137"},"modified":"2023-04-20T02:05:49","modified_gmt":"2023-04-20T02:05:49","slug":"toi-uu-css-cho-website-wordpresss-1649220137","status":"publish","type":"post","link":"https:\/\/migoda.vn\/blog\/toi-uu-css-cho-website-wordpresss-1649220137\/","title":{"rendered":"11 th\u1ee7 thu\u1eadt T\u1ed1i \u01b0u css t\u0103ng t\u1ed1c cho wordpresss (2020)"},"content":{"rendered":"
B\u1ea1n \u0111ang \u0111\u1ecdc: 11 th\u1ee7 thu\u1eadt T\u1ed1i \u01b0u css t\u0103ng t\u1ed1c cho wordpresss (2020)<\/a><\/span><\/p>\n<\/div>\n <\/span> T\u1ed1c \u0111\u1ed9 trong th\u1ef1c ti\u1ec5n kh\u00f4ng quan tr\u1ecdng b\u1eb1ng v\u1eadn t\u1ed1c c\u1ea3m nh\u1eadn c\u1ee7a ng\u01b0\u1eddi mua<\/span><\/p><\/blockquote>\n H\u1ea1nh ph\u00fac th\u1eadt kh\u00f4ng quan tr\u1ecdng b\u1eb1ng b\u1ea1n c\u1ea3m th\u1ea5y ni\u1ec1m h\u1ea1nh ph\u00fac .<\/span> khi b\u1ea1n s\u1eed d\u1ee5ng WordPress l\u1ef1a ch\u1ecdn themes m\u1ed9t \u0111i\u1ec1u c\u1ef1c k\u1ef3 quan tr\u1ecdng \u1ea3nh h\u01b0\u1edfng t\u00e1c \u0111\u1ed9ng \u0111\u1ebfn v\u1eadn t\u1ed1c load website c\u1ee7a b\u1ea1n theo kinh nghi\u1ec7m tay ngh\u1ec1 c\u1ee7a m\u00ecnh th\u00ec n\u00f3 chi\u1ebfm t\u1eeb 50 % \u0111\u1ebfn 80 % v\u1eadn t\u1ed1c load website c\u1ee7a b\u1ea1n .<\/span> theo m\u00ecnh 99 % nh\u1eefng website c\u1ee7a WordPress th\u00ec kh\u00f4ng n\u00ean \u0111\u1ec3 trong ph\u1ea7n t\u00f9y ch\u1ec9nh giao \u0111i\u1ec7n m\u00e0 h\u00e3y \u0111\u1ec3 trong file c\u1ee9ng nh\u01b0 style.css<\/span> \u0110\u00e2y l\u00e0 ph\u1ea7n kh\u00e1 l\u00e0 n\u00e2ng cao d\u00e0nh cho nh\u1eefng ng\u01b0\u1eddi n\u00e2ng cao v\u00e0 bi\u1ebft l\u1eadp tr\u00ecnh ng\u00f4n t\u1eeb css .<\/span> <\/span> M\u1ed9t website th\u00ec t\u1ed5ng h\u1ee3p s\u1ebd c\u00f3 r\u1ea5t nhi\u1ec1u trang .<\/span> M\u1ed9t th\u1ee7 ph\u00e1p nh\u1ecf n\u1ebfu b\u1ea1n \u0111ang d\u00f9ng woo variation swatches th\u00ec cho v\u00e0o functions.php \u0111\u1ec3 t\u1ea3i \u0111i\u1ec1u ki\u1ec7n k\u00e8m theo plugin n\u00e0y \u0111i nh\u00e9 .<\/span><\/p>\n M\u1ed9t nguy\u00ean do n\u00e0o \u0111\u00f3 b\u1ea1n s\u1eed d\u1ee5ng plugin m\u00e0 n\u00f3 load file css m\u00e0 b\u1ea1n kh\u00f4ng s\u1eed d\u1ee5ng b\u1ea5t k\u1ec3 th\u1ee9 g\u00ec b\u1ea1n c\u00f3 gi\u1ea3i ph\u00e1p kh\u00e1c t\u1ed1t h\u01a1n b\u1ea1n ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 x\u00f3a b\u1ecf n\u00f3 .<\/span><\/p>\n x\u00f3a h\u00e0ng lo\u1ea1t css c\u1ee7a plugin woo variation swatches<\/span> vi\u1ebft t\u1eaft css l\u00e0 c\u00e1ch t\u0103ng v\u1eadn t\u1ed1c load website, gi\u1ea3m s\u1ef1 \u0111\u01b0\u1ee3c m\u1ed9t ch\u00fat \u00edt dung t\u00edch file css c\u1ee7a b\u1ea1n, n\u00f3 gi\u00fap t\u0103ng v\u1eadn t\u1ed1c load website b\u1ea1n<\/span><\/p>\n v\u00ed d\u1ee5: b\u1ea1n d\u00f9ng { padding: 10px 20x 15px 30px;}<\/span> Vi\u1ebft t\u1eaft nh\u1eefng \u0111o\u1ea1n css tr\u00ecnh duy\u1ec7t v\u1eabn hi\u1ec3u \u0111\u01b0\u1ee3c m\u00e0 file css c\u1ee7a b\u1ea1n v\u1eabn nh\u1ecf l\u1ea1i .<\/span><\/p>\n Thu\u1eadt to\u00e1n n\u00e9n css hi\u1ec3u m\u1ed9t c\u00e1ch \u0111\u01a1n thu\u1ea7n v\u00f4 hi\u1ec7u ghi ch\u00fa v\u00e0 kho\u1ea3ng ch\u1eebng tr\u1eafng v\u00e0 vi\u1ebft t\u1eaft css .<\/span> Nh\u01b0ng v\u1edbi tr\u00ecnh duy\u1ec7t m\u00e1y m\u00f3c th\u00ec kho\u1ea3ng tr\u1eafng v\u00e0 nh\u1eefng d\u1ea5u ghi ch\u00fa l\u1ea1i l\u00e0 m\u1ed9t g\u00e1nh n\u1eb7ng, n\u00f3 kh\u00f4ng c\u1ea7n thi\u1ebft m\u00e0 l\u00e0m n\u1eb7ng th\u00eam file gi\u00fap gi\u1ea3m t\u1ed1c \u0111\u1ed9 website \u0111i \u0111\u00e1ng k\u1ebft.<\/span><\/p>\n Xem th\u00eam: C\u00e1c b\u01b0\u1edbc t\u1ed1i \u01b0u h\u00f3a website cho SEO v\u00e0 chuy\u1ec3n \u0111\u1ed5i<\/a><\/span><\/p>\n<\/div>\n V\u00ed d\u1ee5 : l\u00fac ch\u01b0a n\u00e9n dung t\u00edch file n\u00e0y l\u00e0 149 bytes<\/span><\/p>\n L\u00fac \u0111\u00e3 n\u00e9n : gi\u1ea3m \u0111\u01b0\u1ee3c 26,8 % c\u00f2n l\u1ea1i l\u00e0 109 bytes<\/span><\/p>\n <\/span> V\u00ed d\u1ee5 b\u1ea1n s\u1eed d\u1ee5ng css l\u00e0m cho giao di\u1ec7n b\u1ea1n ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 css b\u1eafng d\u1ea5u c\u00e1ch .<\/span><\/p>\n v\u00ed d\u1ee5.<\/span> Th\u00ec h\u00e3y s\u1eed d\u1ee5ng ki\u1ec3u n\u00e0y t\u1ed1i \u01b0u h\u01a1n .<\/span> C\u00e1c gi\u00e1 tr\u1ecb s\u1ebd ra l\u00e0 nh\u01b0 nhau tuy nhi\u00ean gi\u1ea3i ph\u00e1p 2 b\u1ea1n ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ea1i class kh\u00f4ng c\u1ea7n ph\u1ea3i nh\u00e9t th\u00eam v\u00e0o \u0111\u00f3 m\u1ed9t c\u00e1ch t\u1ed1t \u01b0u tuy\u1ec7t v\u1eddi .<\/span><\/p>\n D\u00f9ng class trong class v\u1eabn t\u1ed1c \u0111\u1ed9 lu\u00f4n t\u1ed1t h\u01a1n l\u00e0 d\u00f9ng style.css<\/span> V\u00ed d\u1ee5 v\u1ec1 style :<\/span><\/p>\n D\u00f9ng style n\u00f3 kh\u00f4ng cache \u0111\u01b0\u1ee3c v\u00e0 l\u00e0m cho tr\u00ecnh duy\u1ec7t web c\u1ee7a ng\u01b0\u1eddi mua thao t\u00e1c nhi\u1ec1u h\u01a1n .<\/span> 2 nh\u1eefng code th\u00ec \u0111\u1ec1u ra gi\u00e1 tr\u1ecb l\u00e0 nh\u01b0 nhau nh\u01b0ng v\u1eadn t\u1ed1c th\u00ec kh\u00e1c nhau .<\/span> \u0110\u00e2y l\u00e0 m\u1ed9t k\u1ef9 thu\u1eadt ph\u00f9 thu\u1ed9c v\u00e0o giao th\u1ee9c c\u1ee7a b\u1ea1n \u0111ang s\u1eed d\u1ee5ng<\/span> V\u00ed d\u1ee5: b\u1ea1n l\u00e0m nh\u00e2n vi\u00ean ng\u00e2n h\u00e0ng<\/span> l\u1ef1a ch\u1ecdn 1 : 1 \u00f4ng ng\u01b0\u1eddi mua l\u1edbn t\u1ea1o doanh thu cho b\u1ea1n l\u00e0 100.000 VN\u0110 ho\u1eb7c l\u1ef1a ch\u1ecdn 2 : 10 ng\u01b0\u1eddi mua nh\u1ecf t\u1ea1o l\u1ee3n nhu\u1eadn cho b\u1ea1n 120.000 VN\u0110<\/span><\/p>\n V\u1edbi b\u1ea1n \u0111ang s\u1eed d\u1ee5ng giao th\u1ee9c http2 tr\u1edf xu\u1ed1ng s\u1eed ch\u1ecdn m\u1ed9t l\u00e0 gi\u1ea3i ph\u00e1p t\u1ed1t h\u01a1n.<\/span> v\u1edbi b\u1ea1n \u0111ang s\u1eed d\u1ee5ng giao th\u1ee9c http\/2 tr\u1edf l\u00ean th\u00ec l\u1ef1a ch\u1ecdn 2 s\u1ebd giao ph\u00e1p t\u1ed1t h\u01a1n<\/span> Nguy\u00ean t\u1eafc : b\u00e1n lo\u1ea1i s\u1ea3n ph\u1ea9m 1 tri\u1ec7u \u0111\u00f4 cho m\u1ed9t ng\u01b0\u1eddi kh\u00f3 h\u01a1n b\u00e1n m\u1eabu s\u1ea3n ph\u1ea9m 1 \u0111\u00f4 cho m\u1ed9t tri\u1ec7u ng\u01b0\u1eddi. ( n\u00f3 \u0111\u00fang v\u1edbi giao th\u1ee9c http \/ 2 tr\u1edf l\u00ean ) .<\/span><\/p>\n v\u00ed d\u1ee5 v\u1ec1 css ch\u1ed3ng ch\u00e9o :<\/span><\/p>\n K\u1ebft qu\u1ea3 s\u1ebd tr\u1ea3 v\u1ec1 :<\/span> Thu\u1ed9c t\u00ednh color:red; s\u1ebd \u0111\u00e8 ch\u1ed3ng ch\u00e9o color:blue;<\/strong> c\u00e1c thu\u1ed9c t\u00ednh background-color:#eee; v\u1eabn hi\u1ec7n th\u1ecb b\u00ecnh th\u01b0\u1eddng kh\u00f4ng b\u1ecb ch\u1ed3ng ch\u00e9o.<\/span><\/p>\n Ch\u00ednh v\u00ec n\u00f3 do \u0111\u00f3 b\u1ea1n khi b\u1ea1n th\u00eam css v\u00e0o file style.css b\u1ea1n c\u1ea7n ph\u1ea3i cho \u0111o\u1ea1n css \u0111\u00f3 xu\u1ed1ng cu\u1ed1i file, s\u1ebd \u0111\u01b0\u1ee3c y\u00eau ti\u00ean ch\u1ed3ng tr\u00e9o .<\/span> Tr\u01b0\u1eddng h\u1ee3p n\u00e0y ph\u1ed5 bi\u1ebfn nh\u1ea5t v\u00e0 l\u00e0 nguy\u00ean nh\u1ea5t ch\u00ednh t\u1ea1o ra css ch\u1ed3ng tr\u00e9o l\u00e3ng ph\u00ed dung l\u01b0\u1ee3ng css c\u1ee7a b\u1ea1n.<\/span><\/p>\n Xem th\u00eam: 10 Th\u1ee7 thu\u1eadt SEO hi\u1ec7u qu\u1ea3 c\u00f3 th\u1ec3 b\u1ea1n ch\u01b0a bi\u1ebft<\/a><\/span><\/p>\n<\/div>\n Hi\u1ec7n t\u1ea1i th\u00ec v\u1eabn ch\u01b0a c\u00f3 c\u00f4ng c\u1ee5 n\u00e0o th\u1eadt s\u1ef1 ngon auto v\u00f4 hi\u1ec7u css ch\u1ed3ng tr\u00e9o th\u1eadt s\u1ef1 t\u1ed1t b\u1ea1n ch\u1ec9 ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 l\u00e0m b\u1eb1ng gi\u1ea3i ph\u00e1p th\u1ee7 c\u00f4ng b\u1eb1ng tay m\u00e0 th\u00f4i .<\/span><\/p>\n T\u00f3m t\u1eaft :<\/span> Xem th\u00eam: Top 10 xu h\u01b0\u1edbng thi\u1ebft k\u1ebf website n\u0103m 2022 \u0111\u1eb9p nh\u1ea5t<\/a><\/span><\/p>\n<\/div>\n Source: https:\/\/migoda.vn<\/a> <\/span> 11 th\u1ee7 thu\u1eadt T\u1ed1i \u01b0u css t\u0103ng t\u1ed1c cho wordpresss CSS l\u00e0 m\u1ed9t ng\u00f4n t\u1eeb l\u1eadp tr\u00ecnh b\u1ea3o v\u1ec7 vi\u1ec7c l\u00e0m ch\u1ec9nh s\u1eeda giao \u0111i\u1ec7n cho website . Tuy nhi\u00ean…<\/p>\n","protected":false},"author":1,"featured_media":4459,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_mi_skip_tracking":false,"footnotes":""},"categories":[26],"tags":[220],"class_list":["post-2520","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-seo","tag-wordpresss"],"_links":{"self":[{"href":"https:\/\/migoda.vn\/blog\/wp-json\/wp\/v2\/posts\/2520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/migoda.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/migoda.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/migoda.vn\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/migoda.vn\/blog\/wp-json\/wp\/v2\/comments?post=2520"}],"version-history":[{"count":0,"href":"https:\/\/migoda.vn\/blog\/wp-json\/wp\/v2\/posts\/2520\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/migoda.vn\/blog\/wp-json\/wp\/v2\/media\/4459"}],"wp:attachment":[{"href":"https:\/\/migoda.vn\/blog\/wp-json\/wp\/v2\/media?parent=2520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/migoda.vn\/blog\/wp-json\/wp\/v2\/categories?post=2520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/migoda.vn\/blog\/wp-json\/wp\/v2\/tags?post=2520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\nCss trung b\u00ecnh c\u1ee7a website WordPress th\u00ec kh\u00f4ng nhi\u1ec1u ch\u1ec9 chi\u1ebfn t\u1eeb 50 kb \u0111\u1ebfn 200 kb .<\/span>
\nTuy nhi\u00ean y\u1ebfu t\u1ed1 \u0111ang n\u00f3i l\u00e0 th\u1ee9 t\u1ef1 load c\u1ee7a css thu\u1ed9c h\u00e0ng r\u1ea5t \u01b0u ti\u00ean c\u1ee7a tr\u00ecnh duy\u1ec7t, n\u1ebfu b\u1ea1n l\u00e0m t\u1ed1t th\u00ec ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 t\u0103ng v\u1eadn t\u1ed1c website to\u00e0n di\u1ec7n v\u00e0 t\u1ed5ng th\u1ec3 full load nh\u01b0ng t\u1ed1i \u01b0u css th\u00ec quan tr\u1ecdng nh\u1ea5t l\u00e0 hi\u1ec7n th\u00ec m\u00e0n h\u00ecnh hi\u1ec3n th\u1ecb s\u1edbm cho ng\u01b0\u1eddi d\u00f9ng .<\/span>
\nD\u00f9 1 bytes c\u0169ng t\u1ea1o l\u00ean c\u1ea3i t\u1ed5 cho ch\u1ec9 s\u1ed1 hi\u1ec7n th\u1ecb m\u00e0n h\u00ecnh hi\u1ec3n th\u1ecb \u0111\u1ea7u trang .<\/span><\/p>\n
\nV\u0169 tr\u1ee5 l\u00e0 c\u00f3 th\u1eadt, n\u00f3 c\u00f3 trong t\u00e2m ch\u00ed b\u1ea1n .<\/span>
\n<\/span><\/p>\nL\u1ef1a ch\u1ecdn themes m\u00e3 h\u00f3a t\u1ed1t<\/span><\/h2>\n
\nH\u00e3y th\u1eadt t\u1eadn tr\u1ecdng khi l\u1ef1a ch\u1ecdn themes \u0111\u1ec3 b\u1ea1n g\u1eafn b\u00f3 .<\/span>
\nC\u00f2n trong tr\u01b0\u1eddng h\u1ee3p b\u1ea1n \u0111\u00e3 ch\u1ecdn r\u1ed3i th\u00ec \u0111\u1eebng ng\u1ea7n ng\u1ea1i thay th\u00f4i themes c\u1ee7a b\u1ea1n, \u0111\u1ed5i kh\u00e1c themes r\u1ea5t \u0111\u01a1n thu\u1ea7n kh\u00f4ng c\u00f3 y\u1ebfu t\u1ed1 g\u00ec l\u00e0 kh\u00f3 kh\u0103n v\u1ea5t v\u1ea3 c\u1ea3 .<\/span>
\nTh\u00f4ng th\u01b0\u1eddng m\u1edbi s\u1eed d\u1ee5ng WordPress m\u00ecnh c\u0169ng ngh\u0129 bi\u1ebfn h\u00f3a themes r\u1ea5t kh\u00f3 kh\u0103n v\u1ea5t v\u1ea3 nh\u01b0ng \u0111\u1eadp c\u1ea3 website \u0111i \u0111\u1eadp l\u1ea1i nh\u01b0ng khi \u0111\u00e3 th\u01b0\u1edfng th\u1ee9c v\u00e0 \u0111\u1ed5i kh\u00e1c v\u00e0i l\u1ea7n themes r\u1ed3i th\u00ec m\u00ecnh T\u00f3m l\u1ea1i \u0111\u1ed5i kh\u00e1c themes kh\u00f4ng c\u00f3 g\u00ec l\u00e0 kh\u00f3 kh\u0103n v\u1ea5t v\u1ea3 c\u1ea3 r\u1ea5t \u0111\u01a1n thu\u1ea7n .<\/span>
\nL\u1eddi khuy\u00ean c\u1ee7a m\u00ecnh : h\u00e3y t\u1ea1o l\u1eadp localhost \u0111\u1ec3 bi\u1ebfn h\u00f3a themes v\u00e0 ch\u1ec9nh s\u1eeda khi l\u00e0m xong m\u1edbi uploads l\u00ean webhost \u0111\u1eebng s\u1eeda tr\u1ef1c ti\u1ebfp tr\u00ean webhost. ( l\u1ed7i n\u00e0y th\u01b0\u1eddng x\u1ea3y ra nhi\u1ec1u v\u1edbi nh\u1eefng ng\u01b0\u1eddi m\u1edbi kh\u1edfi \u0111\u1ea7u )<\/span>
\nC\u00e1ch nh\u00ecn nh\u1eadn themes ch\u1ea5t l\u01b0\u1ee3ng t\u1ed1t th\u00ec c\u00f3 r\u1ea5t nhi\u1ec1u y\u1ebfu t\u1ed1 m\u00ecnh c\u00f3 san s\u1ebb m\u1ed9t b\u00e0i vi\u1ebft v\u1ec1 9 ti\u00eau chu\u1ea9n ch\u1ecdn themes WordPress ch\u1ea5t l\u01b0\u1ee3ng<\/span>
\nNh\u01b0ng ti\u00eau chu\u1ea9n n\u00e0y theo kinh nghi\u1ec7m tay ngh\u1ec1 c\u1ee7a m\u00ecnh l\u00e0 quan tr\u1ecdng, m\u00e0 n\u00f3 kh\u00f4ng quan tr\u1ecdng b\u1eb1ng cung \u1ee9ng \u0111\u00fang nhu y\u1ebfu c\u1ee7a b\u1ea1n, b\u1ea1n ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 t\u00ecm hi\u1ec3u th\u00eam b\u00e0i vi\u1ebft c\u1ee7a m\u00ecnh .<\/span><\/p>\nS\u1eeda css n\u00ean \u0111\u01b0a v\u00e0o file kh\u00f4ng n\u00ean \u0111\u01b0a v\u00e0o n\u1ed9i tuy\u1ebfn<\/span><\/h2>\n
\n\u0110\u00e2y l\u00e0 l\u1ed7i ph\u1ed5 c\u1eadp c\u1ee7a nh\u01b0ng ng\u01b0\u1eddi m\u1edbi kh\u1edfi \u0111\u1ea7u s\u1eed d\u1ee5ng WordPress, th\u1ea5y \u0111o\u1ea1n css n\u00e0o hay \u0111\u01b0\u1ee3c san s\u1ebb tr\u00ean m\u1ea1ng th\u00ec s\u1ebd \u0111\u01b0a v\u00e0o ph\u1ea7n t\u00f9y ch\u1ec9nh giao di\u1ec7n css ( t\u00ednh n\u0103ng n\u00e0y g\u1ea7n nh\u01b0 themes n\u00e0o c\u0169ng \u0111\u1ec1u c\u00f3 ), tuy nhi\u00ean css n\u1ed9i tuy\u1ebfn th\u00ec kh\u00f4ng h\u1ec1 cache \u0111\u01b0\u1ee3c .<\/span>
\nB\u1ea1n n\u00ean \u0111\u01b0\u1ee3c v\u00e0o file style.css file c\u1ee9ng c\u1ee7a css th\u00ec s\u1ebd t\u1ed1t h\u01a1n .<\/span>
\nM\u00ecnh bi\u1ebft l\u00e0 nhi\u1ec1u b\u1ea1n b\u1ea3o em \u0111\u01b0a v\u00e0o file style.css th\u1ea5y c\u00f3 kh\u00f4ng hi\u1ec7u l\u1ef1c th\u1ef1c thi hi\u1ec7n h\u00e0nh ngay, b\u1ea1n n\u00f3i \u0111\u00fang .<\/span>
\nB\u1ea1n \u0111\u01b0a v\u00e0o ph\u1ea3i style.css th\u00ec c\u1ea7n hi\u1ec3u th\u00eam v\u1ec1 k\u1ef9 n\u0103ng v\u00e0 ki\u1ebfn th\u1ee9c tr\u00ecnh duy\u1ec7t cache n\u1eefa c\u00f2n n\u1ebfu b\u1ea1n \u0111\u01b0a v\u00e0o t\u00f9y ch\u1ec9nh css th\u00ec s\u1ebd \u0103n ngay .<\/span><\/p>\nS\u1eeda l\u1ea1i t\u00f9y ch\u1ec9nh css khung<\/span><\/h2>\n
\nN\u1ebfu khuy\u00ean n\u00ean kh\u00f4ng n\u00ean s\u1eed d\u1ee5ng css khung th\u00ec kh\u00f4ng \u0111\u00fang, t\u1ef1 t\u1ea1o css l\u00ean website t\u1eeb \u0111\u1ea7u \u0111\u1ebfn cu\u1ed1i m\u1ea5t r\u1ea5t nhi\u1ec1u th\u1eddi h\u1ea1n v\u00e0 s\u1ee9c l\u1ef1c lao \u0111\u1ed9ng kh\u00f4ng ph\u1ea3i ai c\u0169ng c\u00f3 \u0111\u1ee7 tr\u00ecnh \u0111\u1ed9 l\u00e0m \u0111\u01b0\u1ee3c, css khung r\u1ea5t t\u1ed1t tuy nhi\u00ean n\u00f3 ch\u1ee9a r\u1ea5t nhi\u1ec1u \u0111i\u1ec3m y\u1ebfu k\u00e9m l\u00e0 r\u1ea5t nhi\u1ec1u css th\u1eeba .<\/span>
\ncss th\u1eeba v\u00ec \u0111\u01a1n thu\u1ea7n m\u1ed9t themes t\u1ea1o ra nhi\u1ec1u css \u0111\u1ec3 ph\u00e2n ph\u1ed1i m\u1ecdi nhu y\u1ebfu, nh\u01b0 b\u00e1n h\u00e0ng, blog, forum. ng\u01b0\u1eddi l\u1eadp tr\u00ecnh vi\u00ean c\u00e0ng ph\u00e2n ph\u1ed1i c\u00e0ng nhi\u1ec1u nhu y\u1ebfu th\u00ec themes c\u1ee7a h\u1ecd c\u00e0ng h\u00fat kh\u00e1ch .<\/span>
\nCss th\u1eeba ch\u00fang m\u00ecnh c\u1ea7n ph\u1ea3i c\u1eaft gi\u1ea3m v\u00e0 v\u00f4 hi\u1ec7u ch\u00fang, quy tr\u00ecnh c\u1eaft gi\u1ea3m t\u1ed1n r\u1ea5t nhi\u1ec1u th\u1eddi h\u1ea1n, d\u00f9 ch\u1ec9 l\u00e0 m\u1ed9t \u0111o\u1ea1n css th\u1eeba kh\u00f4ng s\u1eed d\u1ee5ng th\u00ec c\u0169ng l\u00ean v\u00f4 hi\u1ec7u .<\/span>
\nC\u00f4ng th\u1ee9c c\u1eaft gi\u1ea3m css th\u00ec kh\u00f4ng c\u00f3, ch\u1ec9 c\u00f3 l\u00e0 s\u1ef1 c\u1ea7n m\u1eabn mi\u1ec1n m\u00e0i v\u00e0 b\u1ea1n hi\u1ec3u themes \u0111\u00f3 v\u00e0 hi\u1ec7u nhu y\u1ebfu c\u1ee7a b\u1ea1n \u0111\u1ec3 c\u1eaft gi\u1ea3m chu\u1ea9n nh\u1eefng \u0111o\u1ea1n css kh\u00f4ng s\u1eed d\u1ee5ng .<\/span>
\nC\u00f3 nh\u1eefng \u1ee9ng d\u1ee5ng t\u00ecm nh\u1eefng \u0111o\u1ea1n css kh\u00f4ng s\u1eed d\u1ee5ng, nh\u01b0ng m\u00ecnh th\u1ea5y kh\u00f4ng h\u1ec1 hi\u1ec7u su\u1ea5t cao v\u00ec css n\u1ebfu b\u1ea1n x\u1eed d\u1ee5ng \u0111\u1ed3ng th\u1eddi javascript nh\u1eefng t\u00ednh n\u0103ng chuy\u1ec3n c\u1ea3nh nh\u1eefng th\u1ee9 th\u00ec \u1ee9ng d\u1ee5ng c\u00f4ng c\u1ee5 \u0111\u00f3 s\u1ebd kh\u00f4ng ph\u00e1t hi\u1ec7n ra .<\/span>
\nHy v\u1ecdng trong t\u01b0\u01a1ng lai s\u1ebd c\u00f3 nh\u1eefng \u1ee9ng d\u1ee5ng v\u00f4 hi\u1ec7u css kh\u00f4ng s\u1eed d\u1ee5ng th\u1eadt s\u1ef1 t\u1ed1t hi\u1ec7n t\u1ea1i n\u0103m 2020 th\u00ec v\u1eabn ch\u01b0a c\u00f3 .<\/span>
\nC\u00e1ch duy nh\u1ea5t v\u00e0 t\u1ed1t nh\u1ea5t l\u00e0 ch\u1ec9 c\u00f3 l\u00e0m th\u1ee7 c\u00f4ng b\u1eb1ng tay m\u00e0 th\u00f4i .<\/span><\/p>\nS\u1eed d\u1ee5ng t\u1ea1o css quan tr\u1ecdng v\u00e0 t\u1ea3i kh\u00f4ng \u0111\u1ed3ng nh\u1ea5t css<\/span><\/h2>\n
\nTuy nhi\u00ean kh\u00f4ng ph\u1ea3i ai c\u0169ng hi\u1ec7u t\u1ea1o l\u1eadp css quan tr\u1ecdng v\u00e0 t\u1ea3i kh\u00f4ng \u0111\u1ed3ng \u0111i\u1ec7u css r\u1ea5t nhi\u1ec1u ng\u01b0\u1eddi kh\u00f4ng hi\u1ec3u n\u00f3, v\u00e0 c\u1ee9 b\u1eadt b\u1eeba l\u00ean th\u00ec th\u1eadt ch\u1ea5t r\u1eb1ng 90 % l\u00e0 tai h\u1ea1i kh\u00f4ng ph\u1ea3i l\u00e0 t\u00e1c l\u1ee3i, v\u00e0 nh\u01b0 mong mu\u1ed1n th\u00ec kh\u00f4ng b\u1ecb l\u1ed7i th\u01b0\u1eddng th\u00ec s\u1ebd b\u1ecb l\u1ed7i. ( trong th\u1ef1c ti\u1ec5n \u0111\u00e2y l\u00e0 th\u1ee9 m\u1ecdi ng\u01b0\u1eddi ch\u01b0a hi\u1ec7u v\u1ec1 t\u00ednh n\u0103ng n\u00e0y c\u1ee9 b\u1eadt xong l\u1ed7i th\u01b0\u1eddng h\u1eadn th\u00fa nh\u1eefng plugin t\u1ed1i \u01b0u v\u1eadn t\u1ed1c WordPress )<\/span>
\n<\/span>
\nK\u1ef9 thu\u1eadt n\u00e0y b\u1ea1n l\u00e0m kh\u00f4ng chu\u1ea9n th\u00ec r\u1ea5t d\u1ec5 l\u1ed7i FOUC .<\/span>
\nb\u1ea1n ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 t\u00ecm hi\u1ec3u th\u00eam :<\/span><\/p>\n\n
T\u1ea3i c\u00f3 \u0111i\u1ec1u ki\u1ec7n k\u00e8m theo file css<\/span><\/h2>\n
\nV\u00ed d\u1ee5 b\u1ea1n s\u1eed d\u1ee5ng b\u1ea1n c\u00f3 trang website b\u00e1n h\u00e0ng, b\u1ea1n d\u00f9ng plugin t\u1ea1o lo\u1ea1i s\u1ea3n ph\u1ea9m bi\u1ebfn th\u1ec3 n\u1ed5i ti\u1ebfng woo variation swatches tuy nhi\u00ean b\u1ea1n n\u00f3 load css \u1edf kh\u1eafm m\u1ecdi trang b\u1ea1n ph\u1ea3i t\u1ea3i c\u00f3 \u0111i\u1ec1u ki\u1ec7n k\u00e8m theo l\u1ea1i file css. ( ngh\u0129 l\u00e0 ch\u1ec9 \u0111\u01b0\u1ee3c load \u1edf nh\u1eefng trang m\u00e0 n\u00f3 c\u00f3 t\u00e1c d\u00f9ng, c\u00f2n nh\u1eefng trang nh\u1eefng th\u00ec kh\u00f4ng \u0111\u01b0\u1ee3c load )<\/span>
\n\u0111\u00e2y l\u00e0 \u0111o\u1ea1n code v\u00ed d\u1ee5 m\u00ecnh ch\u1ec9 cho load \u1edf nh\u1eefng trang t\u01b0\u01a1ng quan \u0111\u1ebfn trang lo\u1ea1i s\u1ea3n ph\u1ea9m, shop, giao d\u1ecbch thanh to\u00e1n, gi\u1ecf h\u00e0ng. c\u00f2n nh\u1eefng trang nh\u01b0 trang blog tin t\u1ee9c, trang ch\u1ee7 th\u00ec kh\u00f4ng \u0111\u01b0\u1ee3c load .<\/span><\/p>\nadd_action( 'wp_enqueue_scripts', 'wptangtoc_deregister_dieu_kien_woo_variation', 100 );\r\nfunction wptangtoc_deregister_dieu_kien_woo_variation() {\r\nif ( ! class_exists( 'WooCommerce' ) || ( ! is_shop() && ! is_woocommerce() && ! is_cart() && ! is_checkout()) ) {\r\nwp_deregister_style( 'woo-variation-swatches-theme-override' );\r\nwp_deregister_style( 'woo-variation-swatches' );\r\nwp_deregister_style( 'woo-variation-swatches-tooltip' );\r\n}\r\n}\r\n<\/span><\/pre>\n
B\u1ecf tr\u1ecdn v\u1eb9n file css<\/span><\/h2>\n
add_action( 'wp_enqueue_scripts', 'wptangtoc_deregister_xoa_woo_variation', 100 );\r\nfunction wptangtoc_deregister_xoa_woo_variation() {\r\nwp_deregister_style( 'woo-variation-swatches-theme-override' );\r\nwp_deregister_style( 'woo-variation-swatches' );\r\nwp_deregister_style( 'woo-variation-swatches-tooltip' );\r\n}\r\n<\/span><\/pre>\n
\nGhi ch\u00fa : v\u00ed d\u1ee5 th\u00f4i nh\u00e9 ch\u1ee9 th\u1ef1c ti\u1ec5n th\u01b0\u1eddng th\u00ec th\u00ec x\u00f3a css c\u1ee7a plugin woo variation swatches th\u00ec toang \u0111\u00f3 .<\/span>
\nNguy\u00ean t\u1eafc x\u00f3a : b\u1ea1n ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng hook : wp_enqueue_scripts ho\u1eb7c hook : wp_print_styles v\u00e0 h\u00e0m wp_deregister_style \u0111\u1ec3 x\u00f3a file css .<\/span><\/p>\nVi\u1ebft t\u1eaft css<\/span><\/h2>\n
\nthay v\u00ec b\u1ea1n d\u00f9ng {padding-top: 10px; padding-left: 20px; padding-right: 15px; padding-bottom: 30px;}<\/span>
\nV\u00ed d\u1ee5 2: b\u1ea1n d\u00f9ng { border-top: 2px solid #333;}<\/span>
\nthay v\u00ec b\u1ea1n d\u00f9ng { border-top:2px; border-style: solid; border-color:#333;}<\/span>
\nv\u00ed d\u1ee5 3: v\u00ed d\u1ee5: b\u1ea1n d\u00f9ng { margin: 10px 20x 15px 30px;}<\/span>
\nthay v\u00ec b\u1ea1n d\u00f9ng {margin-top: 10px; margin-left: 20px; margin-right: 15px; margin-bottom: 30px;}<\/span>
\nv\u00ed d\u1ee5 4: {color: #fff}<\/span>
\nthay v\u00ec d\u00f9ng { color: #ffffff}<\/span><\/p>\nN\u00e9n css<\/span><\/h2>\n
\nGhi ch\u00fa v\u00e0 kho\u1ea3ng ch\u1eebng tr\u1eafng ch\u1ec9 thi\u1ebft y\u1ebfu cho nh\u1eefng ng\u01b0\u1eddi l\u1eadp tr\u00ecnh vi\u00ean ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 thu\u1eadn ti\u1ec7n ch\u1ec9nh s\u1eeda v\u00e0 thao t\u00e1c v\u1edbi code m\u1ed9t c\u00e1ch thu\u1eadn ti\u1ec7n h\u01a1n .<\/span><\/p>\n.wptangtoc {\r\nmargin:20px;\r\npadding:20px;\r\ncolor:#333333;\r\nbackground:#f7f7f7;\r\n}\r\n.giatuan {\r\nfont-size:32px;\r\ncolor#222222;\r\nmargin-bottom:10px;\r\n}<\/span><\/pre>\n
.wptangtoc{margin:20px;padding:20px;color:#333;background:#f7f7f7}.giatuan{font-size:32px;margin-bottom:10px}<\/span><\/pre>\n
\nV\u00ed d\u1ee5 tr\u00ean ch\u1ec9 l\u00e0 file nh\u1ecf. h\u00ecnh \u1ea3nh d\u01b0\u1edbi m\u00ecnh s\u1ebd test file themes c\u1ee7a m\u00ecnh .<\/span>
\n<\/span>
\n\u0110\u1eb7c bi\u1ec7t b\u1ea1n n\u00e0o file css tr\u00ean 100 kb th\u00ec c\u1ee9 n\u00e9n \u0111i v\u1eadn t\u1ed1c tr\u1edf l\u00ean ti\u00eau bi\u1ec3u v\u01b0\u1ee3t tr\u1ed9i h\u01a1n nhi\u1ec1u .<\/span>
\nNh\u1eefng h\u00ecnh \u1ea3nh tr\u00ean m\u00ecnh s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 n\u00e9n css tr\u1ef1c tuy\u1ebfn l\u00e0 https:\/\/csscompressor.net\/vi\/ b\u1ea1n ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 th\u1ee9 l\u1ea5y file css c\u1ee7a b\u1ea1n ra ki\u1ec3m tra n\u00f3 nh\u01b0 th\u1ebf n\u00e0o .<\/span>
\nN\u1ebfu b\u1ea1n mu\u1ed1n t\u00ecm hi\u1ec3u v\u00e0 kh\u00e1m ph\u00e1 v\u00e0 s\u1eed d\u1ee5ng k\u00edch ho\u1ea1t t\u00ednh n\u0103ng n\u00e0y b\u1ea1n h\u00e3y t\u00ecm hi\u1ec3u th\u00eam b\u00e0i vi\u1ebft : n\u00e9n css<\/span><\/p>\nK\u1ef9 thu\u1eadt s\u1eed d\u1ee5ng css t\u1ed1i \u01b0u<\/span><\/h2>\n
\n\u0111o\u1ea1n css: .giatuan{color:#fff; padding:10px;margin:20px}<\/span>
\nXong s\u1eed d\u1ee5ng css l\u00e0<\/span><\/p>\n<\/pre>\n
\n\u0110o\u1ea1n css :. color_fff { # fff }. pt { padding : 10 px }. mt { margin : 20 px }<\/span><\/p>\n<\/pre>\n
D\u00f9ng class kh\u00f4ng n\u00ean d\u00f9ng style<\/span><\/h2>\n
\nD\u00f9ng Style ch\u1ec9 t\u1ed1t khi b\u1ea1n l\u00e0m trang web \u0111\u00f3 g\u1ea7n nh\u01b0 r\u1ea5t \u00edt ng\u01b0\u1eddi v\u00e0o th\u00ec b\u1ea1n m\u1edbi l\u00e0m m\u1ed9t m\u00ecnh n\u00f3 \u0111\u1ed9c l\u1eadp.( tr\u1ea3 ai mong mu\u1ed1n t\u1ea1o ra trang nh\u01b0 th\u1ebf n\u00e0y c\u1ea3)<\/span><\/p>\n<\/pre>\n
\nc\u00e1ch code ki\u1ec3u style to\u00e0n t\u1eadp n\u00e0y th\u00ec ch\u1ec9 d\u00e0nh cho nh\u1eefng th\u1eddi m\u00e0 css m\u1edbi n\u1ed5i c\u00e1ch \u0111\u00e2y kho\u1ea3n c\u00e1i th\u1eddi www.domain c\u00f2n \u0111ang \u1edf ng\u00f4i \u0111\u1ec9nh \u0111i\u1ec3m t\u1ee9c kho\u1ea3ng ch\u1eebng 10 n\u0103m v\u1ec1 tr\u01b0\u1edbc .<\/span>
\nGi\u1edd c\u00e1ch code ki\u1ec3u style n\u00f3 th\u1ef1c s\u1ef1 l\u00e0 kh\u00f4ng t\u1ed1t .<\/span>
\nH\u00e3y d\u00f9ng ki\u1ec3u code class<\/span>
\nV\u00ed d\u1ee5 : file style.css cho gi\u00e1 tr\u1ecb :. giatuan { padding : 10 px ; color : # fff }<\/span>
\nB\u1ea1n s\u1eed d\u1ee5ng :<\/span><\/p>\n<\/pre>\n
\nStyle thu\u1eadt ng\u1eef chuy\u00ean ng\u00e0nh g\u1ecdi l\u00e0 n\u1ed9i tuy\u1ebfn nh\u1eefng thu\u1ed9c t\u00ednh CSS v\u00e0o trong th\u00e0nh ph\u1ea7n HTML<\/span>
\n<\/span><\/p>\nG\u1ed9p ho\u1eb7c chia nh\u1ecf file css<\/span><\/h2>\n
\nG\u1ed9p css c\u00f3 n\u00ean s\u1eed d\u1ee5ng cho WordPress<\/span>
\nN\u1ebfu website c\u1ee7a b\u1ea1n kh\u00f4ng t\u01b0\u01a1ng h\u1ed7 giao th\u1ee9c http \/ 2 tr\u1edf l\u00ean th\u00ec h\u00e3y g\u1ed9p to\u00e0n b\u1ed9 nh\u1eefng file css v\u00e0o l\u00e0m 1<\/span>
\nth\u00ec v\u1eadn t\u1ed1c s\u1ebd t\u1ed1t h\u01a1n .<\/span>
\n<\/span>
\ntrong tr\u01b0\u1eddng h\u1ee3p website c\u1ee7a b\u1ea1n t\u01b0\u01a1ng h\u1ed7 giao th\u1ee9c http \/ 2 tr\u1edf l\u00ean ( http \/ 2 ho\u1eb7c http \/ 3 – quic )<\/span>
\nTh\u00ec h\u00e3y san s\u1ebb n\u00f3 ra l\u00e0m nhi\u1ec1u ph\u1ea7n \u0111\u1ec1u nhau, m\u1ed7i c\u00e1i kh\u00f4ng qu\u00e1 60 kb css l\u00e0 t\u1ed1t nh\u1ea5t .<\/span>
\nHi\u1ec3u \u0111\u01a1n thu\u1ea7n giao th\u1ee9c http \/ 2 tr\u1edf l\u00ean t\u01b0\u01a1ng h\u1ed7 \u0111\u00e3 lu\u00f4ng ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 l\u00e0m nhi\u1ec1u vi\u1ec7c \u0111\u01b0\u1ee3c m\u1ed9t l\u00fac .<\/span>
\n<\/span><\/p>\n
\nC\u00f3 2 l\u1ef1a ch\u1ecdn kh\u00e1ch h\u00e0ng:<\/span><\/p>\n
\nB\u1ea1n ch\u1ec9 ph\u1ee5c v\u1ee5 \u0111\u01b0\u1ee3c 1 ng\u01b0\u1eddi t\u1ea1i m\u1ed9t th\u1eddi \u0111i\u1ec3m lo\u1ea1i b\u1ecf nh\u1eefng kh\u00e1ch h\u00e0ng nh\u1ecf l\u1ef1a ch\u1ecdn t\u1eadp trung v\u00e0o kh\u00e1ch h\u00e0ng l\u1edbn s\u1ebd t\u1ed1i \u01b0u h\u01a1n.<\/span><\/p>\n
\nb\u1ea1n ph\u1ee5c v\u1ee5 \u0111\u01b0\u1ee3c t\u1ea5t 120.000 VN\u0110 l\u1edbn h\u01a1n 100.000 VN\u0110 b\u1ea1n ch\u1ecdn 120.000 VN\u0110 n\u00f3 nhi\u1ec1u h\u01a1n 20.000 VN\u0110<\/span><\/p>\nGi\u1ea3m thi\u1ec3u ch\u1ed3ng ch\u00e9o css<\/span><\/h2>\n
.giatuan{\r\n color:blue;\r\n}\r\n.giatuan{\r\n color:red;\r\n background-color:#eee;\r\n}<\/span><\/pre>\n
Ch\u00e0o m\u1eebng nh\u1eefng b\u1ea1n \u0111\u1ebfn v\u1edbi WP T\u0103ng T\u1ed1c<\/span><\/pre>\n
\nCh\u00e0o m\u1eebng nh\u1eefng b\u1ea1n \u0111\u1ebfn v\u1edbi WP T\u0103ng T\u1ed1c<\/span>
\nHi\u1ec3u theo nguy\u00ean t\u1eafc : n\u00f3 y\u00eau ti\u00ean t\u1eeb d\u01b0\u1edbi l\u00ean tr\u00ean v\u00e0 t\u1eeb ph\u1ea3i qua tr\u00e1i .<\/span><\/p>\n
\nKhi t\u1ed1i \u01b0u v\u1eadn t\u1ed1c load website b\u1ea1n c\u1ea7n t\u00ecm ra nh\u1eefng \u0111o\u1ea1n css ch\u1ed3ng ch\u00e9o \u0111\u1ec3 x\u00f3a \u0111i, v\u00ed d\u1ecb tr\u00ean b\u1ea1n ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 x\u00f3a \u0111i. giatuan { color : blue ; } \u0111\u1ec3 cho website c\u1ee7a b\u1ea1n nh\u1eb9 h\u01a1n m\u00e0 kh\u00f4ng t\u00e1c \u0111\u1ed9ng \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn c\u00f4ng d\u1ee5ng giao di\u1ec7n. ( c\u00f3 m\u1ed9t s\u1ed1 \u00edt tr\u01b0\u1eddng h\u1ee3p tr\u1ed3n ch\u00e9o l\u00e0 do javascript c\u1ed1 \u00fd r\u1ea5t kh\u00f3 \u0111\u1ec3 x\u00f3a n\u1ebfu x\u00f3a r\u1ea5t d\u1ec5 l\u1ed7i b\u1ea1n c\u1ea7n ph\u1ea3i xem x\u00e9t tr\u01b0\u1edbc khi x\u00f3a ) .<\/span><\/p>\n\n
\nNg\u00f4n ng\u1eef l\u1eadp tr\u00ecnh css l\u00e0 ng\u00f4n t\u1eeb m\u00ecnh y\u00eau th\u00edch nh\u1ea5t, trong quy t\u1eafc quan tr\u1ecdng trong t\u1ed1i \u01b0u v\u1eadn t\u1ed1c load website th\u00ec h\u00e3y n\u1ed7 l\u1ef1c chuy\u1ec3n javascript hay \u1ea3nh th\u00e0nh css n\u1ebfu ho\u00e0n to\u00e0n c\u00f3 th\u1ec3 .<\/span><\/p>\n
\nCategory: SEO Website<\/a><\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"