\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 t\u01b0<\/div>\n<\/div>\n\n\n\n
Code m\u1eabu:<\/p>\n\n\n\n
div {\nposition: static;\nborder: 1px solid red; \nmargin: 10px 0px 10px 0px; \npadding: 10px; \n}<\/code><\/pre>\n\n\n\nTrong c\u00e1c v\u00ed d\u1ee5 ti\u1ebfp theo, t\u00f4i s\u1ebd l\u1ea5y\u00a0h\u1ed9p th\u1ee9 ba<\/strong>\u00a0\u0111\u1ec3 \u0111i\u1ec1u ch\u1ec9nh position c\u1ee7a n\u00f3.<\/p>\n\n\n\n \n\n\n\n<\/span>\u0110\u1ecbnh v\u1ecb relative<\/span><\/h2>\n\n\n\nKhi s\u1eed d\u1ee5ng relative, n\u00f3 s\u1ebd l\u1ea5y \u0111i\u1ec3m m\u1ed1c c\u1ee7a h\u1ed9p l\u00e0 th\u1ebb li\u1ec1n k\u1ec1 nh\u1ea5t v\u1edbi n\u00f3, bao g\u1ed3m c\u00e1c th\u1ebb b\u00ean tr\u00ean, b\u00ean d\u01b0\u1edbi v\u00e0 bao quanh:<\/p>\n\n\n\n
\n
\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 nh\u1ea5t<\/div>\n
\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 hai<\/div>\n
\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 ba<\/div>\n
\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 t\u01b0<\/div>\n<\/div>\n\n\n\n
Code m\u1eabu:<\/p>\n\n\n\n
div {\nposition: relative;\ntop: 15px;\nleft: 15px;\nborder: 1px solid red; \nmargin: 10px 0px 10px 0px; \npadding: 10px; \n}<\/code><\/pre>\n\n\n\n\u0110\u1ecbnh v\u1ecb\u00a0relative<\/em>\u00a0th\u01b0\u1eddng \u0111i k\u00e8m v\u1edbi\u00a0top<\/em>\u00a0v\u00e0\u00a0left, right, bottom<\/em>\u00a0\u0111\u1ec3 l\u1ea5y v\u1ecb tr\u00ed. B\u1ea1n c\u00f3 th\u1ec3 th\u1ea5y relative v\u1eabn c\u00f2n n\u1eb1m trong lu\u1ed3ng c\u1ee7a trang t\u1ee9c l\u00e0 v\u1eabn c\u00f2n li\u00ean quan \u0111\u1ebfn th\u1ebb \u0111\u1ee9ng tr\u01b0\u1edbc n\u00f3.<\/p>\n\n\n\n \n\n\n\n<\/span>\u0110\u1ecbnh v\u1ecb absolute<\/span><\/h2>\n\n\n\nTheo m\u1eb7c \u0111\u1ecbnh, \u0111\u1ecbnh v\u1ecb absolute s\u1ebd l\u1ea5y\u00a0th\u1ebb body<\/em>\u00a0l\u00e0m m\u1ed1c (\u0111i\u1ec3m tr\u00ean c\u00f9ng b\u00ean tr\u00e1i) \u2013 n\u1ebfu t\u00f4i bao b\u1ed1n h\u1ed9p n\u00e0y b\u1eb1ng m\u1ed9t h\u1ed9p cha l\u1edbn \u2013 v\u00e0 \u0111\u1ec3 h\u1ed9p cha l\u1edbn l\u00e0\u00a0relative<\/em>\u00a0th\u00ec h\u1ed9p th\u1ee9 ba v\u1edbi \u0111\u1ecbnh v\u1ecb\u00a0absolute<\/em>\u00a0s\u1ebd l\u1ea5y m\u1ed1c l\u00e0 h\u1ed9p cha l\u1edbn ch\u1ee9 kh\u00f4ng ph\u1ea3i l\u00e0 body n\u1eefa. V\u00ed d\u1ee5:<\/p>\n\n\n\n\n
\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 nh\u1ea5t<\/div>\n
\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 hai<\/div>\n
\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 ba<\/div>\n
\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 t\u01b0<\/div>\n<\/div>\n\n\n\n
Code m\u1eabu:<\/p>\n\n\n\n
div { \nposition: absolute;\ntop: 15px; \nleft: 15px; \nborder: 1px solid red; \nmargin: 10px 0px 10px 0px; \npadding: 10px; \n}<\/code><\/pre>\n\n\n\n\u0110i\u1ec3m m\u1ea5u ch\u1ed1t c\u1ea7n nh\u1edb l\u00e0 \u0111\u1ecbnh v\u1ecb absolute l\u00e0m cho h\u1ed9p kh\u00f4ng c\u00f2n li\u00ean quan \u0111\u1ebfn c\u00e1c h\u1ed9p b\u00ean c\u1ea1nh n\u1eefa m\u00e0 l\u1ea1i l\u1ea5y \u0111\u1ecbnh v\u1ecb l\u00e0 th\u1ebb body (theo m\u1eb7c \u0111\u1ecbnh) ho\u1eb7c th\u1ebb cha (n\u1ebfu \u0111\u1ec3 th\u1ebb cha l\u00e0 relative)<\/p>\n\n\n\n
\n\n\n\n<\/span>\u0110\u1ecbnh v\u1ecb fixed<\/span><\/h2>\n\n\n\nV\u1ec1 c\u01a1 b\u1ea3n fixed c\u0169ng gi\u1ed1ng v\u1edbi absolute, ch\u1ec9 kh\u00e1c l\u00e0 n\u1ebfu absolute l\u1ea5y m\u1ed1c l\u00e0 th\u1ebb body ho\u1eb7c th\u1ebb cha th\u00ec fixed l\u1ea1i l\u1ea5y m\u1ed1c l\u00e0 tr\u00ecnh duy\u1ec7t web. C\u00e1c n\u00fat like, share tr\u01b0\u1ee3t d\u1ecdc ho\u1eb7c top menu lu\u00f4n lu\u00f4n \u1edf tr\u00ean \u0111\u1ea7u trang web s\u1eed d\u1ee5ng fixed \u0111\u1ec3 c\u1ed1 \u0111\u1ecbnh. D\u00f9 b\u1ea1n cu\u1ed9n l\u00ean cu\u1ed9n xu\u1ed1ng \u0111\u1ec3 xem web, b\u1ea1n v\u1eabn th\u1ea5y ch\u00fang \u1edf c\u00f9ng v\u1ecb tr\u00ed\u2026.B\u1ea1n li\u1ebfc sang g\u00f3c tr\u00e1i ph\u00eda tr\u00ean c\u00f9ng \u0111i, s\u1ebd th\u1ea5y c\u00e1i h\u1ed9p th\u1ee9 ba \u0111ang \u1edf \u0111\u00e2y, cu\u1ed9n thanh tr\u01b0\u1ee3t d\u1ecdc xem, n\u00f3 s\u1ebd di chuy\u1ec3n theo b\u1ea1n.<\/p>\n\n\n\n
\n
\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 nh\u1ea5t<\/div>\n
\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 hai<\/div>\n
\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 ba \u2013 position: fixed<\/div>\n
\u0110\u00e2y l\u00e0 h\u1ed9p th\u1ee9 t\u01b0<\/div>\n<\/div>\n\n\n\n
Code m\u1eabu:<\/p>\n\n\n\n
div { \nposition: fixed; \nleft: 0%; \ntop: 0%; \nborder: 1px solid red; \npadding: 10px;\n}<\/code><\/pre>\n\n\n\nNh\u01b0 v\u1eady v\u1edbi relative, h\u1ed9p v\u1eabn c\u00f2n trong lu\u1ed3ng c\u1ee7a trang, nh\u01b0ng v\u1edbi absolute v\u00e0 fixed, h\u1ed9p tho\u00e1t kh\u1ecfi lu\u1ed3ng c\u1ee7a trang v\u00e0 l\u1ea5y m\u1ed1c \u0111\u1ecbnh v\u1ecb kh\u00e1c h\u1eb3n.<\/p>\n","protected":false},"excerpt":{"rendered":"
Thu\u1ed9c t\u00ednh position\u00a0d\u00f9ng \u0111\u1ec3 l\u1ea5y \u0111i\u1ec3m m\u1ed1c tham chi\u1ebfu cho vi\u1ec7c x\u00e1c \u0111\u1ecbnh v\u1ecb tr\u00ed c\u1ee7a h\u1ed9p th\u1ebb. C\u00f3 th\u1ec3 b\u1ea1n quen v\u1edbi vi\u1ec7c d\u00f9ng\u00a0float\u00a0\u0111\u1ec3 t\u1ea1o b\u1ed1 c\u1ee5c nh\u01b0ng kh\u00f4ng th\u00e0nh th\u1ea1o position l\u00e0 thi\u1ec7t th\u00f2i l\u1edbn, v\u00ec \u00edt nh\u1ea5t\u00a0menu x\u1ed5, popup xu\u1ea5t hi\u1ec7n khi hover, ho\u1eb7c menu c\u1ed1 \u0111\u1ecbnh \u0111\u1ec1u c\u1ea7n \u0111\u1ebfn position. Ch\u00fang …<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[229],"tags":[],"yoast_head":"\n
Thu\u1ed9c t\u00ednh position trong CSS • Ki\u1ebfn c\u00e0ng<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n","yoast_head_json":{"title":"Thu\u1ed9c t\u00ednh position trong CSS • Ki\u1ebfn c\u00e0ng","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kiencang.net\/thuoc-tinh-position-trong-css\/","og_locale":"vi_VN","og_type":"article","og_title":"Thu\u1ed9c t\u00ednh position trong CSS • Ki\u1ebfn c\u00e0ng","og_description":"Thu\u1ed9c t\u00ednh position\u00a0d\u00f9ng \u0111\u1ec3 l\u1ea5y \u0111i\u1ec3m m\u1ed1c tham chi\u1ebfu cho vi\u1ec7c x\u00e1c \u0111\u1ecbnh v\u1ecb tr\u00ed c\u1ee7a h\u1ed9p th\u1ebb. C\u00f3 th\u1ec3 b\u1ea1n quen v\u1edbi vi\u1ec7c d\u00f9ng\u00a0float\u00a0\u0111\u1ec3 t\u1ea1o b\u1ed1 c\u1ee5c nh\u01b0ng kh\u00f4ng th\u00e0nh th\u1ea1o position l\u00e0 thi\u1ec7t th\u00f2i l\u1edbn, v\u00ec \u00edt nh\u1ea5t\u00a0menu x\u1ed5, popup xu\u1ea5t hi\u1ec7n khi hover, ho\u1eb7c menu c\u1ed1 \u0111\u1ecbnh \u0111\u1ec1u c\u1ea7n \u0111\u1ebfn position. Ch\u00fang …","og_url":"https:\/\/kiencang.net\/thuoc-tinh-position-trong-css\/","og_site_name":"Ki\u1ebfn c\u00e0ng","article_author":"https:\/\/www.facebook.com\/anhducnguyen87\/","article_published_time":"2013-11-03T16:24:00+00:00","author":"Nguy\u1ec5n \u0110\u1ee9c Anh","twitter_card":"summary_large_image","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"Nguy\u1ec5n \u0110\u1ee9c Anh","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"3 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/kiencang.net\/thuoc-tinh-position-trong-css\/","url":"https:\/\/kiencang.net\/thuoc-tinh-position-trong-css\/","name":"Thu\u1ed9c t\u00ednh position trong CSS • Ki\u1ebfn c\u00e0ng","isPartOf":{"@id":"https:\/\/kiencang.net\/#website"},"datePublished":"2013-11-03T16:24:00+00:00","dateModified":"2013-11-03T16:24:00+00:00","author":{"@id":"https:\/\/kiencang.net\/#\/schema\/person\/5e7e1a04d8d1218ad8c421ba43d25c16"},"breadcrumb":{"@id":"https:\/\/kiencang.net\/thuoc-tinh-position-trong-css\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kiencang.net\/thuoc-tinh-position-trong-css\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kiencang.net\/thuoc-tinh-position-trong-css\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kiencang.net\/"},{"@type":"ListItem","position":2,"name":"Thu\u1ed9c t\u00ednh position trong CSS"}]},{"@type":"WebSite","@id":"https:\/\/kiencang.net\/#website","url":"https:\/\/kiencang.net\/","name":"Ki\u1ebfn c\u00e0ng","description":"\u00d4m l\u00fd thuy\u1ebft, h\u00f4n th\u1ef1c h\u00e0nh","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kiencang.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"vi"},{"@type":"Person","@id":"https:\/\/kiencang.net\/#\/schema\/person\/5e7e1a04d8d1218ad8c421ba43d25c16","name":"Nguy\u1ec5n \u0110\u1ee9c Anh","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/kiencang.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6d71f9b89393952a8382e30dad26c1ec?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6d71f9b89393952a8382e30dad26c1ec?s=96&d=monsterid&r=g","caption":"Nguy\u1ec5n \u0110\u1ee9c Anh"},"description":"Sinh n\u0103m 1987, t\u1ed1t nghi\u1ec7p Cao \u0111\u1eb3ng th\u1ef1c h\u00e0nh FPT qu\u00e3ng 2014, chuy\u00ean ng\u00e0nh Thi\u1ebft k\u1ebf website. T\u00f4i th\u00edch Content, SEO, Ads, T\u0103ng t\u1ed1c website v\u00e0 Th\u01b0\u01a1ng m\u1ea1i \u0111i\u1ec7n t\u1eed. B\u00ean c\u1ea1nh b\u00e0i t\u1ef1 vi\u1ebft, t\u00f4i c\u0169ng d\u1ecbch nhi\u1ec1u n\u1ed9i dung th\u00fa v\u1ecb c\u1ee7a c\u00e1c t\u00e1c gi\u1ea3 kh\u00e1c nhau. FB c\u00e1 nh\u00e2n: facebook.com\/anhducnguyen87. Email li\u00ean h\u1ec7: guiemailchotoi@gmail.com","sameAs":["https:\/\/www.facebook.com\/anhducnguyen87\/"],"url":"https:\/\/kiencang.net\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/posts\/20224"}],"collection":[{"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/comments?post=20224"}],"version-history":[{"count":0,"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/posts\/20224\/revisions"}],"wp:attachment":[{"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/media?parent=20224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/categories?post=20224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kiencang.net\/wp-json\/wp\/v2\/tags?post=20224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}