{"id":207,"date":"2009-01-22T12:34:08","date_gmt":"2009-01-22T14:34:08","guid":{"rendered":"https:\/\/www.kadunew.com\/blog\/?p=207"},"modified":"2009-01-22T12:44:53","modified_gmt":"2009-01-22T14:44:53","slug":"posicionamento-relativo-absoluto-static-e-fixed-em-css","status":"publish","type":"post","link":"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css","title":{"rendered":"Posicionamento relativo, absoluto, static e fixed em CSS"},"content":{"rendered":"<h3>Posicionamento relativo:<\/h3>\n<p>Ao declararmos <em>position:relative<\/em> sozinha n\u00e3o causa nenhum efeito no posicionamento. Se usarmos ela em conjunto com as propriedades <em>top<\/em>, <em>right<\/em>, <em>bottom<\/em> e <em>left<\/em>, movimenta o bloco de sua posi\u00e7\u00e3o inicial para uma posi\u00e7\u00e3o conforme declarado nas propriedades citadas.<br \/>\nO bloco sai de sua posi\u00e7\u00e3o original e o espa\u00e7o que ela ocupava \u00e9 preservado.<br \/>\n<strong>Veja o exemplo:<\/strong><br \/>\n<strong>CSS<\/strong><\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">div#dois {\r\n\tbackground: #009900;\r\n\tposition: relative;\r\n\tleft: 60px;\r\n\ttop: 35px;\r\n\t}\r\n<\/pre>\n<p><!--more Continuar lendo...--><br \/>\n<strong>Resultado final<\/strong><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_relativo_css.gif\" alt=\"exemplo de posicionamento relativo em css\" title=\"exemplo de posicionamento relativo em css\" width=\"429\" height=\"351\" class=\"aligncenter size-full wp-image-208\" srcset=\"https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_relativo_css.gif 429w, https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_relativo_css-300x245.gif 300w\" sizes=\"(max-width: 429px) 100vw, 429px\" \/><\/p>\n<h3>Posicionamento absoluto:<\/h3>\n<p>Para declararmos um bloco com posicionamento absoluto usamos a propriedade <em>position:absolute<\/em>. Um bloco com posicionamento absoluto retira o elemento da posi\u00e7\u00e3o original, fazendo com que o lugar deixado seja ocupado pelo elemento que se segue.<br \/>\n<strong>Veja o exemplo:<\/strong><\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\r\nDiv#dois {\r\n\tbackground: #009900;\r\n\tposition: absolute;\r\n\tleft: 60px;\r\n\ttop: 35px;\r\n\t}\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_absoluto_css.gif\" alt=\"posicionamento absoluto em css\" title=\"posicionamento absoluto em css\" width=\"429\" height=\"351\" class=\"aligncenter size-full wp-image-209\" srcset=\"https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_absoluto_css.gif 429w, https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_absoluto_css-300x245.gif 300w\" sizes=\"(max-width: 429px) 100vw, 429px\" \/><br \/>\nVeja que a DIV 3 ocupou o espa\u00e7o deixado pela DIV 2<\/p>\n<h3>Posicionamento est\u00e1tico:<\/h3>\n<p>O valor <em>static<\/em> usado em <em>position<\/em> \u00e9 o valor padr\u00e3o de posicionamento. Os blocos ficam onde est\u00e3o. O uso dessa declara\u00e7\u00e3o \u00e9 para sobrescrever um posicionamento declarando anteriormente.<\/p>\n<h3>Posicionamento fixo:<\/h3>\n<p>O valor <em>fixed<\/em> usado em <em>position<\/em> deixa o bloco posicionado de maneira fixa em rela\u00e7\u00e3o a uma refer\u00eancia. O contexto de posicionamento \u00e9 sempre a \u00e1rea de renderiza\u00e7\u00e3o, exemplo, canto superior esquerdo da tela do navegador. O bloco com esse valor n\u00e3o se movimenta quando h\u00e1 rolagem na p\u00e1gina. O IE6 n\u00e3o suporta essa declara\u00e7\u00e3o.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Posicionamento relativo: Ao declararmos position:relative sozinha n\u00e3o causa nenhum efeito no posicionamento. Se usarmos ela em conjunto com as propriedades top, right, bottom e left, movimenta o bloco de sua posi\u00e7\u00e3o inicial para uma posi\u00e7\u00e3o conforme declarado nas propriedades citadas. O bloco sai de sua posi\u00e7\u00e3o original e o espa\u00e7o que ela ocupava \u00e9 preservado. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[45],"class_list":["post-207","post","type-post","status-publish","format-standard","hentry","category-css","tag-css"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Posicionamento relativo, absoluto, static e fixed em CSS<\/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.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Posicionamento relativo, absoluto, static e fixed em CSS\" \/>\n<meta property=\"og:description\" content=\"Posicionamento relativo: Ao declararmos position:relative sozinha n\u00e3o causa nenhum efeito no posicionamento. Se usarmos ela em conjunto com as propriedades top, right, bottom e left, movimenta o bloco de sua posi\u00e7\u00e3o inicial para uma posi\u00e7\u00e3o conforme declarado nas propriedades citadas. O bloco sai de sua posi\u00e7\u00e3o original e o espa\u00e7o que ela ocupava \u00e9 preservado. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css\" \/>\n<meta property=\"og:site_name\" content=\"KADUNEW\" \/>\n<meta property=\"article:published_time\" content=\"2009-01-22T14:34:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2009-01-22T14:44:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_relativo_css.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"429\" \/>\n\t<meta property=\"og:image:height\" content=\"351\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"Kadu Oliveira\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kadu Oliveira\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. tempo de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css\",\"url\":\"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css\",\"name\":\"Posicionamento relativo, absoluto, static e fixed em CSS\",\"isPartOf\":{\"@id\":\"https:\/\/www.kadunew.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_relativo_css.gif\",\"datePublished\":\"2009-01-22T14:34:08+00:00\",\"dateModified\":\"2009-01-22T14:44:53+00:00\",\"author\":{\"@id\":\"https:\/\/www.kadunew.com\/blog\/#\/schema\/person\/07b2297c4825efbd1e9f2a1018926b05\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css#primaryimage\",\"url\":\"https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_relativo_css.gif\",\"contentUrl\":\"https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_relativo_css.gif\",\"width\":\"429\",\"height\":\"351\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.kadunew.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS\",\"item\":\"https:\/\/www.kadunew.com\/blog\/category\/css\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Posicionamento relativo, absoluto, static e fixed em CSS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.kadunew.com\/blog\/#website\",\"url\":\"https:\/\/www.kadunew.com\/blog\/\",\"name\":\"KADUNEW\",\"description\":\"Artigos sobre Front-End e Programa\u00e7\u00e3o web\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.kadunew.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.kadunew.com\/blog\/#\/schema\/person\/07b2297c4825efbd1e9f2a1018926b05\",\"name\":\"Kadu Oliveira\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.kadunew.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/780660fded589936b30467c54c99d51a?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/780660fded589936b30467c54c99d51a?s=96&r=g\",\"caption\":\"Kadu Oliveira\"},\"sameAs\":[\"https:\/\/www.kadunew.com\/blog\"],\"url\":\"https:\/\/www.kadunew.com\/blog\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Posicionamento relativo, absoluto, static e fixed em CSS","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.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css","og_locale":"pt_BR","og_type":"article","og_title":"Posicionamento relativo, absoluto, static e fixed em CSS","og_description":"Posicionamento relativo: Ao declararmos position:relative sozinha n\u00e3o causa nenhum efeito no posicionamento. Se usarmos ela em conjunto com as propriedades top, right, bottom e left, movimenta o bloco de sua posi\u00e7\u00e3o inicial para uma posi\u00e7\u00e3o conforme declarado nas propriedades citadas. O bloco sai de sua posi\u00e7\u00e3o original e o espa\u00e7o que ela ocupava \u00e9 preservado. [&hellip;]","og_url":"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css","og_site_name":"KADUNEW","article_published_time":"2009-01-22T14:34:08+00:00","article_modified_time":"2009-01-22T14:44:53+00:00","og_image":[{"width":429,"height":351,"url":"https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_relativo_css.gif","type":"image\/gif"}],"author":"Kadu Oliveira","twitter_misc":{"Escrito por":"Kadu Oliveira","Est. tempo de leitura":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css","url":"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css","name":"Posicionamento relativo, absoluto, static e fixed em CSS","isPartOf":{"@id":"https:\/\/www.kadunew.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css#primaryimage"},"image":{"@id":"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css#primaryimage"},"thumbnailUrl":"https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_relativo_css.gif","datePublished":"2009-01-22T14:34:08+00:00","dateModified":"2009-01-22T14:44:53+00:00","author":{"@id":"https:\/\/www.kadunew.com\/blog\/#\/schema\/person\/07b2297c4825efbd1e9f2a1018926b05"},"breadcrumb":{"@id":"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css#primaryimage","url":"https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_relativo_css.gif","contentUrl":"https:\/\/www.kadunew.com\/blog\/wp-content\/uploads\/2009\/01\/posicionamento_relativo_css.gif","width":"429","height":"351"},{"@type":"BreadcrumbList","@id":"https:\/\/www.kadunew.com\/blog\/css\/posicionamento-relativo-absoluto-static-e-fixed-em-css#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.kadunew.com\/blog"},{"@type":"ListItem","position":2,"name":"CSS","item":"https:\/\/www.kadunew.com\/blog\/category\/css"},{"@type":"ListItem","position":3,"name":"Posicionamento relativo, absoluto, static e fixed em CSS"}]},{"@type":"WebSite","@id":"https:\/\/www.kadunew.com\/blog\/#website","url":"https:\/\/www.kadunew.com\/blog\/","name":"KADUNEW","description":"Artigos sobre Front-End e Programa\u00e7\u00e3o web","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.kadunew.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Person","@id":"https:\/\/www.kadunew.com\/blog\/#\/schema\/person\/07b2297c4825efbd1e9f2a1018926b05","name":"Kadu Oliveira","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.kadunew.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/780660fded589936b30467c54c99d51a?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/780660fded589936b30467c54c99d51a?s=96&r=g","caption":"Kadu Oliveira"},"sameAs":["https:\/\/www.kadunew.com\/blog"],"url":"https:\/\/www.kadunew.com\/blog\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.kadunew.com\/blog\/wp-json\/wp\/v2\/posts\/207"}],"collection":[{"href":"https:\/\/www.kadunew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kadunew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kadunew.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kadunew.com\/blog\/wp-json\/wp\/v2\/comments?post=207"}],"version-history":[{"count":5,"href":"https:\/\/www.kadunew.com\/blog\/wp-json\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":214,"href":"https:\/\/www.kadunew.com\/blog\/wp-json\/wp\/v2\/posts\/207\/revisions\/214"}],"wp:attachment":[{"href":"https:\/\/www.kadunew.com\/blog\/wp-json\/wp\/v2\/media?parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kadunew.com\/blog\/wp-json\/wp\/v2\/categories?post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kadunew.com\/blog\/wp-json\/wp\/v2\/tags?post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}