<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SpiceMailer Web Tutotiral &#187; CSS</title>
	<atom:link href="http://spicemailer.com/web/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://spicemailer.com/web</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Thu, 19 Sep 2024 16:44:50 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.2</generator>
	<item>
		<title>Display attributes in CSS Explained</title>
		<link>http://spicemailer.com/web/display-attributes-css-explained/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=display-attributes-css-explained</link>
		<comments>http://spicemailer.com/web/display-attributes-css-explained/#comments</comments>
		<pubDate>Sun, 14 Sep 2014 06:15:22 +0000</pubDate>
		<dc:creator><![CDATA[FrantzFerdinand]]></dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[display attributes]]></category>

		<guid isPermaLink="false">http://spoontalk.com/web/?p=37</guid>
		<description><![CDATA[<p>The display property of an element is responsible for its layout and rendering on the browser. This particular setting defines how the element will look which includes not being visible at all. By default all the elements have inline as default display. Let us discuss about some other useful display options web developers have. 1. inline - If any property is not specified, inline always [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://spicemailer.com/web/display-attributes-css-explained/">Display attributes in CSS Explained</a> appeared first on <a rel="nofollow" href="http://spicemailer.com/web">SpiceMailer Web Tutotiral</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>The <code>display</code> property of an element is responsible for its layout and rendering on the browser. This particular setting defines how the element will look which includes not being visible at all. By default all the elements have <code>inline</code> as default <code>display</code>.<span id="more-37"></span></p>
<p>Let us discuss about some other useful <code>display</code> options web developers have.</p>
<p><code>1. inline</code> - If any property is not specified, <code>inline</code> always acts as default. It simply creates a box, which is as close as possible to the actual rendering area. It doesn&#8217;t really matter what are the dimensions of parent element as it <code>inline</code> does not take that into account. You cannot specify the height and width of the element. But yes <code>margin</code> and <code>padding</code> works in horizontal direction but not in vertical direction. For example:</p>
<pre><code>&lt;h2 style='display:inline'&gt;Hello World&lt;/h2&gt;
</code></pre>
<p>Would look like this:</p>
<p><a style="color: #4183c4;" href="https://camo.githubusercontent.com/d8fb0f16fcbcaee3ca6e839c6ed6a66ff4899a51/687474703a2f2f6935372e74696e797069632e636f6d2f31356869736d735f74682e6a7067" target="_blank" rel="noreferrer"><img src="https://camo.githubusercontent.com/d8fb0f16fcbcaee3ca6e839c6ed6a66ff4899a51/687474703a2f2f6935372e74696e797069632e636f6d2f31356869736d735f74682e6a7067" alt="inline" data-canonical-src="http://i57.tinypic.com/15hisms_th.jpg" /></a></p>
<p><code>2. inline-block</code> - It is almost similar to <code>inline</code>, the difference being that <code>width</code> and <code>height</code> can be specified. For example:</p>
<pre><code>&lt;h2 style='display:inline-block;width:120px;height:200px'&gt;Hello World&lt;/h2&gt;
</code></pre>
<p>Would look like this:</p>
<p><a style="color: #4183c4;" href="https://camo.githubusercontent.com/1b5d8c58432a90b86d31e463d34f48dc0816ef83/687474703a2f2f6936302e74696e797069632e636f6d2f32757a636574735f74682e6a7067" target="_blank" rel="noreferrer"><img src="https://camo.githubusercontent.com/1b5d8c58432a90b86d31e463d34f48dc0816ef83/687474703a2f2f6936302e74696e797069632e636f6d2f32757a636574735f74682e6a7067" alt="inline-block" data-canonical-src="http://i60.tinypic.com/2uzcets_th.jpg" /></a></p>
<p><code>3. block</code> - Elements such as <code>div</code>, <code>p</code>,<code>h1</code> and with HTML5 elements like <code>header</code>, <code>section</code> are<code>block</code> by default. <code>block</code> elements tend to acquire the width of the parent element. So basically, it takes as much as horizontal space which is available to it. For example, elements declared after a heading with <code>h#</code> tag always come below it. This is due to the <code>width:100%</code> which they have due to<code>block</code> display. For example:</p>
<pre><code>&lt;h2 style='display:block'&gt;Hello World&lt;/h2&gt;
</code></pre>
<p>Would look like this:</p>
<p><a style="color: #4183c4;" href="https://camo.githubusercontent.com/b6f606f673c46ca84b6d54ec44eb362f6452edcf/687474703a2f2f6f6935392e74696e797069632e636f6d2f3562717833702e6a7067" target="_blank" rel="noreferrer"><img src="https://camo.githubusercontent.com/b6f606f673c46ca84b6d54ec44eb362f6452edcf/687474703a2f2f6f6935392e74696e797069632e636f6d2f3562717833702e6a7067" alt="block" data-canonical-src="http://oi59.tinypic.com/5bqx3p.jpg" /></a></p>
<p><code>4. none</code> - When this property is assigned to <code>display</code>, browser considers that the element doesn&#8217;t exist in DOM. This means it&#8217;s invisible and doesn&#8217;t take any space nor leave any vacant unoccupied space. Although, it can be referred by Javascript. Changing the property to block or inline will make it visible once again.</p>
<p><code>5. table</code> - These are rarely used. We have a list of them which can help you build a table from <code>div</code>but once again, they are rarely used or not used at all. They are self explanatory about the properties and I think directly using a <code>table</code> will make more sense. <code> display: table display: table-cell display: table-column display: table-column-group display: table-footer-group display: table-header-group display: table-row display: table-row-group </code></p>
<p><code>6. list-item</code> - This has also got nothing so special except that the element starts behaving as if it is<code>&lt;li&gt;&lt;/li&gt;</code>.</p>
<p>With only <code>block</code>, <code>none</code> and <code>inline</code> being significantly used, other display properties are losing usage with time. I hope you enjoyed reading this. To test things, simply move on to <code>inspect-element</code> in Google Chrome and try changing display property of various elements, specially <code>h#</code> tags. For more info and documentation, check <a style="color: #4183c4;" href="https://developer.mozilla.org/en-US/docs/Web/CSS/display" rel="noreferrer">Mozilla Documentation</a>.</p>
<p>The post <a rel="nofollow" href="http://spicemailer.com/web/display-attributes-css-explained/">Display attributes in CSS Explained</a> appeared first on <a rel="nofollow" href="http://spicemailer.com/web">SpiceMailer Web Tutotiral</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://spicemailer.com/web/display-attributes-css-explained/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
