<?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 tipps &#8211; Blackbams Blog</title>
	<atom:link href="https://blog.blackbam.at/tag/css-tipps/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.blackbam.at</link>
	<description>development - digital arts - internet</description>
	<lastBuildDate>Wed, 05 Oct 2011 17:45:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
	<item>
		<title>Some useful tipps for CSS development</title>
		<link>https://blog.blackbam.at/2010/12/16/some-tipps-for-better-css/</link>
					<comments>https://blog.blackbam.at/2010/12/16/some-tipps-for-better-css/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Wed, 15 Dec 2010 23:58:16 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CSS Sprites]]></category>
		<category><![CDATA[CSS tipps]]></category>
		<category><![CDATA[font-face]]></category>
		<category><![CDATA[LessCSS]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://www.blackbam.at/blog/?p=1008</guid>

					<description><![CDATA[Recently I was confronted with some lectures about certain topics relating to Cascading Stylesheets. I decided to write a short summary to remember and use these things as I need them in future projects. 1. CSS-Sprites CSS-Sprites are the idea of using one large as background for multiple graphics on a web page. Relative positioning [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><br class="spacer_" /></p>
<p>Recently I was confronted with some lectures about certain topics relating to Cascading Stylesheets. I decided to write a short summary to remember and use these things as I need them in future projects.</p>
<p><br class="spacer_" /></p>
<h2>1. CSS-Sprites</h2>
<p>CSS-Sprites are the idea of using one large as background for multiple graphics on a web page. Relative positioning of the background always guarantees that the correct part of the &#8220;master image&#8221; is displayed.</p>
<p><br class="spacer_" /></p>
<h4>Example of Sprites</h4>
<p>(only the correct button is displayed on the page).</p>
<p><br class="spacer_" /></p>
<p><img decoding="async" src="file:///C:/Users/Blackbam/AppData/Local/Temp/moz-screenshot-2.png" alt="" /></p>
<p><a rel="attachment wp-att-1013" href="https://blog.blackbam.at/2010/12/16/some-tipps-for-better-css/sprites/"><img decoding="async" class="alignnone size-full wp-image-1013" title="CSS-Sprites" src="https://blog.blackbam.at/wp-content/uploads/2010/12/sprites.png" alt="" width="160" height="121" /></a></p>
<p><br class="spacer_" /></p>
<h4>Why use CSS-sprites?</h4>
<ul>
<li>the performance of a site with high traffic is much better</li>
<li>there is only one HTTP-Request required, instead of many (also a performance thing)</li>
<li>changing the design can be much faster, if there is only one image (imagine you have to build a lot of child theme sites)</li>
</ul>
<p><br class="spacer_" /></p>
<h4>Disadvantages</h4>
<ul>
<li>can become complex if over-used or with big webpages</li>
<li>problems with dynamic layouts, if there are changes on the site (be careful)</li>
</ul>
<p><br class="spacer_" /></p>
<h4>Implementation</h4>
<pre lang="CSS">background-position: 123px 123px;

</pre>
<h4>Further instructions and examples</h4>
<p><a href="http://www.css-tricks.com/date-display-with-sprites/">http://www.css-tricks.com/date-display-with-sprites/</a></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h2>2. Less CSS</h2>
<p>Less CSS is a project to use variables, mixins, nested options and nested rules with CSS (Why is this not possible with native CSS?) It is an interresting way to simplify and speed up CSS development.</p>
<p><br class="spacer_" /></p>
<p><strong>Example</strong></p>
<p><br class="spacer_" /></p>
<pre lang="CSS">/* variables */
@brand_color: #4D926F;

#header {
  color: @brand_color;
}

h2 {
  color: @brand_color;
}

/* mixins */
.rounded_corners (@radius: 5px) {
  -moz-border-radius: @radius;
  -webkit-border-radius: @radius;
  border-radius: @radius;
}

#header {
  .rounded_corners;
}

#footer {
  .rounded_corners(10px);
}

/* nested rules */
#header {
  color: red;
  a {
    font-weight: bold;
    text-decoration: none;
  }
}

/* operations */
@the-border: 1px;
@base-color: #111;

#header {
  color: @base-color * 3;
  border-left: @the-border;
  border-right: @the-border * 2;
}

#footer {
  color: (@base-color + #111) * 1.5;
}
</pre>
<p><br class="spacer_" /></p>
<h4>Why use CSS-sprites?</h4>
<p>Because they faster and cleaner CSS development is possible, with even more possibilities. The CSS must be interpreted by Javascript or PHP before it is usable by a browser &#8211; of course this is a performance desaster &#8211; but you can use one-time interpreted CSS for your project in the end, so there is no need to do this on a running website!</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h4>Implementation and further instructions</h4>
<p><a href="http://lesscss.org/">http://lesscss.org/</a></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Recently I was confronted with some lectures about certain topics  relating to Cascading Stylesheets. I decided to write a short summary to  remember and use these things as I need them in future projects.</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h2>3. Use Cross-Browser @font-face</h2>
<p>@font-face is an very old CSS property, which makes it possible, to use any font on a website, which you want to (as long as you have the rights to do this). This is less work to do than using images and much more interresting than only using the standard fonts.</p>
<p><br class="spacer_" /></p>
<h4>Example of @font-face</h4>
<p>You can also use exotic fonts as normal (robot readable) fonts on a website, like this:</p>
<p><br class="spacer_" /></p>
<p><a rel="attachment wp-att-1034" href="https://blog.blackbam.at/2010/12/16/some-tipps-for-better-css/font-face-exmaple-sears-tower/"><img decoding="async" class="alignnone size-medium wp-image-1034" title="font-face-exmaple-sears-tower" src="https://blog.blackbam.at/wp-content/uploads/2010/12/font-face-exmaple-sears-tower-450x77.png" alt="" width="264" height="45" srcset="https://blog.blackbam.at/wp-content/uploads/2010/12/font-face-exmaple-sears-tower-450x77.png 450w, https://blog.blackbam.at/wp-content/uploads/2010/12/font-face-exmaple-sears-tower.png 508w" sizes="(max-width: 264px) 100vw, 264px" /></a><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><img decoding="async" src="file:///C:/Users/Blackbam/AppData/Local/Temp/moz-screenshot-2.png" alt="" /></p>
<p><br class="spacer_" /></p>
<h4>Why use @font-face?</h4>
<ul>
<li>individual websites with artistic elements can use normal text</li>
</ul>
<p><br class="spacer_" /></p>
<h4>Disadvantages</h4>
<ul>
<li>implementation and conversion may cost some extra minutes</li>
<li>maybe legal problems with commercial fonts</li>
</ul>
<ul>
<p><br class="spacer_" /></p>
</ul>
<h4>Implementation</h4>
<p>For cross-browser implementation, you have to provide your font in at least 3 formats currently &#8211;  EOT,WOFF and TTF.</p>
<p><br class="spacer_" /></p>
<pre lang="CSS">@font-face {
  font-family: 'WebFont';
  src: url('myfont.eot');  /* IE6-8 */
  src: local('☺'),
        url('myfont.woff') format('woff'),  /* FF3.6, IE9 */
        url('myfont.ttf') format('truetype');  /* Saf3+,Chrome,FF3.5,Opera10+ */
}

h1 {
  font-family:'WebFont',Arial,Helvetica,sans-serif;
}
</pre>
<h4>Further instructions and examples</h4>
<p><a href="http://www.font2web.com/">http://www.font2web.com/</a> (convertes a font from one font format to all expected formats)</p>
<p><a href="http://www.fontsquirrel.com/">http://www.fontsquirrel.com/</a> (a lot of FREE fonts to use with your web project)</p>
<p><a href="http://paulirish.com/2009/fighting-the-font-face-fout/">http://paulirish.com/2009/fighting-the-font-face-fout/</a> (prevent Firefox to show the wrong font, solve a lot of forther problems)</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>This might list might be continued&#8230;<br class="spacer_" /></p>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2010%2F12%2F16%2Fsome-tipps-for-better-css%2F&#038;title=Some%20useful%20tipps%20for%20CSS%20development" data-a2a-url="https://blog.blackbam.at/2010/12/16/some-tipps-for-better-css/" data-a2a-title="Some useful tipps for CSS development"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2010/12/16/some-tipps-for-better-css/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
