{"id":575,"date":"2010-01-26T11:17:52","date_gmt":"2010-01-26T11:17:52","guid":{"rendered":"http:\/\/www.codingfriends.com\/?p=575"},"modified":"2010-01-26T11:18:42","modified_gmt":"2010-01-26T11:18:42","slug":"box-model","status":"publish","type":"post","link":"https:\/\/www.codingfriends.com\/index.php\/2010\/01\/26\/box-model\/","title":{"rendered":"Box model"},"content":{"rendered":"<h3>Introduction<\/h3>\n<p>The box model within HTML is how the content and the area around it is defined.  There is the content itself, paddings, border and margin&#8217;s.  Each one can be altered and also each part of the top,bottom,left and right.<\/p>\n<h3>Image of the box model<\/h3>\n<figure id=\"attachment_576\" aria-describedby=\"caption-attachment-576\" style=\"width: 476px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.codingfriends.com\/wp-content\/uploads\/2010\/01\/boxmodel.jpeg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.codingfriends.com\/wp-content\/uploads\/2010\/01\/boxmodel.jpeg\" alt=\"box model in HTML\" title=\"boxmodel\" width=\"476\" height=\"378\" class=\"size-full wp-image-576\" srcset=\"https:\/\/www.codingfriends.com\/wp-content\/uploads\/2010\/01\/boxmodel.jpeg 476w, https:\/\/www.codingfriends.com\/wp-content\/uploads\/2010\/01\/boxmodel-300x238.jpg 300w\" sizes=\"auto, (max-width: 476px) 100vw, 476px\" \/><\/a><figcaption id=\"caption-attachment-576\" class=\"wp-caption-text\">box model in HTML<\/figcaption><\/figure>\n<p>Green : content<br \/>\nBlue  : padding<br \/>\nred : border<br \/>\nyellow : margin<\/p>\n<h3>How to alter the each aspect of the model<\/h3>\n<p>To alter the margin for example you just need to define the actual HTML object that you want to &#8220;talk&#8221; to, so lets define that first.<\/p>\n<pre lang=\"html\">\r\n<div id=\"alterhere\">\r\nhi there this is the content\r\n<\/div>\r\n<\/pre>\n<p>and then to talk to the HTML object you just select it ( if was a class then you use &#8220;.&#8221; or if it was a id then use &#8220;#&#8221;, the way that I remember is that &#8220;.&#8221; is like class method call in c++\/java\/c# etc and &#8220;#&#8221; is what you could call a variable).<\/p>\n<pre lang=\"css\">\r\n#alterhere \r\n{\r\nmargin : 20px;\r\n}\r\n<\/pre>\n<p>means to have a full margin of 20px (pixels) but to pull out just the left part to be bigger then <\/p>\n<pre lang=\"css\">\r\n#alterhere\r\n{\r\nmargin-left : 50px;\r\n}\r\n<\/pre>\n<p>so the margin left will now be 50px instead of 20px.  You can do the same for padding as well, padding-left, padding-right, padding-top, padding-bottom.<\/p>\n<h3>Conclusion<\/h3>\n<p>The box model is very nice and also allows you to fully control the content and the box around it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction The box model within HTML is how the content and the area around it is defined. There is the content itself, paddings, border and margin&#8217;s. Each one can be altered and also each part of the top,bottom,left and right. Image of the box model Green : content Blue : padding red : border yellow &hellip; <a href=\"https:\/\/www.codingfriends.com\/index.php\/2010\/01\/26\/box-model\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Box model<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[70],"class_list":["post-575","post","type-post","status-publish","format-standard","hentry","category-html","tag-box-model"],"_links":{"self":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/comments?post=575"}],"version-history":[{"count":3,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/575\/revisions"}],"predecessor-version":[{"id":579,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/575\/revisions\/579"}],"wp:attachment":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/media?parent=575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/categories?post=575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/tags?post=575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}