{"id":1479,"date":"2018-02-14T10:11:53","date_gmt":"2018-02-14T15:11:53","guid":{"rendered":"http:\/\/bluegalaxy.info\/codewalk\/?p=1479"},"modified":"2018-02-14T11:43:38","modified_gmt":"2018-02-14T16:43:38","slug":"css-use-display-property","status":"publish","type":"post","link":"https:\/\/bluegalaxy.info\/codewalk\/2018\/02\/14\/css-use-display-property\/","title":{"rendered":"CSS: How to use the display property"},"content":{"rendered":"<p>Here is what w3schools.com says about the CSS display property:<\/p>\n<blockquote><p>The display property specifies the display behavior of an element.<\/p>\n<p>Note: Every element on a web page is a rectangular box. The CSS display property determines how that rectangular box behaves.<\/p><\/blockquote>\n<p>There are multiple settings that can be used with the CSS display property. Here are a few for example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"css\">display: none;\r\ndisplay: inline;\r\ndisplay: block;\r\ndisplay: inline-block;\r\ndisplay: grid;\r\ndisplay: flex;<\/pre>\n<p>The first four on this list are illustrated nicely here:<br \/>\n<a href=\"https:\/\/www.w3schools.com\/cssref\/tryit.asp?filename=trycss_display\">https:\/\/www.w3schools.com\/cssref\/tryit.asp?filename=trycss_display<\/a><\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"css\">display: none;<\/code> will not display the value.<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"css\">display: inline;<\/code> will display the value in line with surrounding text.<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"css\">display: block;<\/code> will break the surrounding text to display the value as its own seperate block.<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"css\">display: inline-block;<\/code> acts just like <code class=\"EnlighterJSRAW\" data-enlighter-language=\"css\">display: inline;<\/code>.<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"css\">display: grid;<\/code> is used with the CSS grid property.<\/p>\n<p>See: <a href=\"https:\/\/www.w3schools.com\/cssref\/pr_grid.asp\">https:\/\/www.w3schools.com\/cssref\/pr_grid.asp<\/a><\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"css\">display: flex;<\/code> is used with the CSS flexbox property.<\/p>\n<p>See: <a href=\"https:\/\/www.w3schools.com\/cSS\/css3_flexbox.asp\">https:\/\/www.w3schools.com\/cSS\/css3_flexbox.asp<\/a><\/p>\n<p>Example of usage:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"css\">.info .btn {\r\n   display: block;\r\n   text-align: center;\r\n   margin: auto;\r\n}<\/pre>\n<p>For more information about the CSS display property and a complete list of possible values, see:<br \/>\n<a href=\"https:\/\/www.w3schools.com\/cssref\/pr_class_display.asp\">https:\/\/www.w3schools.com\/cssref\/pr_class_display.asp<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is what w3schools.com says about the CSS display property: The display property specifies the display behavior of an element. Note: Every element on a web page is a rectangular box. The CSS display property determines how that rectangular box behaves. There are multiple settings that can be used with the CSS display property. Here &hellip; <a href=\"https:\/\/bluegalaxy.info\/codewalk\/2018\/02\/14\/css-use-display-property\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">CSS: How to use the display property<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[104],"tags":[10,105],"class_list":["post-1479","post","type-post","status-publish","format-standard","hentry","category-html-css","tag-css","tag-html"],"_links":{"self":[{"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/posts\/1479","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/comments?post=1479"}],"version-history":[{"count":9,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/posts\/1479\/revisions"}],"predecessor-version":[{"id":1489,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/posts\/1479\/revisions\/1489"}],"wp:attachment":[{"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/media?parent=1479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/categories?post=1479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/tags?post=1479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}