{"id":14121,"date":"2011-09-06T18:53:22","date_gmt":"2011-09-07T01:53:22","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=14121"},"modified":"2019-11-03T15:47:49","modified_gmt":"2019-11-03T22:47:49","slug":"top-right-bottom-left","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/t\/top-right-bottom-left\/","title":{"rendered":"top \/ bottom \/ left \/ right"},"content":{"rendered":"

The top<\/code>, bottom<\/code>, left<\/code>, and right<\/code> properties are used with position<\/a> to set the placement of an element. They only have an effect on positioned elements, which are elements with the position<\/code> property set to anything other than static<\/code>. For example: relative<\/code>, absolute<\/code>, fixed<\/code>, or sticky<\/code>.<\/p>\n

div {\r\n  <top || bottom || left || right>: <length> || <percentage> || auto || inherit;\r\n}<\/code><\/pre>\n

You might use it, for example, to nudge an icon into place:<\/p>\n

button .icon {\r\n  position: relative;\r\n  top: 1px;\r\n}<\/code><\/pre>\n

Or position a special element inside a container.<\/p>\n

.container {\r\n  position: relative;\r\n}\r\n.container header {\r\n  position: absolute;\r\n  top: 0;\r\n}<\/code><\/pre>\n

The value for top<\/code>, bottom<\/code>, left<\/code>, and right<\/code> can be any of the following:<\/p>\n