<?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>CSS Park</title>
	<atom:link href="https://csspark.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://csspark.com/</link>
	<description>A new place for web developers and designers</description>
	<lastBuildDate>Sat, 14 Mar 2015 06:04:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Pitchmaker</title>
		<link>https://csspark.com/gallery/clean/pitchmaker/</link>
					<comments>https://csspark.com/gallery/clean/pitchmaker/#respond</comments>
		
		<dc:creator><![CDATA[Renat]]></dc:creator>
		<pubDate>Sat, 14 Mar 2015 06:02:27 +0000</pubDate>
				<category><![CDATA[Big Background Images]]></category>
		<category><![CDATA[Clean]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Fullscreen]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Parallax]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[Wall of fame]]></category>
		<guid isPermaLink="false">http://csspark.com/?p=1052</guid>

					<description><![CDATA[<p>A PDF proposal is so 20th Century. With Pitchmaker you can create beautiful proposals to be presented as a webpage. Your client can still print it if they want to.</p>
<p>The post <a rel="nofollow" href="https://csspark.com/gallery/clean/pitchmaker/">Pitchmaker</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>A PDF proposal is so 20th Century. With Pitchmaker you can create beautiful proposals to be presented as a webpage. Your client can still print it if they want to.</p>
<p>The post <a rel="nofollow" href="https://csspark.com/gallery/clean/pitchmaker/">Pitchmaker</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://csspark.com/gallery/clean/pitchmaker/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Show the Latest Update Time and Date for a WordPress Page or Post</title>
		<link>https://csspark.com/wilderness/snippets/wordpress-snippets/show-latest-update-time-date-wordpress-page-post/</link>
					<comments>https://csspark.com/wilderness/snippets/wordpress-snippets/show-latest-update-time-date-wordpress-page-post/#respond</comments>
		
		<dc:creator><![CDATA[Renat]]></dc:creator>
		<pubDate>Sat, 04 Oct 2014 08:16:28 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">http://csspark.com/?p=1043</guid>

					<description><![CDATA[<p>A blog post is something you do not typically go back and edit. It’s a one and done piece of content. However, sometimes there is a reason to go back and change content in a post, or more likely, to update the content on a page. Here is a code snippet that will show the</p>
<p><a class="more-link btn btn-default" href="https://csspark.com/wilderness/snippets/wordpress-snippets/show-latest-update-time-date-wordpress-page-post/"> Continue reading →</a></p>
<p>The post <a rel="nofollow" href="https://csspark.com/wilderness/snippets/wordpress-snippets/show-latest-update-time-date-wordpress-page-post/">Show the Latest Update Time and Date for a WordPress Page or Post</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>A blog post is something you do not typically go back and edit. It’s a one and done piece of content. However, sometimes there is a reason to go back and change content in a post, or more likely, to update the content on a page.</p>
<p>Here is a code snippet that will show the updated modification time for a post/page, as well as the original publish time.</p>
<p>&nbsp;</p>
<pre class="php">&lt;?php if (get_the_modified_time() != get_the_time()) : ?&gt;
 
		&lt;p&gt;Posted: &lt;?php the_time('F j, Y'); ?&gt; at &lt;?php the_time('g:i a'); ?&gt;, Last Updated: &lt;?php the_modified_time('F j, Y'); ?&gt; at &lt;?php the_modified_time('g:i a'); ?&gt;&lt;/p&gt;
 
	&lt;?php else: ?&gt;
 
		&lt;p&gt;Posted: &lt;?php the_time('F j, Y'); ?&gt; at &lt;?php the_time('g:i a'); ?&gt;&lt;/p&gt;
 
&lt;?php endif; ?&gt;</pre>
<p>This snippet is really simple. If the modified time is not equal to the original post time, then show the original publish time followed by the modified time. If the post or page hasn’t been updated since it was orginally published, then the visitors will just see the original publish time.</p>
<p>The post <a rel="nofollow" href="https://csspark.com/wilderness/snippets/wordpress-snippets/show-latest-update-time-date-wordpress-page-post/">Show the Latest Update Time and Date for a WordPress Page or Post</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://csspark.com/wilderness/snippets/wordpress-snippets/show-latest-update-time-date-wordpress-page-post/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>zoom</title>
		<link>https://csspark.com/docs/css/properties/z/zoom/</link>
					<comments>https://csspark.com/docs/css/properties/z/zoom/#respond</comments>
		
		<dc:creator><![CDATA[Renat]]></dc:creator>
		<pubDate>Wed, 17 Sep 2014 04:22:10 +0000</pubDate>
				<category><![CDATA[Z]]></category>
		<guid isPermaLink="false">http://csspark.com/?p=981</guid>

					<description><![CDATA[<p>The zoom property in CSS allows you to scale your content. It is non-standard, and was originally implemented only in Internet Explorer. Although several other browsers now support zoom, it isn&#8217;t recommended for production sites. .zoom { zoom: 150%; } The &#8220;supported: values are: percentage &#8211; Scale by this percentage number &#8211; Convert to percentage</p>
<p><a class="more-link btn btn-default" href="https://csspark.com/docs/css/properties/z/zoom/"> Continue reading →</a></p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/z/zoom/">zoom</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The <code>zoom</code> property in CSS allows you to scale your content. It is non-standard, and was originally implemented only in Internet Explorer. Although several other browsers now support zoom, it isn&#8217;t recommended for production sites.</p>
<pre class="css">.zoom {
  zoom: 150%;
}</pre>
<p>The &#8220;supported: values are:</p>
<ul>
<li><code>percentage</code> &#8211; Scale by this percentage</li>
<li><code>number</code> &#8211; Convert to percentage and scale &#8211; 1 == 100%; 1.5 == 150%;</li>
<li><code>normal</code> &#8211; zoom: 1;</li>
</ul>
<p>If your browser supports it, you&#8217;ll see these images as different sizes:</p>
<pre class="html">&lt;img src="http://placekitten.com/100/100"&gt;
&lt;img src="http://placekitten.com/100/100"&gt;
&lt;img src="http://placekitten.com/100/100"&gt;
&lt;img src="http://placekitten.com/100/100"&gt;</pre>
<pre class="css">img:nth-child(2) {
  zoom: 150%;
}
img:nth-child(3) {
  zoom: 1.8;
}
img:nth-child(4) {
  zoom: 0.2;
}</pre>
<p>Zoom is an old IE thing. It isn&#8217;t something you should use on live sites. If you want to scale content, use CSS Transforms. You can also use filters if you need <abbr title="Internet Explorer versions 6-8">oldIE</abbr> support.</p>
<p>Back in the days of IE6, zoom was used primarily as a hack. Many of the rendering bugs in both IE6 and IE7 could be fixed using zoom. As an example, <code>display: inline-block</code> didn&#8217;t work very well in IE6/7. Setting <code>zoom: 1</code> fixed the problem. The bug had to do with how IE rendered its layout. Setting <code>zoom: 1</code> turned on an internal property called hasLayout, which fixed the problem.</p>
<h3 id="browser-support">Browser Support</h3>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Chrome</th>
<th>Safari</th>
<th>Firefox</th>
<th>Opera</th>
<th>IE</th>
<th>Android</th>
<th>iOS</th>
</tr>
</thead>
<tbody>
<tr>
<td data-browser-name="Chrome">Any</td>
<td data-browser-name="Safari">4.0+</td>
<td data-browser-name="Firefox">None</td>
<td data-browser-name="Opera">None</td>
<td data-browser-name="IE">5.5+</td>
<td data-browser-name="Android">TBD</td>
<td data-browser-name="iOS">TBD</td>
</tr>
</tbody>
</table>
<p>Safari also supports <code>zoom</code> since version 4. However, it added a new value: <code>reset</code>. That tells the browser not to zoom your element on zoom. So your cmd/ctrl+? It doesn&#8217;t work on elements with<code>zoom: reset</code> applied.</p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/z/zoom/">zoom</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://csspark.com/docs/css/properties/z/zoom/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>z-index</title>
		<link>https://csspark.com/docs/css/properties/z/z-index/</link>
					<comments>https://csspark.com/docs/css/properties/z/z-index/#respond</comments>
		
		<dc:creator><![CDATA[Renat]]></dc:creator>
		<pubDate>Wed, 17 Sep 2014 04:20:24 +0000</pubDate>
				<category><![CDATA[Z]]></category>
		<guid isPermaLink="false">http://csspark.com/?p=977</guid>

					<description><![CDATA[<p>div { z-index: 1; /* integer */ } The z-index property in CSS controls the vertical stacking order of elements that overlap. As in, which one appears as if it is physically closer to you. z-index only effects elements that have a position value other than static (the default). Elements can overlap for a variety of</p>
<p><a class="more-link btn btn-default" href="https://csspark.com/docs/css/properties/z/z-index/"> Continue reading →</a></p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/z/z-index/">z-index</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></description>
										<content:encoded><![CDATA[<pre class="css">div {
  z-index: 1; /* integer */
}</pre>
<p>The z-index property in CSS controls the vertical stacking order of elements that overlap. As in, which one appears as if it is physically closer to you. z-index only effects elements that have a <a title="position" href="http://csspark.com/docs/css/properties/p-properties/position/">position</a> value other than <code>static</code> (the default).</p>
<p>Elements can overlap for a variety of reasons, for instance relative positioning has nudged it over something else. Negative <a title="margin" href="http://csspark.com/docs/css/properties/m-properties/margin/">margin</a> has pulled the element over another. Absolutely positioned elements overlap each other. All sorts of reasons.</p>
<img decoding="async" fetchpriority="high" width="425" height="235" class="aligncenter size-full wp-image-978" src="http://csspark.com/wp-content/uploads/2014/09/basicz-index.png" alt="basicz-index" srcset="https://csspark.com/wp-content/uploads/2014/09/basicz-index.png 425w, https://csspark.com/wp-content/uploads/2014/09/basicz-index-300x165.png 300w" sizes="(max-width: 425px) 100vw, 425px" />
<p>Without any <code>z-index</code> value, elements stack in the order that they appear in the DOM (the lowest one down at the same hierarchy level appears on top). Elements with non-static positioning will always appear on top of elements with default static positioning.</p>
<p>Also note that nesting plays a big role. If an element B sits on top of element A, a child element of element A can <strong>never</strong> be higher than element B.</p>
<img decoding="async" width="530" height="342" class="aligncenter size-full wp-image-979" src="http://csspark.com/wp-content/uploads/2014/09/context.png" alt="context" srcset="https://csspark.com/wp-content/uploads/2014/09/context.png 530w, https://csspark.com/wp-content/uploads/2014/09/context-300x193.png 300w" sizes="(max-width: 530px) 100vw, 530px" />
<p>Note that older version of IE get this context stuff a bit screwed up.</p>
<h3 id="browser-support">Browser Support</h3>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Chrome</th>
<th>Safari</th>
<th>Firefox</th>
<th>Opera</th>
<th>IE</th>
<th>Android</th>
<th>iOS</th>
</tr>
</thead>
<tbody>
<tr>
<td data-browser-name="Chrome">Works</td>
<td data-browser-name="Safari">Works</td>
<td data-browser-name="Firefox">Works</td>
<td data-browser-name="Opera">Works</td>
<td data-browser-name="IE">4+</td>
<td data-browser-name="Android">4+</td>
<td data-browser-name="iOS">Works</td>
</tr>
</tbody>
</table>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/z/z-index/">z-index</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://csspark.com/docs/css/properties/z/z-index/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>word-spacing</title>
		<link>https://csspark.com/docs/css/properties/w/word-spacing/</link>
					<comments>https://csspark.com/docs/css/properties/w/word-spacing/#respond</comments>
		
		<dc:creator><![CDATA[Renat]]></dc:creator>
		<pubDate>Wed, 17 Sep 2014 04:18:32 +0000</pubDate>
				<category><![CDATA[W]]></category>
		<guid isPermaLink="false">http://csspark.com/?p=974</guid>

					<description><![CDATA[<p>The word-spacing property is similar to letter-spacing, though naturally its use governs the amount of space between the words in a piece of text, not the individual characters. p { word-spacing: 2em; } word-spacing can receive three different values: the “normal” keyword, which resets the default spacing length values using any CSS units (most commonly</p>
<p><a class="more-link btn btn-default" href="https://csspark.com/docs/css/properties/w/word-spacing/"> Continue reading →</a></p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/w/word-spacing/">word-spacing</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The <code>word-spacing</code> property is similar to <a title="letter-spacing" href="http://csspark.com/docs/css/properties/l-properties/letter-spacing/"><code>letter-spacing</code></a>, though naturally its use governs the amount of space between the words in a piece of text, not the individual characters.</p>
<pre class="css">p {
    word-spacing: 2em;
}</pre>
<p><code>word-spacing</code> can receive three different values:</p>
<ol>
<li>the “normal” keyword, which resets the default spacing</li>
<li>length values using any CSS units (most commonly <i>px</i>, <i>em</i>, <i>rem</i>)</li>
<li>the “inherit” keyword, which applies the <code>word-spacing</code> of the parent element</li>
</ol>
<p>Best practice at this time would be to use <code>em</code>. Font size can be adjusted, so using pixels for this could cause problems at the spacing between words wouldn&#8217;t scale as their size did. <code>rem</code> is great usually, but browser support is lower and in this use case it&#8217;s probably best the spacing is relevant directly to the words it is being applied to, not the root.</p>
<img decoding="async" width="526" height="115" class="aligncenter size-full wp-image-975" src="http://csspark.com/wp-content/uploads/2014/09/almanac_word-spacing-example.png" alt="almanac_word-spacing-example" srcset="https://csspark.com/wp-content/uploads/2014/09/almanac_word-spacing-example.png 526w, https://csspark.com/wp-content/uploads/2014/09/almanac_word-spacing-example-300x65.png 300w" sizes="(max-width: 526px) 100vw, 526px" />
<p>It is important to note that “word” in this context actually refers a singular piece of inline content—which means that <code>word-spacing</code> affects <code>inline-block</code> elements as well as <code>inline </code>elements. In this example, several such elements are spaced by setting the <code>word-spacing</code> of their parent container:</p>
<pre class="html">&lt;div class="wrap"&gt;
  &lt;div class="module"&gt;&lt;/div&gt;
  &lt;div class="module"&gt;&lt;/div&gt;
  &lt;div class="module"&gt;&lt;/div&gt;
  &lt;div class="module"&gt;&lt;/div&gt;
&lt;/div&gt;</pre>
<pre class="css">.wrap {
  word-spacing: 1em;
  padding: 1em 0 0;
}
.module {
  background: lightsteelblue;
  height: 5em;
  width: 5em;
  display: inline-block;
  /* reset word-spacing so that text inside this box is spaced normally */
  word-spacing: normal;
}</pre>
<h3>Points of Interest</h3>
<ul>
<li>The <code>word-spacing</code> property is animatable with CSS Transitions.</li>
<li>While use of the “percentage” value to determine spacing is permitted as per the spec, it can yield unpredictable results — often simply no effect at all.</li>
<li>Setting white-space to zero is one of the ways to fight against the space between inline block elements.</li>
</ul>
<h3 id="browser-support">Browser Support</h3>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Chrome</th>
<th>Safari</th>
<th>Firefox</th>
<th>Opera</th>
<th>IE</th>
<th>Android</th>
<th>iOS</th>
</tr>
</thead>
<tbody>
<tr>
<td data-browser-name="Chrome">Works</td>
<td data-browser-name="Safari">Works</td>
<td data-browser-name="Firefox">Works</td>
<td data-browser-name="Opera">Works</td>
<td data-browser-name="IE">Works</td>
<td data-browser-name="Android">Most</td>
<td data-browser-name="iOS">Works</td>
</tr>
</tbody>
</table>
<p><i>A note on Android browser support: The vast majority of Android devices support <code>word-spacing</code>—however, some devices using non-Apple builds of Webkit or the Netfront browser do not. The specifics are detailed in the QuirksMode link above.</i></p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/w/word-spacing/">word-spacing</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://csspark.com/docs/css/properties/w/word-spacing/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>word-break</title>
		<link>https://csspark.com/docs/css/properties/w/word-break/</link>
					<comments>https://csspark.com/docs/css/properties/w/word-break/#respond</comments>
		
		<dc:creator><![CDATA[Renat]]></dc:creator>
		<pubDate>Wed, 17 Sep 2014 04:16:07 +0000</pubDate>
				<category><![CDATA[W]]></category>
		<guid isPermaLink="false">http://csspark.com/?p=972</guid>

					<description><![CDATA[<p>p { word-break: normal &#124; break-all &#124; keep-all; } Normally, line breaks in text can only occur in certain spaces, like when there is literally a space or a hyphen. When you set word-break to break-all, line breaks can occur between any character. Resulting in, for example: Perform ance (if that word wouldn&#8217;t quite fit</p>
<p><a class="more-link btn btn-default" href="https://csspark.com/docs/css/properties/w/word-break/"> Continue reading →</a></p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/w/word-break/">word-break</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></description>
										<content:encoded><![CDATA[<pre class="css">p {
  word-break: normal | break-all | keep-all;
}</pre>
<p>Normally, line breaks in text can only occur in certain spaces, like when there is literally a space or a hyphen. When you set word-break to break-all, line breaks can occur between any character. Resulting in, for example:</p>
<p>Perform<br />
ance</p>
<p>(if that word wouldn&#8217;t quite fit into its parent container width)</p>
<p>It&#8217;s often used in places with user generated content so that long strings don&#8217;t risk breaking layout. One very common example is a long copy and pasted URL. If that URL has no hyphens, it can extend beyond the parent box and look bad or worse, cause layout problems.</p>
<p>It is also often used in conjunction with the hyphens property so that when breaks occur a hypen is inserted, as per the standard in books.</p>
<p>The full usage, with needed vendor prefixes, is:</p>
<pre class="css">-ms-word-break: break-all;
     word-break: break-all;

     // Non standard for webkit
     word-break: break-word;

-webkit-hyphens: auto;
   -moz-hyphens: auto;
        hyphens: auto;</pre>
<p>Using these properties on the universal selector can be useful if you have a site with a lot of user generated content. Although fair warning, it can look weird on titles and pre formatted text (<code>&lt;pre&gt;</code>).</p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/w/word-break/">word-break</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://csspark.com/docs/css/properties/w/word-break/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>width</title>
		<link>https://csspark.com/docs/css/properties/w/width/</link>
					<comments>https://csspark.com/docs/css/properties/w/width/#respond</comments>
		
		<dc:creator><![CDATA[Renat]]></dc:creator>
		<pubDate>Wed, 17 Sep 2014 04:14:24 +0000</pubDate>
				<category><![CDATA[W]]></category>
		<guid isPermaLink="false">http://csspark.com/?p=969</guid>

					<description><![CDATA[<p>The width property in CSS specifies the width of the element&#8217;s content1 area. This &#8220;content&#8221; area is the portion inside the padding, border, and margin of an element (the box model). .wrap { width: 80%; } In the example above, elements that have a class name of .wrap will be 80% as wide as their</p>
<p><a class="more-link btn btn-default" href="https://csspark.com/docs/css/properties/w/width/"> Continue reading →</a></p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/w/width/">width</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The <code>width</code> property in CSS specifies the width of the element&#8217;s content<sup>1</sup> area. This &#8220;content&#8221; area is the portion inside the <a title="padding" href="http://csspark.com/docs/css/properties/p-properties/padding/">padding</a>, <a title="border" href="http://csspark.com/docs/css/properties/b-properties/border/">border</a>, and <a title="margin" href="http://csspark.com/docs/css/properties/m-properties/margin/">margin</a> of an element (the box model).</p>
<pre class="css">.wrap {
  width: 80%;
}</pre>
<p>In the example above, elements that have a class name of <code>.wrap</code> will be 80% as wide as their parent element. The accepted values are any of the length values, in addition to some keywords we&#8217;ll cover later.</p>
<p>Width can be overridden by the closely correleated properties <a title="min-width" href="http://csspark.com/docs/css/properties/m-properties/min-width/">min-width</a> and <a title="max-width" href="http://csspark.com/docs/css/properties/m-properties/max-width/">max-width</a>.</p>
<pre class="css">.wrapperA {
  width: 100%;
  max-width: 320px; /* Will be AT MOST 320px wide */
}
.wrapperB {
  width: 100%;
  min-width: 20em; /* Will be AT LEAST 20em wide */
}</pre>
<pre class="html">&lt;!-- Entire Viewport --&gt;
&lt;h1&gt;Entire Viewport&lt;/h1&gt;
&lt;div class="viewport"&gt;
	&lt;p&gt;Width &lt;code&gt;%&lt;/code&gt;&lt;/p&gt;
	&lt;div class="box-width percentage"&gt;100%&lt;/div&gt;
	&lt;p&gt;Width  &lt;code&gt;px&lt;/code&gt;&lt;/p&gt;
	&lt;div class="box-width pixel"&gt;200px&lt;/div&gt;
	&lt;p&gt;Width  &lt;code&gt;em&lt;/code&gt; &lt;small&gt;(based on 16px computed font-size)&lt;/small&gt;&lt;/p&gt;
	&lt;div class="box-width em"&gt;20em&lt;/div&gt;
	&lt;p&gt;Width  &lt;code&gt;rem&lt;/code&gt; &lt;small&gt;(based on 16px computed font-size of root element)&lt;/small&gt;&lt;/p&gt;
	&lt;div class="box-width em"&gt;20rem&lt;/div&gt;
&lt;/div&gt;

&lt;!-- Container 480px --&gt;
&lt;h1&gt;Container 480px&lt;/h1&gt;
&lt;div class="container"&gt;
	&lt;p&gt;Width &lt;code&gt;%&lt;/code&gt;&lt;/p&gt;
	&lt;div class="box-width percentage-half"&gt;50%&lt;/div&gt;
	&lt;div class="box-width percentage-full"&gt;100%&lt;/div&gt;
	&lt;p&gt;Width  &lt;code&gt;px&lt;/code&gt;&lt;/p&gt;
	&lt;div class="box-width pixel"&gt;200px&lt;/div&gt;
	&lt;p&gt;Width  &lt;code&gt;em&lt;/code&gt; &lt;small&gt;(based on 16px computed font-size)&lt;/small&gt;&lt;/p&gt;
	&lt;div class="box-width em"&gt;20em&lt;/div&gt;
	&lt;p&gt;Width  &lt;code&gt;rem&lt;/code&gt; &lt;small&gt;(based on 16px computed font-size of root element)&lt;/small&gt;&lt;/p&gt;
	&lt;div class="box-width em"&gt;20rem&lt;/div&gt;
&lt;/div&gt;

&lt;!-- Absolute Position --&gt;
&lt;h1&gt;Absolute Position&lt;/h1&gt;
&lt;div class="absolute-position"&gt;
	&lt;div class="box-width no-width"&gt;Based on content if width is not defined&lt;/div&gt;
  &lt;div class="box-width rem"&gt;&lt;/div&gt;
  &lt;div class="box-width em"&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;!-- Table Rows --&gt;
&lt;h1&gt;Table Rows :(&lt;/h1&gt;
&lt;table&gt;
	&lt;tr class="box-width row-percent"&gt;
		&lt;td&gt;%&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="box-width row-em"&gt;
		&lt;td&gt;em&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;</pre>
<pre class="scss">// ========================================
// Globals
// ========================================

html {
	background: #292a2b;
	color: #FFF;
}

.box-width {
	height: 50px;
	background: #e78629;
}


// ========================================
// Demo
// ========================================

.viewport {
	outline: 1px solid #ed862a;
	.box-width.percentage {
		width: 100%; // %
	}
  .box-width.pixel {
		width: 200px; // px
	}
	.box-width.em {
		width: 20em; // em
	}
	.box-width.em {
		width: 20rem; // rem
	}
}


// ========================================
// Container 480px
// ========================================

.container {
	outline: 1px solid #ed862a;
	width: 500px;
	.box-width.percentage-half {
		width: 50%; // half %
	}
	.box-width.percentage-full {
		width: 100%; // full %
	}
	.box-width.pixel {
		width: 200px; // px
	}
	.box-width.em {
		width: 20em; // em
	}
	.box-width.em {
		width: 20rem; // rem
	}
}


// ========================================
// Table Rows and Row Groups
// ========================================

.absolute-position {
  position: relative;
  .box-width.no-width { // width is calculated based on content
    outline: 1px solid black;
    position: absolute;
    top: 0;
    right: 0;
  }
}


// ========================================
// Table Rows and Row Groups
// ========================================

.box-width.row-percent {
	width: 50%;
}

.box-width.row-em {
	width: 20em;
}</pre>
<h3>Digging Deeper</h3>
<p>When using percentage (%) for width, authors must be aware that the percentage is based on the element&#8217;s parent, or in other words, the width of the containing block. If your parent is set at 480px &#8211; as demonstrated by our demo &#8211; then the percentage is based on that value. So in our case 50% of 480px leaves us with 240px as a computed pixel value.</p>
<p>Note that <code>width</code> applies to all elements except non-replaced or inline elements, table rows and row groups (i.e. <code>thead</code>, <code>tfoot</code> and <code>tbody</code>).</p>
<p>For absolutely positioned elements whose containing block is based on a block container element, the percentage is calculated with respect to the width of the padding box of that element.</p>
<p>Width is usable today as an animatable property.</p>
<pre class="html">&lt;div class="animating-width"&gt;hover to animate width using CSS Transitions&lt;/div&gt;</pre>
<pre class="css">html {
  background: #292a2b;
	color: #FFF;
}

// =========================================
// Width Animation Demo
// =========================================

.animating-width {
  background: #e78629;
  color: white;
  height: 100px;
  width: 50%;
  @include transition(.3s width ease-in-out); // the transition effect for hover
  &amp;:hover {
    cursor: pointer;
    width: 100%; // animating to full width on hover
  }
}</pre>
<h3>Keyword Values</h3>
<p>With some special keyword values, it is possible to define width (and/or height) according to the content of the element.</p>
<h4>min-content</h4>
<p>The <code>min-content</code> value is the smallest measure that would fit around its content if all <strong>soft wrap opportunities</strong> within the box were taken.</p>
<p>The best example for this kind of value is a properly written <code>figure</code> element:</p>
<pre class="html">&lt;figure&gt;
  &lt;img src="images/kitten.jpg" alt="" /&gt;
  &lt;figcaption&gt;What a lovely kitten we got there in this image which is encapsulted in a figure element. How dear, look how long this caption is!&lt;/figcaption&gt;
&lt;/figure&gt;</pre>
<p>Once we have applied some basic styles to this markup, we get:</p>
<pre class="html">&lt;figure&gt;
  &lt;img src="http://placekitten.com/400/200" alt="" /&gt;
  &lt;figcaption&gt;What a lovely kitten we got there in this image which is encapsulted in a figure element. How dear, look how long this caption is!&lt;/figcaption&gt;
&lt;/figure&gt;</pre>
<pre class="css">figure {
  margin: 1em auto;
  background: #EFEFEF;
  border: 1px solid rgba(0,0,0,.1);
  padding: 1em;
}

img {
  display: block;
}

figcaption {
  padding: 1em 0;
}</pre>
<p>If we wanted that figure element to essentially be the size of that image, so the text wraps at the edges of the image. We could float it left or right, because float will exhibit that same kind of shrink-to-fit behavior, but what if we wanted to center it? <code>min-content</code> allows us to center it:</p>
<pre class="html">&lt;figure&gt;
  &lt;img src="http://placekitten.com/400/200" alt="" /&gt;
  &lt;figcaption&gt;What a lovely kitten we got there in this image which is encapsulted in a figure element. How dear, look how long this caption is!&lt;/figcaption&gt;
&lt;/figure&gt;</pre>
<pre class="css">figure {
  width: -webkit-min-content;
  width: -moz-min-content;
  width: min-content;
  margin: 1em auto;
  background: #EFEFEF;
  border: 1px solid rgba(0,0,0,.1);
  padding: 1em;
}

img {
  display: block;
}

figcaption {
  padding: 1em 0;
}</pre>
<p>Because we&#8217;ve assigned <code>min-content</code> to the <code>figure</code> element, it takes the minimum width it can have when taking all soft wrap opportunities (like spaces between words) so that the content still fits in the box.</p>
<h4>max-content</h4>
<p>The <code>max-content</code> property refers to the narrowest measure a box could take while fitting around its content &#8211; if no soft wrap opportunities within the element were taken.</p>
<p>Check out what happens if we apply this to our simple kitten/figure demo:</p>
<pre class="html">&lt;figure&gt;
  &lt;img src="http://placekitten.com/400/200" alt="" /&gt;
  &lt;figcaption&gt;What a lovely kitten we got there in this image which is encapsulted in a figure.&lt;/figcaption&gt;
&lt;/figure&gt;</pre>
<pre class="css">figure {
  width: -webkit-max-content;
  width: -moz-max-content;
  width: max-content;
  margin: 1em auto;
  background: #EFEFEF;
  border: 1px solid rgba(0,0,0,.1);
  padding: 1em;
}

img {
  display: block;
}

figcaption {
  padding: 1em 0;
}</pre>
<p>Because the caption is very longer than the image is wide (it doesn&#8217;t take any soft wrap opportunity, like the spaces between words), it means it has to display the caption on a single line, thus the <code>figure</code> is as wide as that line.</p>
<h4>fill-available</h4>
<p>???. One of life&#8217;s great mysteries.</p>
<h4>fit-content</h4>
<p>The <code>fit-content</code> value is roughly equivalent to <code>margin-left: auto</code> and <code>margin-right: auto</code> in behaviour, except it works for unknown widths.</p>
<p>For instance, let&#8217;s say we need to center an inline navigation across the page. Your best bet would be to apply <code>text-align: center</code> to the <code>ul</code>, and <code>display: inline-block</code> to the <code>li</code>. This would give you something like this:</p>
<pre class="html">&lt;ul&gt;
  &lt;li&gt;Home&lt;/li&gt;
  &lt;li&gt;News&lt;/li&gt;
  &lt;li&gt;About&lt;/li&gt;
  &lt;li&gt;Contact&lt;/li&gt;
&lt;/ul&gt;</pre>
<pre class="css">ul {
  background: deepskyblue;
  padding: 1em;
  text-align: center;
}

li {
  display: inline-block;
  background: tomato;
  padding: .5em;
}</pre>
<p>However, the blue background (from the <code>ul</code> element) spreads across the entire document because the <code>ul</code> is a block-level element, which means its width is restricted only by its containing element. What if we want to have the blue background collapsing around the list items? <code>fit-content</code> to the rescue!</p>
<pre class="html">&lt;ul&gt;
  &lt;li&gt;Home&lt;/li&gt;
  &lt;li&gt;News&lt;/li&gt;
  &lt;li&gt;About&lt;/li&gt;
  &lt;li&gt;Contact&lt;/li&gt;
&lt;/ul&gt;</pre>
<pre class="css">ul {
  background: deepskyblue;
  padding: 1em;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  margin: 1em auto;
}

li {
  display: inline-block;
  background: tomato;
  padding: .5em;
}</pre>
<p>With <code>fit-content</code> and <code>margin: 1em auto</code>, this works like a charm and only the navigation has a colored background, not the whole document width.</p>
<p>If you&#8217;re into this sort of thing, you&#8217;ll be happy to know the formula to define the size of a fit-content length is:</p>
<pre>fit-content = min(max-content, max(min-content, fill-available))</pre>
<p>This is a pretty unused value, so if you come up with a great use-case, let use know!</p>
<h3>Related Properties</h3>
<ul>
<li><a title="height" href="http://csspark.com/docs/css/properties/h-properties/height/"><code>height</code></a></li>
<li><a title="min-width" href="http://csspark.com/docs/css/properties/m-properties/min-width/">min-width</a></li>
<li><a title="max-width" href="http://csspark.com/docs/css/properties/m-properties/max-width/">max-width</a></li>
</ul>
<h3 id="browser-support">Browser Support</h3>
<h4>For normal length values (e.g. px)</h4>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Chrome</th>
<th>Safari</th>
<th>Firefox</th>
<th>Opera</th>
<th>IE</th>
<th>Android</th>
<th>iOS</th>
</tr>
</thead>
<tbody>
<tr>
<td>Yep</td>
<td>Yep</td>
<td>Yep</td>
<td>Yep</td>
<td>Yep</td>
<td>Yep</td>
<td>Yep</td>
</tr>
</tbody>
</table>
<p>If authors choose <code>rem</code> units for width, be mindful that this unit of measurement is not supported in versions of IE 8 and below.</p>
<h4>For <code>min-width</code> and <code>max-width</code></h4>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Chrome</th>
<th>Safari</th>
<th>Firefox</th>
<th>Opera</th>
<th>IE</th>
<th>Android</th>
<th>iOS</th>
</tr>
</thead>
<tbody>
<tr>
<td data-browser-name="Chrome">24+</td>
<td data-browser-name="Safari">5.1+</td>
<td data-browser-name="Firefox">18+</td>
<td data-browser-name="Opera">12.1+</td>
<td data-browser-name="IE">8+</td>
<td data-browser-name="Android">2.1+</td>
<td data-browser-name="iOS">3.2+</td>
</tr>
</tbody>
</table>
<h4>For the keyword values</h4>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th></th>
<th align="center">Chrome</th>
<th align="center">Firefox</th>
<th align="center">Internet Explorer</th>
<th align="center">Opera</th>
<th align="center">Safari</th>
<th align="center">iOS</th>
<th align="center">Android</th>
</tr>
</thead>
<tbody>
<tr>
<td>min-content</td>
<td align="center">Yep</td>
<td align="center">Yep</td>
<td align="center">Nope</td>
<td align="center">15+</td>
<td align="center">6.1</td>
<td align="center">7</td>
<td align="center">4.4</td>
</tr>
<tr>
<td>max-content</td>
<td align="center">Yep</td>
<td align="center">Yep</td>
<td align="center">Nope</td>
<td align="center">15+</td>
<td align="center">6.1</td>
<td align="center">7</td>
<td align="center">4.4</td>
</tr>
<tr>
<td>fill-available</td>
<td align="center">Yep</td>
<td align="center">Kinda</td>
<td align="center">Nope</td>
<td align="center">15+</td>
<td align="center">6.1</td>
<td align="center">7</td>
<td align="center">4.4</td>
</tr>
<tr>
<td>fit-content</td>
<td align="center">Yep</td>
<td align="center">Yep</td>
<td align="center">Nope</td>
<td align="center">15+</td>
<td align="center">6.1</td>
<td align="center">7</td>
<td align="center">4.4</td>
</tr>
</tbody>
</table>
<ul>
<li>All values need to be prefixed by either <code>-webkit-</code> or <code>-moz-</code> (depending on the vendor)</li>
<li><em>Kinda</em> for Firefox means it supports <code>available</code> rather than <code>fill-available</code></li>
</ul>
<h3>Prefixing with Sass</h3>
<p>The prefixing for these is a bit tricky, since only a few are required and they differ from browser to browser. Here is a Sass <code>@mixin</code> to help:</p>
<pre class="scss">@mixin intrinsic($property, $value) {
  @if $value == fit-content or $value == min-content or $value == max-content {
    #{$property}: -webkit-#{$value};
    #{$property}: -moz-#{$value};
    #{$property}: $value;
  }

  @else if $value == fill-available or $value == available {
    #{$property}: -webkit-fill-available;
    #{$property}: -moz-available;
    #{$property}: fill-available;
  }

  @else {
    #{$property}: $value;
  }
}</pre>
<p>And you can use it like this:</p>
<pre class="scss">.element {
  @include intrinsic(width, min-content);
}</pre>
<p>Which generates this CSS:</p>
<pre class="css">.element {
  width: -webkit-min-content;
  width: -moz-min-content;
  width: min-content;
}</pre>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/w/width/">width</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://csspark.com/docs/css/properties/w/width/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>widows</title>
		<link>https://csspark.com/docs/css/properties/w/widows/</link>
					<comments>https://csspark.com/docs/css/properties/w/widows/#respond</comments>
		
		<dc:creator><![CDATA[Renat]]></dc:creator>
		<pubDate>Wed, 17 Sep 2014 04:04:58 +0000</pubDate>
				<category><![CDATA[W]]></category>
		<guid isPermaLink="false">http://csspark.com/?p=966</guid>

					<description><![CDATA[<p>In typography terms, a widow is the last line of a paragraph that is left alone on a new page or in a new column. The widows property in CSS controls the minimum number of lines of a paragraph that can fall to a new page. This property only affects paged media such as print.</p>
<p><a class="more-link btn btn-default" href="https://csspark.com/docs/css/properties/w/widows/"> Continue reading →</a></p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/w/widows/">widows</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In typography terms, a widow is the last line of a paragraph that is left alone on a new page or in a new column. The <code>widows</code> property in CSS controls the minimum number of lines of a paragraph that can fall to a new page. This property only affects paged media such as <code>print</code>.</p>
<pre class="css">@media print {
  p {
    widows: 3;
  }
}</pre>
<p>If a paragraph can&#8217;t fit on one page in its entirety, it is split wherever it is possible. That way single lines of a paragraph can appear on page before it continues on the next page. This is usually unwanted so many word processors require at least two lines to be left on an old page, instead of one. The <code>orphan</code> property acts similar. You can give it either a positive number (where 2 is the default) or <code>inherit</code>.</p>
<p>Note that the <code>widows</code> property does not generally affect non-paged media such as <code>screen</code>. However, browsers supporting both <code>widows</code> and <a title="columns" href="http://csspark.com/docs/css/properties/c-properties/columns/"><code>columns</code></a> will apply the intended functionality to columns as well. Also, the property only affects block-level elements.</p>
<div class="explanation">In short, In CSS specifically:<br />
<code>widows</code> = minimum number of lines in a paragraph split on the <strong>new</strong> page.<br />
<code>orphans</code> = minimum number of lines in a paragraph split on the <strong>old</strong> page.</div>
<div class="explanation"><img decoding="async" loading="lazy" width="512" height="262" class="aligncenter size-full wp-image-967" src="http://csspark.com/wp-content/uploads/2014/09/widows.png" alt="The red lines are widows." srcset="https://csspark.com/wp-content/uploads/2014/09/widows.png 512w, https://csspark.com/wp-content/uploads/2014/09/widows-300x153.png 300w" sizes="(max-width: 512px) 100vw, 512px" /></p>
<h3>Related</h3>
<ul>
<li><a title="orphans" href="http://csspark.com/docs/css/properties/o-properties/orphans/">orphans</a></li>
</ul>
<h3 id="browser-support">Browser Support</h3>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Chrome</th>
<th>Safari</th>
<th>Firefox</th>
<th>Opera</th>
<th>IE</th>
<th>Android</th>
<th>iOS</th>
</tr>
</thead>
<tbody>
<tr>
<td data-browser-name="Chrome">25+</td>
<td data-browser-name="Safari">None</td>
<td data-browser-name="Firefox">None</td>
<td data-browser-name="Opera">9.2+</td>
<td data-browser-name="IE">8+</td>
<td data-browser-name="Android">None</td>
<td data-browser-name="iOS">None</td>
</tr>
</tbody>
</table>
</div>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/w/widows/">widows</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://csspark.com/docs/css/properties/w/widows/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>white-space</title>
		<link>https://csspark.com/docs/css/properties/w/white-space/</link>
					<comments>https://csspark.com/docs/css/properties/w/white-space/#respond</comments>
		
		<dc:creator><![CDATA[Renat]]></dc:creator>
		<pubDate>Wed, 17 Sep 2014 04:03:12 +0000</pubDate>
				<category><![CDATA[W]]></category>
		<guid isPermaLink="false">http://csspark.com/?p=959</guid>

					<description><![CDATA[<p>The white-space property controls how text is handled on the element it is applied to. Let&#8217;s say you have HTML exactly like this: &#60;div&#62; A bunch of words you see. &#60;/div&#62; You&#8217;ve styled the div to have a set width of 100px. At a reasonable font size, that&#8217;s too much text to fit in 100px.</p>
<p><a class="more-link btn btn-default" href="https://csspark.com/docs/css/properties/w/white-space/"> Continue reading →</a></p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/w/white-space/">white-space</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The white-space property controls how text is handled on the element it is applied to. Let&#8217;s say you have HTML <em>exactly</em> like this:</p>
<pre class="css">&lt;div&gt;
   A bunch of words you see.
&lt;/div&gt;</pre>
<p>You&#8217;ve styled the div to have a set width of 100px. At a reasonable font size, that&#8217;s too much text to fit in 100px. Without doing anything, the default <code>white-space</code> value is <code>normal</code>, and the text will wrap. See the example below.</p>
<pre class="css">div {
  /* This is the default, you don't need to
     explicitly declare it unless overriding
     another declaration */
  white-space: normal; 
}</pre>
<img decoding="async" loading="lazy" width="143" height="82" class="aligncenter size-full wp-image-960" src="http://csspark.com/wp-content/uploads/2014/09/normal.png" alt="normal" />
<p>If you want to prevent the text from wrapping, you can apply <code>white-space: nowrap;</code></p>
<img decoding="async" loading="lazy" width="212" height="63" class="aligncenter size-full wp-image-961" src="http://csspark.com/wp-content/uploads/2014/09/nowrap.png" alt="nowrap" />
<p>Notice in HTML code example at the top of this article, there are actually two line breaks, one before the line of text and one after, which allow the text to be on its own line (in the code). When the text renders in the browser, those line breaks appear as if they are stripped out. Also stripped out are the extra spaces on the line before the first letter. If we want to force the browser to display those line breaks and extra white space characters we can use <code>white-space: pre;</code></p>
<img decoding="async" loading="lazy" width="290" height="97" class="aligncenter size-full wp-image-962" src="http://csspark.com/wp-content/uploads/2014/09/pre.png" alt="pre" />
<p>It&#8217;s called <code>pre</code> because the behavior is that as if you had wrapped the text in <code>&lt;pre&gt;&lt;/pre&gt;</code> tags (which by default handle white space and line breaks that way). White space is honored exactly as it is in the HTML and the text does not wrap until a line break is present in the code. This is particularly useful when literally displaying code, which benefits aesthetically from some formatting (and some time is absolutely crucial, as in white space dependent languages!)</p>
<p>Perhaps you like how <code>pre</code> honors white space and breaks, but you need the text to wrap instead of potentially break out of its parent container. That&#8217;s what <code>white-space: pre-wrap;</code> is for:</p>
<img decoding="async" loading="lazy" width="140" height="132" class="aligncenter size-full wp-image-963" src="http://csspark.com/wp-content/uploads/2014/09/pre-wrap.png" alt="pre-wrap" />
<p>Finally, <code>white-space: pre-line;</code> will break lines where they break in code, but extra white space is still stripped.</p>
<img decoding="async" loading="lazy" width="146" height="93" class="aligncenter size-full wp-image-964" src="http://csspark.com/wp-content/uploads/2014/09/pre-line.png" alt="pre-line" />
<p>Interestingly, the final line break is not honored. As per the CSS 2.1 spec: &#8220;Lines are broken at preserved newline characters, and as necessary to fill line boxes.&#8221; so perhaps that makes sense.</p>
<p>Here is a table to understand the behaviors of all the different values:</p>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th></th>
<th>New lines</th>
<th>Spaces and tabs</th>
<th>Text wrapping</th>
</tr>
</thead>
<tbody>
<tr>
<th>normal</th>
<td>Collapse</td>
<td>Collapse</td>
<td>Wrap</td>
</tr>
<tr>
<th>pre</th>
<td>Preserve</td>
<td>Preserve</td>
<td>No wrap</td>
</tr>
<tr>
<th>nowrap</th>
<td>Collapse</td>
<td>Collapse</td>
<td>No wrap</td>
</tr>
<tr>
<th>pre-wrap</th>
<td>Preserve</td>
<td>Preserve</td>
<td>Wrap</td>
</tr>
<tr>
<th>pre-line</th>
<td>Preserve</td>
<td>Collapse</td>
<td>Wrap</td>
</tr>
</tbody>
</table>
<p>In CSS3, the <code>white-space</code> property is literally going to follow that chart and map the properties to <code>text-space-collapse</code> and <code>text-wrap</code> accordingly.</p>
<h3 id="browser-support">Browser Support</h3>
<p>Little more complex than the regular support table, since each value has different levels of support:</p>
<table class="table table-bordered table-condensed">
<tbody>
<tr>
<th>Browser</th>
<th>Version</th>
<th>Support of</th>
</tr>
<tr>
<td rowspan="3">Internet Explorer</td>
<td>5.5</td>
<td><code>normal | nowrap</code></td>
</tr>
<tr>
<td>6.0</td>
<td><code>normal | pre | nowrap</code></td>
</tr>
<tr>
<td>8+</td>
<td><code>normal | pre | nowrap | pre-wrap | pre-line</code></td>
</tr>
<tr>
<td rowspan="3">Firefox (Gecko)</td>
<td>1.0 (1.0)</td>
<td><code>normal | pre | nowrap | -moz-pre-wrap</code></td>
</tr>
<tr>
<td>3.0 (1.9)</td>
<td><code>normal | pre | nowrap | pre-wrap | -moz-pre-wrap</code></td>
</tr>
<tr>
<td>3.5 (1.9.1)</td>
<td><code>normal | pre | nowrap | pre-wrap | pre-line</code></td>
</tr>
<tr>
<td rowspan="3">Opera</td>
<td>4.0</td>
<td><code>normal | pre | nowrap</code></td>
</tr>
<tr>
<td>8.0</td>
<td><code>normal | pre | nowrap | pre-wrap</code></td>
</tr>
<tr>
<td>9.5</td>
<td><code>normal | pre | nowrap | pre-wrap | pre-line</code></td>
</tr>
<tr>
<td rowspan="2">Safari (WebKit)</td>
<td>1.0 (85)</td>
<td><code>normal | pre | nowrap</code></td>
</tr>
<tr>
<td>3.0 (522)</td>
<td><code>normal | pre | nowrap | pre-wrap | pre-line</code></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/w/white-space/">white-space</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://csspark.com/docs/css/properties/w/white-space/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>visibility</title>
		<link>https://csspark.com/docs/css/properties/v-properties/visibility/</link>
					<comments>https://csspark.com/docs/css/properties/v-properties/visibility/#respond</comments>
		
		<dc:creator><![CDATA[Renat]]></dc:creator>
		<pubDate>Wed, 17 Sep 2014 03:59:29 +0000</pubDate>
				<category><![CDATA[V]]></category>
		<guid isPermaLink="false">http://csspark.com/?p=956</guid>

					<description><![CDATA[<p>The visibility property in CSS has two different functions. It hides rows and columns of a table, and it also hides an element *without changing the layout*. p { visibility: hidden; } tr { visibility: collapse; } visibility has four valid values: visible, hidden, collapse, and inherit. We’ll go through each of them to learn</p>
<p><a class="more-link btn btn-default" href="https://csspark.com/docs/css/properties/v-properties/visibility/"> Continue reading →</a></p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/v-properties/visibility/">visibility</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The <code>visibility</code> property in CSS has two different functions. It hides rows and columns of a table, and it also hides an element *without changing the layout*.</p>
<pre class="css">p {
  visibility: hidden;
}
tr {
  visibility: collapse;
}</pre>
<p><code>visibility</code> has four valid values: <code>visible</code>, <code>hidden</code>, <code>collapse</code>, and <code>inherit</code>. We’ll go through each of them to learn more.</p>
<h4>visible</h4>
<p>Just like it sounds, <code>visible</code> makes things visible. Nothing is hidden by default, so this value does nothing unless you have set <code>hidden</code> on this or a parent of this element.</p>
<h4>hidden</h4>
<p>The <code>hidden</code> value hides things. This is different than using <code>display: none</code>, because <code>hidden</code>only <em>visually</em> hides elements. The element is still there, and still takes up space on the page, but you can’t see it anymore (kind of like turning the opacity to 0). Interestingly, this property does not inherit by default. That means that, unlike the <code>display</code> or <code>opacity</code> properties, you can make an element <code>hidden</code>, and still have one of its children as <code>visible</code>, like this:</p>
<pre class="html">&lt;div class="hidden"&gt;
  Hi, I'm hidden. Notice that all of my styling is hidden as well, and that I still take up space, even though you can't see me.
  &lt;div class="visible"&gt;
    Howdy, my parent element is hidden, but I'm still visible. &lt;br&gt;Hover over me to make my parent visible.
  &lt;/div&gt;
&lt;/div&gt;</pre>
<pre class="scss">.hidden {
  visibility: hidden;
  background: pink;
  border: 10px dotted teal;
  padding: 10px;
  &amp;:hover {
    visibility: visible;
  }
}
.visible {
  border: 1px solid black;
  visibility: visible;
}</pre>
<p>Notice that, while hidden, the parent element doesn&#8217;t trigger the <code>:hover</code>.</p>
<h4>collapse</h4>
<p>This one only effects table rows (<code>&lt;tr&gt;</code>), row groups (like <code>&lt;tbody&gt;</code>), columns (<code>&lt;col&gt;</code>), column groups (<code>&lt;colgroup&gt;</code>), or elements made to be that way via <code><a title="display" href="http://csspark.com/docs/css/properties/d-properties/display/">display</a></code>). Unlike <code>hidden</code>, this value hides the table sub element, without leaving the space where it was. If used anywhere but on a table sub element, it acts like <code>visibility: hidden</code>.</p>
<p>There are so many quirks with this it&#8217;s hard to know where to begin. Just as an appetizer:</p>
<ul>
<li>Chrome/Safari will collapse a row, but the space it occupied will remain. And if the table cells inside had a border, that will collapse into a single border along the top edge.</li>
<li>Chrome/Safari will not collapse a column or column group.</li>
<li>Safari collapse a table cell (wrong) but Chrome will not (right).</li>
<li>In any browser, if a cell is in a column that is collapsed (whether or not it actually collapses) the text in that cell will not be displayed.</li>
<li>Opera (pre WebKit) will collapse the crap out of everything, except a table cell (which is correct).</li>
</ul>
<p>There is more, but basically: <strong>don&#8217;t use this ever.</strong></p>
<h4>inherit</h4>
<p>The default value. This simply causes the element to inherit the value of its parent.</p>
<h3>Flexbox</h3>
<p><code>visibility: collapse;</code> is used in Flexbox as well, and more well definied (and presumably implemented but I haven&#8217;t tested yet).</p>
<h3>Related Properties</h3>
<ul>
<li><a title="display" href="http://csspark.com/docs/css/properties/d-properties/display/">The <code>display</code> property</a></li>
<li><a title="opacity" href="http://csspark.com/docs/css/properties/o-properties/opacity/">The <code>opacity</code> property</a></li>
</ul>
<h3 id="browser-support">Browser Support</h3>
<p>The basics, not considering all the quirks with collapse:</p>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Chrome</th>
<th>Safari</th>
<th>Firefox</th>
<th>Opera</th>
<th>IE</th>
<th>Android</th>
<th>iOS</th>
</tr>
</thead>
<tbody>
<tr>
<td data-browser-name="Chrome">Any</td>
<td data-browser-name="Safari">Any</td>
<td data-browser-name="Firefox">Any</td>
<td data-browser-name="Opera">4+</td>
<td data-browser-name="IE">4+</td>
<td data-browser-name="Android">Any</td>
<td data-browser-name="iOS">Any</td>
</tr>
</tbody>
</table>
<p>IE 7- doesn’t support <code>collapse</code> or <code>inherit</code>.</p>
<p>The post <a rel="nofollow" href="https://csspark.com/docs/css/properties/v-properties/visibility/">visibility</a> appeared first on <a rel="nofollow" href="https://csspark.com">CSS Park</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://csspark.com/docs/css/properties/v-properties/visibility/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
