{"id":20808,"date":"2015-06-09T17:29:09","date_gmt":"2015-06-09T11:59:09","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=20808"},"modified":"2016-12-19T15:34:37","modified_gmt":"2016-12-19T10:04:37","slug":"difference-bw-displayinline-and-inline-block","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/difference-bw-displayinline-and-inline-block\/","title":{"rendered":"Difference b\/w Display:inline and inline-block"},"content":{"rendered":"<p>The CSS property &#8220;Display&#8221; is very useful and commonly used property of CSS which contains lots of values. In this blog we&#8217;ll talk about only &#8220;display:inline&#8221; and &#8220;display:inline-block&#8221;.<\/p>\n<p>We generally use both these properties to allow other elements to sit to their left and right but it has some difference which is explained below.<\/p>\n<h3 style=\"font-size: 22px !important;margin-bottom: 8px !important\">Display:inline<\/h3>\n<p>An inline element has no line break before and after of its neighbour elements and it allows HTML next to it.<br \/>\n1. Allows all side of padding<br \/>\n2. Allows only left and right side of margins, not top and bottom<br \/>\n3. You can&#8217;t set width and height of its element<br \/>\n4. Respect other elements to sit their left and right<\/p>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/display-inline.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-20810\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/display-inline.jpg\" alt=\"display-inline\" width=\"428\" height=\"213\" \/><\/a><\/p>\n<div style=\"height:30px\"><\/div>\n<h3 style=\"font-size: 22px !important;margin-bottom: 8px !important\">Display:inline-block<\/h3>\n<p>An inline-block element is placed as an inline element (on the same line as adjacent content). It looks like a inline element but actually its behaves as a block element and don&#8217;t force to line break<br \/>\n1. Allows all side of padding and margin<br \/>\n2. You can set width and height of its element<br \/>\n3. Respect other elements to sit their left and right<\/p>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/display-inline-block.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-20811\" src=\"\/blog\/wp-ttn-blog\/uploads\/2015\/06\/display-inline-block.jpg\" alt=\"display-inline-block\" width=\"428\" height=\"231\" \/><\/a><\/p>\n<p>As you can see in above given example, an inline-block (the button) will have taken its full space in all directions for padding and margins but inline (the button) will not allow it.<\/p>\n<p>Hope you will like it !<br \/>\nLinkedin<br \/>\nTwitter<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The CSS property &#8220;Display&#8221; is very useful and commonly used property of CSS which contains lots of values. In this blog we&#8217;ll talk about only &#8220;display:inline&#8221; and &#8220;display:inline-block&#8221;. We generally use both these properties to allow other elements to sit to their left and right but it has some difference which is explained below. Display:inline [&hellip;]<\/p>\n","protected":false},"author":51,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":6},"categories":[1],"tags":[245,1852,4842,379],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/20808"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/51"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=20808"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/20808\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=20808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=20808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=20808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}