{"id":444,"date":"2016-09-30T07:15:06","date_gmt":"2016-09-30T06:15:06","guid":{"rendered":"http:\/\/www.yellowweb.id\/blog\/?p=444"},"modified":"2016-09-30T07:18:11","modified_gmt":"2016-09-30T06:18:11","slug":"css-position","status":"publish","type":"post","link":"https:\/\/www.yellowweb.id\/blog\/css-position\/","title":{"rendered":"CSS Position"},"content":{"rendered":"<p>Untuk artikel kali ini kita akan mencoba mencari tahu apa perbedaan position yang ada pada properti CSS. Mulai dari CSS <code><strong><span style=\"color: #ff0000;\">position static, relative, absolute, fixed.<\/span><\/strong><\/code><\/p>\n<p><!--more--><\/p>\n<p><span style=\"color: #008000;\"><strong>position:static<\/strong><\/span><\/p>\n<p>Pada posisi ini, sebenarnya ini adalah <code><strong><span style=\"color: #ff0000;\">posisi default (statis)<\/span><\/strong><\/code> suatu elemen hampir tidak ada perbedaan sama sekali.<\/p>\n<p><span style=\"color: #008000;\"><strong>position:relative<\/strong><\/span><\/p>\n<p>Pada posisi ini kita bisa memanfaatkan properti <code><span style=\"color: #ff0000;\"><strong>top<\/strong><\/span><\/code> dan <code><span style=\"color: #ff0000;\"><strong>left<\/strong><\/span><\/code>. Objek akan berubah terhadap elemen utama dan juga relatif terhadap dirinya.<\/p>\n<p><span style=\"color: #008000;\"><strong>position:absolute<\/strong><\/span><\/p>\n<p><strong><code><span style=\"color: #ff0000;\">position absolute<\/span> <\/code><\/strong>pada css, misalnya kita menerapkan objek memiliki position absolute, maka objek tersebut akan mengikuti induk elemen (parent), dengan catatan induk elemen menggunakan <strong><span style=\"color: #ff0000;\"><code>position relative<\/code><\/span><\/strong>.<\/p>\n<p><span style=\"color: #008000;\"><strong>position:fixed<\/strong><\/span><\/p>\n<p>Pada <code><span style=\"color: #ff0000;\"><strong>position:fixed<\/strong> <\/span><\/code>ini posisi elemen akan tetap atau akan selalu pada posisinya (diam), meskipun browser di scroll.<\/p>\n<p>Live source<\/p>\n<pre class=\"lang:default decode:true \">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n\t&lt;title&gt;CSS Position&lt;\/title&gt;\r\n\t&lt;style&gt;\r\n\t\t\/* CSS Reset *\/\r\n\t\t*{\r\n\t\t\tpadding: 0;\r\n\t\t\tmargin: 0px;\r\n\t\t}\t\r\n\r\n\t\t#wrapper{\r\n\t\t\tmargin: auto;\r\n\t\t\twidth: 800px;\r\n\t\t\theight: 900px;\r\n\t\t\tbackground-color: #7ACCE8;\r\n\t\t}\r\n\r\n\t\t#box1{\r\n\t\t\tbackground-color: #2DDA47;\r\n\t\t\theight: 100px;\r\n\t\t\twidth: 200px;\r\n\t\t}\r\n\r\n\t\t#box2{\r\n\t\t\tbackground-color: #C4E51F;\r\n\t\t\theight: 100px;\r\n\t\t\twidth: 200px;\r\n\t\t\tposition: relative;\r\n\t\t\ttop: 20px;\r\n\t\t\tleft: 50px;\r\n\t\t}\r\n\r\n\t\t#box3{\r\n\t\t\tbackground-color: #E71B1B;\r\n\t\t\theight: 100px;\r\n\t\t\twidth: 200px;\r\n\t\t\tposition: absolute;\r\n\t\t\ttop: 1px;\r\n\t\t\tleft: 1px;\r\n\t\t}\r\n\r\n\t\t#box4{\r\n\t\t\tbackground-color: #EC1CD0;\r\n\t\t\theight: 100px;\r\n\t\t\twidth: 200px;\r\n\t\t\tposition: fixed;\r\n\t\t}\r\n\r\n\t&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\t&lt;div id=\"wrapper\"&gt;\r\n\t\t&lt;div id=\"box1\"&gt;\r\n\t\t\t&lt;h3&gt;posisi statis&lt;\/h3&gt;\r\n\t\t&lt;\/div&gt;\r\n\t\t&lt;div id=\"box2\"&gt;\r\n\t\t\t&lt;h3&gt;posisi relative&lt;\/h3&gt;\r\n\t\t&lt;\/div&gt;\r\n\t\t&lt;div id=\"box3\"&gt;\r\n\t\t\t&lt;h3&gt;posisi absolute&lt;\/h3&gt;\r\n\t\t&lt;\/div&gt;\r\n\t\t&lt;div id=\"box4\"&gt;\r\n\t\t\t&lt;h3&gt;posisi fixed&lt;\/h3&gt;\r\n\t\t&lt;\/div&gt;\r\n\t&lt;\/div&gt;&lt;!-- end of wrapper --&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>Semoga artikel yang singkat ini dapat membantu teman-teman dalam memahami <strong><span style=\"color: #ff0000;\"><code>CSS Property Position<\/code><\/span><\/strong> dan <code><span style=\"color: #ff0000;\"><strong>Valuenya<\/strong><\/span><\/code>. Sampai jumpa pada artikel berikutnya.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Untuk artikel kali ini kita akan mencoba mencari tahu apa perbedaan position yang ada pada properti CSS. Mulai dari CSS position static, relative, absolute, fixed.<\/p>\n","protected":false},"author":1,"featured_media":447,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37,11],"tags":[8,22,135,13,254,252,253,31],"class_list":["post-444","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css","category-tutorial","tag-css","tag-css3","tag-design","tag-html","tag-html-5","tag-property","tag-value","tag-web-desain"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>CSS Position - YELLOWWEB.ID<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.yellowweb.id\/blog\/css-position\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CSS Position - YELLOWWEB.ID\" \/>\n<meta property=\"og:description\" content=\"Untuk artikel kali ini kita akan mencoba mencari tahu apa perbedaan position yang ada pada properti CSS. Mulai dari CSS position static, relative, absolute, fixed.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.yellowweb.id\/blog\/css-position\/\" \/>\n<meta property=\"og:site_name\" content=\"YELLOWWEB.ID\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-30T06:15:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-09-30T06:18:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.yellowweb.id\/blog\/wp-content\/uploads\/2016\/09\/position-css-3.jpg?fit=780%2C364&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"780\" \/>\n\t<meta property=\"og:image:height\" content=\"364\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"yellowweb\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"yellowweb\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/css-position\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/css-position\\\/\"},\"author\":{\"name\":\"yellowweb\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#\\\/schema\\\/person\\\/75188044e080844724e381ab6a5b9829\"},\"headline\":\"CSS Position\",\"datePublished\":\"2016-09-30T06:15:06+00:00\",\"dateModified\":\"2016-09-30T06:18:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/css-position\\\/\"},\"wordCount\":120,\"image\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/css-position\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/position-css-3.jpg\",\"keywords\":[\"css\",\"css3\",\"design\",\"html\",\"html 5\",\"property\",\"value\",\"web desain\"],\"articleSection\":[\"CSS\",\"Tutorial\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/css-position\\\/\",\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/css-position\\\/\",\"name\":\"CSS Position - YELLOWWEB.ID\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/css-position\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/css-position\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/position-css-3.jpg\",\"datePublished\":\"2016-09-30T06:15:06+00:00\",\"dateModified\":\"2016-09-30T06:18:11+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#\\\/schema\\\/person\\\/75188044e080844724e381ab6a5b9829\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/css-position\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/css-position\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/css-position\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/position-css-3.jpg\",\"contentUrl\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/position-css-3.jpg\",\"width\":780,\"height\":364,\"caption\":\"position-css-3\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/css-position\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS Position\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/\",\"name\":\"YELLOWWEB.ID\",\"description\":\"Kursus Web Design | Kursus Web Programming | Mobile Web Apps | Digital Marketing\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#\\\/schema\\\/person\\\/75188044e080844724e381ab6a5b9829\",\"name\":\"yellowweb\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g\",\"caption\":\"yellowweb\"},\"sameAs\":[\"https:\\\/\\\/www.yellowweb.id\"],\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/author\\\/yellowweb\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CSS Position - YELLOWWEB.ID","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:\/\/www.yellowweb.id\/blog\/css-position\/","og_locale":"en_GB","og_type":"article","og_title":"CSS Position - YELLOWWEB.ID","og_description":"Untuk artikel kali ini kita akan mencoba mencari tahu apa perbedaan position yang ada pada properti CSS. Mulai dari CSS position static, relative, absolute, fixed.","og_url":"https:\/\/www.yellowweb.id\/blog\/css-position\/","og_site_name":"YELLOWWEB.ID","article_published_time":"2016-09-30T06:15:06+00:00","article_modified_time":"2016-09-30T06:18:11+00:00","og_image":[{"width":780,"height":364,"url":"https:\/\/i0.wp.com\/www.yellowweb.id\/blog\/wp-content\/uploads\/2016\/09\/position-css-3.jpg?fit=780%2C364&ssl=1","type":"image\/jpeg"}],"author":"yellowweb","twitter_card":"summary_large_image","twitter_misc":{"Written by":"yellowweb","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.yellowweb.id\/blog\/css-position\/#article","isPartOf":{"@id":"https:\/\/www.yellowweb.id\/blog\/css-position\/"},"author":{"name":"yellowweb","@id":"https:\/\/www.yellowweb.id\/blog\/#\/schema\/person\/75188044e080844724e381ab6a5b9829"},"headline":"CSS Position","datePublished":"2016-09-30T06:15:06+00:00","dateModified":"2016-09-30T06:18:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.yellowweb.id\/blog\/css-position\/"},"wordCount":120,"image":{"@id":"https:\/\/www.yellowweb.id\/blog\/css-position\/#primaryimage"},"thumbnailUrl":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2016\/09\/position-css-3.jpg","keywords":["css","css3","design","html","html 5","property","value","web desain"],"articleSection":["CSS","Tutorial"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/www.yellowweb.id\/blog\/css-position\/","url":"https:\/\/www.yellowweb.id\/blog\/css-position\/","name":"CSS Position - YELLOWWEB.ID","isPartOf":{"@id":"https:\/\/www.yellowweb.id\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.yellowweb.id\/blog\/css-position\/#primaryimage"},"image":{"@id":"https:\/\/www.yellowweb.id\/blog\/css-position\/#primaryimage"},"thumbnailUrl":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2016\/09\/position-css-3.jpg","datePublished":"2016-09-30T06:15:06+00:00","dateModified":"2016-09-30T06:18:11+00:00","author":{"@id":"https:\/\/www.yellowweb.id\/blog\/#\/schema\/person\/75188044e080844724e381ab6a5b9829"},"breadcrumb":{"@id":"https:\/\/www.yellowweb.id\/blog\/css-position\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.yellowweb.id\/blog\/css-position\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.yellowweb.id\/blog\/css-position\/#primaryimage","url":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2016\/09\/position-css-3.jpg","contentUrl":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2016\/09\/position-css-3.jpg","width":780,"height":364,"caption":"position-css-3"},{"@type":"BreadcrumbList","@id":"https:\/\/www.yellowweb.id\/blog\/css-position\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.yellowweb.id\/blog\/"},{"@type":"ListItem","position":2,"name":"CSS Position"}]},{"@type":"WebSite","@id":"https:\/\/www.yellowweb.id\/blog\/#website","url":"https:\/\/www.yellowweb.id\/blog\/","name":"YELLOWWEB.ID","description":"Kursus Web Design | Kursus Web Programming | Mobile Web Apps | Digital Marketing","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.yellowweb.id\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.yellowweb.id\/blog\/#\/schema\/person\/75188044e080844724e381ab6a5b9829","name":"yellowweb","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g","caption":"yellowweb"},"sameAs":["https:\/\/www.yellowweb.id"],"url":"https:\/\/www.yellowweb.id\/blog\/author\/yellowweb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts\/444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/comments?post=444"}],"version-history":[{"count":2,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts\/444\/revisions"}],"predecessor-version":[{"id":446,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts\/444\/revisions\/446"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/media\/447"}],"wp:attachment":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/media?parent=444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/categories?post=444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/tags?post=444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}