﻿{"id":440,"date":"2008-06-04T06:10:00","date_gmt":"2008-06-04T06:10:00","guid":{"rendered":"https:\/\/chayilyam.com\/stories\/?p=440"},"modified":"2008-06-04T06:10:00","modified_gmt":"2008-06-04T06:10:00","slug":"css-block-and-inline-level-elements","status":"publish","type":"post","link":"https:\/\/chayilyam.com\/stories\/css-block-and-inline-level-elements\/","title":{"rendered":"CSS Block and inline level elements"},"content":{"rendered":"<p>Nearly all HTML elements are either block or inline elements. The characteristics of block elements include:<\/p>\n<ul>\n<li><span>begin on a new line<\/span><\/li>\n<li><span> Height, line-height and top and bottom margins can be manipulated<\/span><\/li>\n<li><span> defaults to 100% of their containing element, unless a width is specified<\/span><\/li>\n<\/ul>\n<p>Examples of block elements include <\/p>\n<div>, <\/p>\n<p>, <\/p>\n<h1>, <\/p>\n<form>, <\/p>\n<ul> and <\/p>\n<li>. Inline elements on the other hand have the opposite characteristics:\n<p> Begin on the same line<br \/> Height, line-height and top and bottom margins can&#8217;t be changed<br \/> Width is as long as the text\/image and can&#8217;t be manipulated<\/p>\n<p>Examples of inline elements include <span>, <a>, <label>, <input>, <img>, <strong> and <em>.<\/p>\n<p>To change an element&#8217;s status you can use display: inline or display: block. But what&#8217;s the point of changing an element from being block to inline, or vice-versa? Well, at first it may seem like you might hardly ever use this, but in actual fact this is a very powerful technique, which you can use any time you want to:<\/p>\n<ul>\n<li> Have an inline element start on a new line .<\/li>\n<li> Have a block element start on the same line<\/li>\n<li> Control the width of an inline element (particularly useful for navigation links) <\/li>\n<li> Manipulate the height of an inline element      Set a background colour as wide as the text for block elements, without having to specify a width<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Nearly all HTML elements are either block or inline elements. The characteristics of block elements include: begin on a new line Height, line-height and top and bottom margins can be manipulated defaults to 100% of their containing element, unless a width is specified Examples of block elements include , , , , and . Inline &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[81,84,85,183],"tags":[1627,1646,1349],"class_list":["post-440","post","type-post","status-publish","format-standard","hentry","category-css","category-css-tags","category-css3","category-help","tag-css","tag-help","tag-tutorial"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pfoK1S-76","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/chayilyam.com\/stories\/wp-json\/wp\/v2\/posts\/440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chayilyam.com\/stories\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chayilyam.com\/stories\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chayilyam.com\/stories\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/chayilyam.com\/stories\/wp-json\/wp\/v2\/comments?post=440"}],"version-history":[{"count":0,"href":"https:\/\/chayilyam.com\/stories\/wp-json\/wp\/v2\/posts\/440\/revisions"}],"wp:attachment":[{"href":"https:\/\/chayilyam.com\/stories\/wp-json\/wp\/v2\/media?parent=440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chayilyam.com\/stories\/wp-json\/wp\/v2\/categories?post=440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chayilyam.com\/stories\/wp-json\/wp\/v2\/tags?post=440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}