
<?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/"
	>

<channel>
	<title>Blogging CSS</title>
	<atom:link href="http://www.bloggingcss.com/en/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bloggingcss.com/en</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Sun, 02 Aug 2009 16:54:38 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Jason Santa Maria, a unique style for each post</title>
		<link>http://www.bloggingcss.com/en/css-websites/jason-santa-maria-a-unique-style-for-each-post/</link>
		<comments>http://www.bloggingcss.com/en/css-websites/jason-santa-maria-a-unique-style-for-each-post/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 16:54:09 +0000</pubDate>
		<dc:creator>grazz</dc:creator>
		
		<category><![CDATA[Css Websites]]></category>

		<category><![CDATA[blog]]></category>

		<category><![CDATA[footer]]></category>

		<category><![CDATA[jason santa maria]]></category>

		<category><![CDATA[sidebar]]></category>

		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://www.bloggingcss.com/en/?p=188</guid>
		<description><![CDATA[http://jasonsantamaria.com
There are no other blogs such as Jason Santa Maria&#8217;s one. It looks like each post belongs to a different blog. You click &#8220;prev&#8221; to go to a previous post and when you see it you wonder: &#8220;Am I still on the same blog?&#8221;. Yes, you&#8217;re on the same blog.
As the author himself says, this [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-188"></span><a href="http://jasonsantamaria.com/" target="_blank">http://jasonsantamaria.com</a></p>
<p>There are no other blogs such as Jason Santa Maria&#8217;s one. It looks like each post belongs to a different blog. You click &#8220;prev&#8221; to go to a previous post and when you see it you wonder: &#8220;Am I still on the same blog?&#8221;. Yes, you&#8217;re on the same blog.</p>
<p>As the author himself says, this blog is an <strong>experiment</strong>: Santa Maria - a truly web design guru - has developed a system that allows him to apply a different style to each post of his blog. Colors, images, fonts, layout - everything changes. </p>
<p>Each article in magazines (the ones made with paper, do you remember about them?) has a different look, why shouldn&#8217;t this be possible for blogs too, Santa Maria wondered. And then he went and found a way to style each post in a unique way to consistently support the content. Here is a few screenshots:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/2009/06/santa-maria-2.png" alt="Il blog di Jason Santa Maria" title="Il blog di Jason Santa Maria" width="658" height="362" class="size-full wp-image-854" /></p>
<div class="clear"></div>
<div class="clear"></div>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/2009/06/santa-maria-3.png" alt="Il blog di Jason Santa Maria" title="Il blog di Jason Santa Maria" width="658" height="362" class="size-full wp-image-855" /></p>
<div class="clear"></div>
<div class="clear"></div>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/2009/06/santa-maria-5.png" alt="Il blog di Jason Santa Maria" title="Il blog di Jason Santa Maria" width="658" height="362" class="size-full wp-image-857" /></p>
<div class="clear"></div>
<div class="clear"></div>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/2009/06/santa-maria-4.png" alt="Il blog di Jason Santa Maria" title="Il blog di Jason Santa Maria" width="658" height="362" class="size-full wp-image-856" /></p>
<p>Isn&#8217;t it <strong>amazing</strong>? </p>
<h2>There&#8217;s more&#8230;</h2>
<p>Jason Santa Maria&#8217;s blog is inspirational for other several reasons, such as a <strong>rich and informative footer</strong> and the use of <strong>beautiful typography</strong> (if you are wondering, the condensed font he used is <a href="http://new.myfonts.com/fonts/linotype/trade-gothic/" target="_blank">Trade Gothic Bold</a>). Oh, and did you notice <strong>there is no sidebar</strong>? </p>
<h2>So, what do you think?</h2>
<p>If you&#8217;re into web design you had most probably already seen Jason Santa Maria&#8217;s blog, but I just couldn&#8217;t not write about it. I mean, isn&#8217;t it the most inspirational blog you&#8217;ve ever seen? <strong>Share your thoughts in the comments</strong>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggingcss.com/en/css-websites/jason-santa-maria-a-unique-style-for-each-post/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CSS Menus With Images - CSS Sprites</title>
		<link>http://www.bloggingcss.com/en/tutorials/css-menus-with-images-css-sprites/</link>
		<comments>http://www.bloggingcss.com/en/tutorials/css-menus-with-images-css-sprites/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 16:39:32 +0000</pubDate>
		<dc:creator>grazz</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[background-image]]></category>

		<category><![CDATA[background-position]]></category>

		<category><![CDATA[css sprites]]></category>

		<category><![CDATA[menu]]></category>

		<category><![CDATA[menus]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.bloggingcss.com/en/?p=109</guid>
		<description><![CDATA[In this tutorial I will show you how to build a CSS menu with images as menu items using a CSS tecnique that&#8217;s known with the name of CSS sprites. We&#8217;ll start from the graphic creation in Photoshop and then code it in HTML and CSS.
Before we start, you can:

see the CSS menu we&#8217;re going [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-109"></span>In this tutorial I will show you how to build a CSS menu with images as menu items using a CSS tecnique that&#8217;s known with the name of <strong>CSS sprites</strong>. We&#8217;ll start from the graphic creation in Photoshop and then code it in HTML and CSS.</p>
<p>Before we start, you can:</p>
<ul>
<li><a href="http://www.bloggingcss.com/wp-content/uploads/css-sprite/css-sprite/index.html">see the CSS menu we&#8217;re going to build</a></li>
<li><a href="http://www.bloggingcss.com/wp-content/uploads/css-sprite/css-sprite.rar">download the source files</a> (Photoshop file included)</li>
</ul>
<p><strong>Warning</strong>: if the download link doesn&#8217;t work, please <a href="mailto:bloggingcss@gmail.com">send me an e-mail</a> so I can fix it. Thanks in advance ;)</p>
<h2>Why Build a Menu With Images?</h2>
<p>The answer is obvious: <strong>to do things you couldn&#8217;t do with plain text</strong>, like using a texture, a non web-safe font or to create a little more sophisticated hover effect. </p>
<h2>CSS Sprites</h2>
<p>The best way to build a menu with images is by using a CSS tecnique called <strong>CSS sprites</strong>. This tecnique consists in using <strong>combined images</strong>; in the specific case of menus, the CSS sprite combines the graphic images of both the link&#8217;s normal state and the hover state. </p>
<p>Why is it convenient to combine two images together? For one, it helps stay us organized (by using CSS sprites we need half of the images we would need by not using them), but more importantly <strong>it cuts in half the number of requests sent to the server</strong>, reducing the overall time it takes for the page to load. </p>
<h2>The Photoshop File</h2>
<p>Open a new document at 800&#215;400px. Our menu will be smaller, but let&#8217;s keep some extra space for our convenience.</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-1.jpg" alt="New document in Photoshop" class="margbot" />
<div class="break"></div>
<h2>Menu Background</h2>
<p>Select the <strong>Rectangular Marquee</strong> tool from the toolbar, then choose <strong>Fixed Size</strong> from the Style dropdown menu in the tool options bar. Choose 550px for the width and 50px for the height. This will be the menu size.</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-2.jpg" alt="Select the Rectangular Marquee tool" class="margbot" /> </p>
<p>Add a new layer by going to Levels > New > Level or clicking on the second icon from the right at the bottom of the Layer palette. Now click anywhere on the document canvas to get a 550&#215;50px rectangular selection. It&#8217;s not necessary that it&#8217;s perfectly centered but try to go for the center anyway. Create <strong>guides</strong> around the selection.</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-3.png" alt="Create guides around the selection" class="margbot" /></p>
<p>Choose a color for the menu background. I went for a dark brown (#514537). Select the <strong>Rounded Rectangle</strong> tool and make sure that the <strong>Shape Layers</strong> mode is selected in the tool options bar.</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-4.png" alt="New Shape Layer: a rounded rectangle" class="margbot" /> </p>
<p>While the rounded rectangle tool is selected, place the cursor over the top left corner of the rectangle created by the four guides, then drag towards the opposite bottom right corner. You should get something like this:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-5.png" alt="Create the background menu" class="margbot" /> </p>
<p>This rectangle will work as the menu background. As a last touch, let&#8217;s apply a <strong>subtle gradient</strong>. Click twice over the rounded rectangle layer to get the <strong>Layer Styles</strong> window to pop up, and check the <strong>Gradient Overlay</strong> style in the left column. Click twice on the gradient colors bar, then choose the same color you used for the background as the two colors of the gradient, but make the second one lighter. </p>
<p>If you&#8217;re using the same brown I picked, choose a lighter brown (#71604d) as the second color. This is what you get: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-6.jpg" alt="Apply a gradient to the background menu" class="margbot" /> </p>
<p><strong>Remember</strong> that the secret to a good gradient is subtlety. Don&#8217;t you fade a midnight dark blue into a midday light blue or a vivid red into a pale pink. <strong>The second color must be just a little lighter than the first one</strong>. </p>
<h2>The Menu Items</h2>
<p>We can now take care of the menu items. Our menu has five items: Tutorial, Siti CSS, Risorse, Showcase and Offtopic (the items are in Italian because this is the translation of a tutorial previously written for the Italian blog. This should be no problem to your understanding though). </p>
<p>The menu is 550px wide, so each menu item&#8217;s width will be equal to 550 / 5 = 110px. Create a 110&#215;50px rectangular selection (the height is the same as the menu&#8217;s) and drag it to the top left corner of the menu background, then create a guide to its right: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-7.jpg" alt="A single menu item" class="margbot" /> </p>
<p>Do the same for each menu item until you will have created all necessary guides. <strong>Be pixel perfect while creating guides</strong>: this will be essential when we&#8217;ll slice the images later.</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-8.jpg" alt="All menu items" class="margbot" /> </p>
<p>Now for the items. Select the <strong>Type</strong> tool and choose a font you like; I picked a condensed font called <a href="http://www.dafont.com/search.php?psize=m&#038;q=bebas" target="_blank">Bebas</a>. Write the five menu items using font size and color appropriate to the background menu you&#8217;ve created. If you&#8217;re following my lead, select 18px as the font size and white as the color. </p>
<p>We want text to be perfectly centered in each of the five cells created by the guides. To do so, write the menu item, the Tutorial one for example. Create a new 110&#215;50px rectangular selection and place it exactly over the first cell until the selection perfectly snaps to the guides. Select then the <strong>Marquee</strong> tool from the toolbar (or by pressing V on the keyboard) and in the tool options bar click the <strong>Align Vertical Centers</strong> icon first and then the <strong>Align Horizontal Centers</strong> one (they&#8217;re highlighted in red in the following image):</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-10.jpg" alt="Vertical and horizontal alignment of menu items" class="margbot" /> </p>
<p>Doing so aligns the text at the center of the cell:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-11.jpg" alt="Vertical and horizontal alignment of menu items" class="margbot" /> </p>
<p>Repeat these same steps for each menu item. <strong>Tip</strong>: to avoid to repeat the horizontal alignment for each menu, duplicate the first text item, replace the text as needed and then move it rightwards using the directional arrows. You&#8217;re going to have to align the items vertically everytime, sorry! </p>
<p>Once you&#8217;re done, you should have something like this: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-12.jpg" alt="The menu items aligned" /> </p>
<p><strong>Tip</strong>: group the items together and name the group (what about Items?). This is an easy tutorial and we&#8217;re only dealing with a few layers, but when you&#8217;re working on a real project layers easily stack up - renaming them and grouping them is a best practice to stay organized and improve your workflow. </p>
<h2>The Hover Effect</h2>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-13.png" alt="A new group for the hover effect" /> The &#8220;hardest&#8221; part of the job is behind us already. We&#8217;re left with creating the hover effect, and that&#8217;s just easy. Group all the layers you have so far (except for the white background layer), name it Normal State or something like that, then duplicate it by right-clicking on the group and selecting <strong>Duplicate Group</strong> from the contextual flyout menu. Rename the group in something like Hover State. </p>
<p>Move the duplicated group upwards until the bottom border of the background menu in the duplicated group is <strong>perfectly</strong> adjacent to the top border of the background menu in the original group (there <strong>must not be any distance between them</strong>, not even one pixel). See the following image for reference:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-14.png" alt="Move the duplicated group upwards until it's perfectly adjacent to the original one." class="margbot" /> </p>
<p>We create the hover effect by changing the text color. I picked an orange (#ffcc00), and here is what I got:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-15.png" alt="The hover effect is gained by changing the text color" class="margbot" />
<div class="clear"></div>
<h2>Slicing The Images</h2>
<p>It&#8217;s time to slice the images needed for the menu. The guides are all there already, you just have to add another one on top of the duplicated menu. Once again, <strong>be precise when creating guides</strong>: zoom in the page with the <strong>Zoom</strong> tool if needed.</p>
<p>Select the <strong>Crop</strong> tool in the toolbar (or by pressing C on the keyboard) and select the first rectangle, the one for the Tutorial menu item: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-16.png" alt="Slicing the Tutorial menu item" class="margbot" /> </p>
<p>Accuracy is essential in this step too: <strong>the crop area should be exactly as wide as the area surrounded by the guides</strong>. Zoom in the page to have a better vision. </p>
<p>Once you&#8217;ve created the selection, hit Enter. Only the cropped area will be left in your document. Hide the white background layer in the Layer palette: the first and last menu items have two rounded rectangles each through which you can see the background; if we ever changed the background to a different color those white small bits would be visible, and that&#8217;s not what we want. This is the same reason why you should save the menu images in .png format.</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-17.png" alt="Saving the image" class="margbot" />You&#8217;re now ready to <strong>save the image</strong>, but before you do that, create a root folder for this project and a subfolder called Images: this is where you will save the sliced images. Save them in .png format.</p>
<p>Repeat this process to slice each and every image sprite needed for the menu. Once you&#8217;re done, you should have five images in your image folder. </p>
<p>Alright, we&#8217;re done with Photoshop and ready to move on to HTML/CSS coding!</p>
<h2>The HTML Code</h2>
<p>Open a new HTML document in the text editor of your choice. The most semantic HTML code to use for a menu is a <strong>list</strong> as a menu is actually a list of items. It&#8217;s also necessary to add a class to each link because we&#8217;re using different images - I&#8217;ll explain this later in greater detail.</p>
<pre class="brush: html;">
    &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;@&quot; class=&quot;tutorial&quot;&gt;Tutorial&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;@&quot; class=&quot;siticss&quot;&gt;Siti CSS&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;@&quot; class=&quot;risorse&quot;&gt;Risorse&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;@&quot; class=&quot;showcase&quot;&gt;Showcase&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;@&quot; class=&quot;offtopic&quot;&gt;Off topic&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
</pre>
<h2>The CSS: The Theory</h2>
<p>Here is what we&#8217;ll do with CSS: we&#8217;ll start by zeroing all default margins and paddings of the list, then we&#8217;ll float the &lt;li&gt; next to each other. The rest of the job will all be about the links: we&#8217;ll apply the image sprites we&#8217;ve created as backgrounds and create the hover effect by playing with the image background position.</p>
<h2>The CSS: The Practice</h2>
<p>Create a new CSS file and save it in the root folder, then add the following lines: </p>
<pre class="brush: css;">
ul {
   margin: 0;
   padding: 0;
   list-style-type: none; }

li { float:left; }
</pre>
<p>What we need to do next is to turn links from inline elements in block elements so that we can assign them fixed sizes (if you want to know more about inline and block elements you can read <a href="http://www.bloggingcss.com/en/tutorials/the-display-property-none-inline-block/">this tutorial about the display property and its values</a>). </p>
<pre class="brush: css;">
a { display: block; }
</pre>
<p>How big should links be? Each of the image sprites we&#8217;ve created is 110px wide and 100px tall. Image sprites include both the normal state image and the hover state image though, while we only want to display the latter on mouse hover. This means <strong>we only want to show one half of the image and hide the other half until we hover it</strong>. For this purpose, we can go with the image width as it is but we must cut the height in half:</p>
<pre class="brush: css;">
a {
   width: 110px;
   height: 50px; }
</pre>
<p>Did you ever notice that after clicking a menu item a <strong>dotted border</strong> is displayed around it? That&#8217;s a system to let users know they clicked on something, but in some browsers this border runs across the page rather than just sticking around the menu item. To prevent this from happening, we can add the overflow property in the CSS file: </p>
<pre class="brush: css;">
a { overflow: hidden; }
</pre>
<p>We should also hide the text so that the image is the only thing displayed. We can do this by <strong>shifting the text</strong> to the left: </p>
<pre class="brush: css;">
text-indent:-9999px;
</pre>
<p>The text is usually shifted by 9999 pixels so that it&#8217;s not visible even with large screen resolutions. Why not deleting it completely anyway? Because of <strong>accessibility</strong> issues: if CSS are disabled for any reasons, the user can still read the text link instead of the image. </p>
<h2>The Image Sprites As Link Backgrounds</h2>
<p>It&#8217;s time to assign the image sprites as the links backgrounds. </p>
<p>There are several CSS properties that relate to the use of image backgrounds. In this tutorial we&#8217;re going to use three of them: </p>
<ul>
<li><strong>background-repeat</strong> lets us decide if we want the image to repeat or not;
<li><strong>background-position</strong> lets us set the image position.
<li><strong>background-image</strong> lets us insert the path to the image sprite we want to use as a background.</li>
</ul>
<h2>Background-repeat</h2>
<p>We would need the image to repeat if for instance we were using a pattern as a background image. For the purpose of this tutorial though, we don&#8217;t need the image to repeat:</p>
<pre class="brush: css;">
a { background-repeat: no-repeat; }
</pre>
<h2>Background-position</h2>
<p>The concept behind background-position is a little complex, so pay attention - but don&#8217;t be scared!  </p>
<p>Let&#8217;s consider a single item menu, the Tutorial one. The image sprite for this item is 110px wide and 100px tall. We have agreed we should only display half the image though, which equals to a 110&#215;50px area, and hide the rest until we need it. It&#8217;s like this area is the glass of a picture frame: <strong>it allows us to see the part of the picture under the glass but covers the part under the frame</strong>.</p>
<p>The CSS sprite techniques works pretty much in the same way. We have a picture (the image sprite) and we have a glass (the 110&#215;50px link area) that shows a half of the picture (the normal state half of the image sprite) and hides the other half (the hover state half of the image sprite). The question is, <strong>how do we move the picture so that the second half is visible when we hover the menu item</strong>? </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-18.png" alt="I CSS sprite" />Enters the <strong>background-position</strong>. The purpose of this property is in fact to move the background image of an element. But in relation to what should we move it? We need a reference point, which is the top left corner of the link area (see the image for reference).</p>
<p>The background-position property takes <strong>two values</strong>: the distance of the image from the left of the reference point; and the distance of the image from the top of the reference point. <strong>Both values are 0 by default</strong>, which means that the top left corner of the background image will perfectly overlap the top left corner of the link area. </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-19.png" alt="I CSS sprites" /> Take a look at this image. You can see the 110&#215;50px link area only allows us to see half of the background image. But, wait a second, it&#8217;s the hover state half, not the normal state one - how comes? </p>
<p>That&#8217;s because we haven&#8217;t assigned the background-position property to the link yet, so its default values are 0. To display the other half we should modify the background-position values.</p>
<pre class="brush: css;">
background-position:0 -50px;
</pre>
<p>And here is what we get: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/css-sprite/menu-immagini-20.png" alt="I CSS sprites" class="margbot"/>I&#8217;m sure you guess what should we do to generate the hover effect. Take a second to think about it&#8230;
<div class="clear"></div>
<pre class="brush: css;">
a:hover { background-position: 0 0; }
</pre>
<p>Did you guess? Bravo!</p>
<h2>Background-image</h2>
<p>Let&#8217;s recap all the CSS code we wrote so far:</p>
<pre class="brush: css;">
a {
   display: block;
   overflow: hidden;
   width: 110px;
   height: 50px;
   text-indent:-9999px;
   background-repeat: no-repeat;
   background-position: 0 -50px; }

a:hover { background-position: 0 0; }
</pre>
<p>The only thing left is to assign each image sprite to its respective menu item. We can do so taking advantage of the <strong>classes</strong> we assigned in the HTML code:</p>
<pre class="brush: css;">
a.tutorial { background-image:url(immagini/tutorial.png); }
a.siticss { background-image:url(immagini/siti-css.png); }
a.risorse { background-image:url(immagini/risorse.png); }
a.showcase { background-image:url(immagini/showcase.png); }
a.offtopic { background-image:url(immagini/off-topic.png); }
</pre>
<h2>Images With Differents Widths</h2>
<p>In this tutorial we have built a menu with images which all have the same width. But what if each image had a different width? In such a case, it&#8217;s enough to declare each image width in the group of properties assigned to the respective link classes (the ones for which we assign the background images). </p>
<p>The last code snippet we&#8217;ve written would therefore become as following: </p>
<pre class="brush: css;">
a.tutorial {
   width:100px;
   background-image:url(immagini/tutorial.png); }	

a.siticss {
   width:70px;
   background-image:url(immagini/siti-css.png); }

a.risorse {
   width:83px;
   background-image:url(immagini/risorse.png); }

a.showcase {
   width:89px;
   background-image:url(immagini/showcase.png); }

a.offtopic {
   width:94px;
   background-image:url(immagini/off-topic.png); }
</pre>
<h2>That&#8217;s It, Folks!</h2>
<p><a href="http://www.bloggingcss.com/wp-content/uploads/css-sprite/css-sprite/index.html">This is the final result</a>. I realize it&#8217;s quite a long tutorial but I went in deep detail so that you could really grasp how the CSS sprite technique works. Don&#8217;t panic anyway: after a few trials it&#8217;ll be easier and more intuitive for you to use.</p>
<h2>So, what do you think?</h2>
<p>Did you find this tutorial useful? Do you have questions to ask? <strong>Share your thoughts in the comments</strong>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggingcss.com/en/tutorials/css-menus-with-images-css-sprites/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bits of Inspiration #5</title>
		<link>http://www.bloggingcss.com/en/showcases/bits-of-inspiration-5/</link>
		<comments>http://www.bloggingcss.com/en/showcases/bits-of-inspiration-5/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 16:43:10 +0000</pubDate>
		<dc:creator>grazz</dc:creator>
		
		<category><![CDATA[Bits of Inspiration]]></category>

		<category><![CDATA[Showcases]]></category>

		<category><![CDATA[comments]]></category>

		<category><![CDATA[contacts]]></category>

		<category><![CDATA[footer]]></category>

		<category><![CDATA[header]]></category>

		<category><![CDATA[menu]]></category>

		<category><![CDATA[pagination]]></category>

		<category><![CDATA[palette]]></category>

		<category><![CDATA[skills]]></category>

		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://www.bloggingcss.com/en/?p=162</guid>
		<description><![CDATA[I travel to a number of websites everyday as I think this is essential to keep up with the latest best practices and always improve my design skills. Also, it&#8217;s fun :)
There is a good number of websites out there that are awesome in every way. It&#8217;s a good number, but not great: perfection is [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-162"></span>I travel to a number of websites everyday as I think this is essential to keep up with the latest best practices and always improve my design skills. Also, it&#8217;s fun :)</p>
<p>There is a good number of websites out there that are awesome in every way. It&#8217;s a good number, but not great: perfection is not exactly around the corner. I also happen to see a lot of websites that are just nice but won&#8217;t make your jaw drop thinking &#8220;Geez, why didn&#8217;t I design that?&#8221;. Yet some of these websites have really great details, such as a nice color palette or a well designed form. </p>
<p>Enters Bits of Inspiration, a series that showcases nice web design bits. </p>
<h2>1. Koodòz Design Menu</h2>
<p><a href="http://www.koodoz.com.au/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/koodoz-menu.jpg" alt="Koodòz Menu" title="Koodòz Menu" width="362" height="244" class="size-full wp-image-165" /></a></p>
<p><a href="http://www.koodoz.com.au/" target="_blank">http://www.koodoz.com.au/</a></p>
<p>This menu is very rich and creative. On normal state it features simple white links, but on hover a big effective red arrow and a handdrawn description for the linked section appear. Also, when needed a submenu shows up with a little Javascript magic.
<div class="clear"></div>
<h2>2. Upstruct Contact Page</h2>
<p><a href="http://upstruct.com/contact" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/upstruct-googlemap.jpg" alt="Upstruct Contact Page" title="Upstruct Contact Page" width="600" height="279" class="size-full wp-image-166" /></a></p>
<p><a href="http://upstruct.com/contact" target="_blank">http://upstruct.com/contact</a></p>
<p>Using a Google map as a web page background I&#8217;d never seen before&#8230;</p>
<h2>3. Sevenality Color Palette</h2>
<p><a href="http://www.sevenality.com/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/sevenality-colors.png" alt="Sevenality Color Palette" title="Sevenality Color Palette" width="600" height="150" class="size-full wp-image-167" /></a></p>
<p><a href="http://www.sevenality.com/" target="_blank">http://www.sevenality.com/</a></p>
<p>Ooh, lovely color scheme. Don&#8217;t you think?</p>
<h2>4. Particletree Comments</h2>
<p><a href="http://particletree.com/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/particletree-comments.png" alt="Particletree Comments" title="Particletree Comments" width="600" height="439" class="size-full wp-image-168" /></a></p>
<p><a href="http://particletree.com/" target="_blank">http://particletree.com/</a></p>
<p>I don&#8217;t really like how comments are styled on this blog, but they are unconventionally laid out in two columns. I&#8217;m not so sure it&#8217;s the right way to go as it looks a little hard to understand who commented before who, but it could be fun to pitch the idea and play with a little more.</p>
<h2>5. Guggenheim Museum Home Page Slideshow</h2>
<p><a href="http://www.guggenheim.org/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/guggenheim-slideshow1.png" alt="Guggenheim Slideshow" title="Guggenheim Slideshow" width="600" height="225" class="size-full wp-image-170" /></a></p>
<p><a href="http://www.guggenheim.org/" target="_blank">http://www.guggenheim.org/</a></p>
<p>I really like the transitions in the Guggenheim home page slideshow. You hover over the next item in the list and the corresponding image slides up vertically. I also like how the text link gets bigger when hovered, although the color transition should have been smoother in my opinion. </p>
<h2>6. CSSBuilt Pagination</h2>
<p><a href="http://cssbuilt.com/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/cssbuilt-pagination.jpg" alt="CSSBuilt Pagination" title="CSSBuilt Pagination" width="507" height="53" class="size-full wp-image-171" /></a></p>
<p><a href="http://cssbuilt.com/" target="_blank">http://cssbuilt.com/</a></p>
<p>I was browsing CSS Built for inspiration when my eye was caught by its pagination. It looks very interface-y and I love the color scheme they used. The hover effect is a soft gradient, just like how gradients are supposed to be. </p>
<h2>7. Nicole Bishop Header</h2>
<p><a href="http://www.nicolebishop.info/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/bishop-header.jpg" alt="Nicole Bishop Header" title="Nicole Bishop Header" width="600" height="234" class="size-full wp-image-172" /></a></p>
<p><a href="http://www.nicolebishop.info/" target="_blank">http://www.nicolebishop.info/</a></p>
<p>The header of this website is probably not the best crafted one, but the drawing is just fun. </p>
<h2>8. Life in Mono Mood</h2>
<p><a href="http://www.lifeinmono.net/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/lifeinmono.jpg" alt="Life in Mono Mood" title="Life in Mono Mood" width="600" height="442" class="size-full wp-image-173" /></a></p>
<p><a href="http://www.lifeinmono.net/" target="_blank">http://www.lifeinmono.net/</a></p>
<p>I was immediately attracted to this website as soon as I saw it. The graphics set an elegant but welcoming mood that draws you in - it drew me on, at least. I particularly like the header and the vertical menu.</p>
<h2>9. Meomi Footer</h2>
<p><a href="http://www.meomi.com/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/meomi-footer.jpg" alt="Meomi Footer" title="Meomi Footer" width="600" height="149" class="size-full wp-image-174" /></a></p>
<p><a href="http://www.meomi.com/" target="_blank">http://www.meomi.com/</a></p>
<p>I was almost going to rule out this element from the list because the footer is a Flash animation, but then I thought this series is meant to inspire you, and have you ever thought of using a Flash animation as the footer of your blog? I hadn&#8217;t yet. Now I have.</p>
<h2>10. Storypixel Diet</h2>
<p><a href="http://www.storypixel.com/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/storypixel-diet.jpg" alt="Storypixel Diet" title="Storypixel Diet" width="114" height="393" class="size-full wp-image-175" /></a></p>
<p><a href="http://www.storypixel.com/" target="_blank">http://www.storypixel.com/</a></p>
<p>Storypixel is the portfolio website of web developer Sam Wilson. Wilson presents himself as a paesant, hence the detail of his professional skills presented as a diet. </p>
<p>It&#8217;s actually a nice websites in any way. Beside the strong concept behind it, it features nice graphics, a warm color scheme, good typography and a particular effect on the header - try resizing your browser window&#8230;
<div class="clear"></div>
<h2>So, what do you think?</h2>
<p>Did you like these bits? Did they inspire you? If you&#8217;ve seen something that could qualify for this series and want to suggest it, <a href="mailto:bloggingcss@gmail.com">email</a> me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggingcss.com/en/showcases/bits-of-inspiration-5/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Pirata London, creative use of background images</title>
		<link>http://www.bloggingcss.com/en/css-websites/pirata-london-creative-use-of-background-images/</link>
		<comments>http://www.bloggingcss.com/en/css-websites/pirata-london-creative-use-of-background-images/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 16:37:00 +0000</pubDate>
		<dc:creator>grazz</dc:creator>
		
		<category><![CDATA[Css Websites]]></category>

		<category><![CDATA[background images]]></category>

		<category><![CDATA[blogs]]></category>

		<category><![CDATA[header]]></category>

		<category><![CDATA[menu]]></category>

		<category><![CDATA[portfolios]]></category>

		<guid isPermaLink="false">http://www.bloggingcss.com/en/?p=155</guid>
		<description><![CDATA[Pirata London is a digital design agency. In this post I will review its portfolio website. 
The Header

I like the text effect they used for the headline in the header. The slab-serif fonts are run across by a sort of dashed blue &#8220;skeleton&#8221; which produces a neon effect, or at least that&#8217;s my impression. 
The [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-155"></span>Pirata London is a digital design agency. In this post I will review its portfolio website. </p>
<h2>The Header</h2>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/2009/07/pirata-headline.jpg" alt="Pirata London Header" title="Pirata London Header" width="600" height="78" class="margbot" /></p>
<p>I like the text effect they used for the headline in the header. The <strong>slab-serif</strong> fonts are run across by a sort of dashed blue &#8220;skeleton&#8221; which produces a <strong>neon effect</strong>, or at least that&#8217;s my impression. </p>
<h2>The Menu</h2>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/2009/07/pirata-nav.jpg" alt="Pirata London Menu" title="Pirata London Menu" width="482" height="163" class="margbot" /></p>
<p>The main menu of this website is just sexy. Each menu option has a circle as a background, which is a rather rarely used shape in web design per se. Each circle has a radial gradient with different colors to differentiate the four menu options. But the nicest aspect is how <strong>the circles intersect each other</strong>, and since they&#8217;re not completely opaque the intersections create some nice light plays. </p>
<p>Such plays are <strong>enhanced</strong>when passing the cursor over the menu options: on hover state a second circle that&#8217;s slightly smaller than the first one overlaps it. The result is just nice.</p>
<p><strong>The menu options are intersected thanks to the use of negative margins in the CSS</strong>. </p>
<h2>The Use of Background Images</h2>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/2009/07/pirata-post.jpg" alt="The Use of Background Images on Pirata London" title="The Use of Background Images on Pirata London" width="600" height="408" class="margbot" /></p>
<p>The most original and creative detail of this website is the use of background images for the blog posts. Each post is presented by a visually appealing image sided by a box that contains the post title and a small description; the post image is also used as a background with a <strong>pixelated effect</strong> that I really like. </p>
<p>This same technique is actually used in several other sections of the website, like in the portfolio.</p>
<h2>So, what do you think?</h2>
<p>Do you like this website? What do you think about the pixelated background images? <strong>Share your thoughts in the comments</strong>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggingcss.com/en/css-websites/pirata-london-creative-use-of-background-images/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The CSS3 border-radius property</title>
		<link>http://www.bloggingcss.com/en/tutorials/the-css3-border-radius-property/</link>
		<comments>http://www.bloggingcss.com/en/tutorials/the-css3-border-radius-property/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 16:04:29 +0000</pubDate>
		<dc:creator>grazz</dc:creator>
		
		<category><![CDATA[CSS3]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[border-radius]]></category>

		<category><![CDATA[horizontal radius]]></category>

		<category><![CDATA[rounded corners]]></category>

		<category><![CDATA[shorthand properties]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[vertical radius]]></category>

		<guid isPermaLink="false">http://www.bloggingcss.com/en/?p=112</guid>
		<description><![CDATA[One of the CSS3 properties designers have been longing the most for is undoubtedly the border-radius property. With CSS3 border-radius property it&#8217;s possible to create the so popular rectangles with rounded corners exclusively via CSS - no images needed. 
Cross-browser compatibility
CSS3 aren&#8217;t supported by all browsers yet. The border-radius property is supported by Firefox (since [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-112"></span>One of the CSS3 properties designers have been longing the most for is undoubtedly the border-radius property. With CSS3 border-radius property it&#8217;s possible to create the so popular <strong>rectangles with rounded corners</strong> exclusively via CSS - no images needed. </p>
<h2>Cross-browser compatibility</h2>
<p>CSS3 aren&#8217;t supported by all browsers yet. The border-radius property is supported by Firefox (since version 3.0), Safari (since version 3.1) and Chrome (since the first version), but it&#8217;s not supported by Internet Explorer or Opera (it should be implemented in Opera 10). </p>
<p>Since CSS3 aren&#8217;t standard yet, you must add prefixes to border-radius in order to work with the browsers that support it. If you want to work it with Firefox, you must write <strong>-moz-border-radius</strong> in the CSS; if you want it to work with Safari/Chrome, it&#8217;s <strong>-webkit-border-radius</strong>.</p>
<p><strong>Note</strong> that although Firefox, Safari and Chrome support this property, they do so in slightly different modalities. For the sake of simplicity, <strong>I&#8217;ll first show you how it is supported by Firefox and then explain the differences in Safari and Chrome</strong>. </p>
<h2>The box</h2>
<p>Let&#8217;s start by creating the box we will experiment the border-radius property with. In the HTML we simply build an empty box:</p>
<pre class="brush: html;">
&lt;body&gt;
&lt;div id=&quot;box&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
</pre>
<p>In the CSS, we give it a width, a height and a background color:</p>
<pre class="brush: css;">
#box {
   width:590px;
   height:100px;
   background-color:#6B86A6;
</pre>
<h2>Declaring the border-radius property</h2>
<p>The border-radius property is declared pretty much like the margin and padding properties. It can be used alone as a <strong>shorthand property</strong> for all the four angles of the rectangle, or in combination with specific <strong>suffixes</strong> for each of the four angles.</p>
<h3>Declaring the border-radius property as a shorthand property</h2>
<p>If used as a shorthand property, assigning just <strong>one value</strong> will set that value as the radius of each angle: </p>
<pre class="brush: css;">
#box { -moz-border-radius: 20px; }
</pre>
<p>With this CSS, all four angles will have a 20px radius:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/border-radius/border-radius-1.png" alt="The CSS3 border-radius property" title="The CSS3 border-radius property" class="margbot" /></p>
<p>If you assign <strong>two values</strong>, the first one will represent the radius of the top-left and bottom-right corners while the second one will represent the radius of the top-right and bottom-left corners: </p>
<pre class="brush: css;">
#box { -moz-border-radius:20px 40px; }
</pre>
<p>With this CSS, the top-left and bottom-right corners will have a 20px radius, the top-right and bottom-left corners will have a 40px radius:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/border-radius/border-radius-2.png" alt="The CSS3 border-radius property" title="The CSS3 border-radius property" class="margbot" /></p>
<p>You could also assign <strong>three values</strong>: the first one will be the radius of the top-left corner, the second will be the radius of the top-right and bottom-left corners, the last will be the radius of the bottom-right corner.</p>
<pre class="brush: css;">
#box { -moz-border-radius:20px 40px 5px; }
</pre>
<p>With this CSS, the top-left corner will have a 20px radius, the top-right and bottom-left corners will have a 40px radius, the bottom-right corner will have a 5px radius:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/border-radius/border-radius-3.png" alt="The CSS3 border-radius property" title="The CSS3 border-radius property" class="margbot" /></p>
<p>Your last option is to assign <strong>four values</strong> - one for each angle - in this order: the top-left corner radius, the top-right corner radius, the bottom-right corner radius, the bottom-left corner radius: </p>
<pre class="brush: css;">
#box { -moz-border-radius:10px 20px 30px 40px; }
</pre>
<p>With this CSS, the top-left corner will have a 10px radius, the top-right corner will have a 20px radius, the bottom-right corner will have a 30px radius, the bottom-left corner will have a 40px radius:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/border-radius/border-radius-4.png" alt="The CSS3 border-radius property" title="The CSS3 border-radius property" class="margbot" /></p>
<h3>Declaring the border-radius property for each angle</h2>
<p>If you need to assign the border-radius property to a <strong>single angle</strong> - maybe to override a previously assigned value - you can do so by adding a suffix to &#8220;border-radius&#8221; depending on the angle you want to modify. </p>
<p>The suffixes are as follows:</p>
<ul>
<li><strong>-moz-border-radius-topleft</strong> for the top-left corner;</li>
<li><strong>-moz-border-radius-topright</strong> for the top-right corner;</li>
<li><strong>-moz-border-radius-bottomright</strong> for the bottom-right corner;</li>
<li><strong>-moz-border-radius-bottomleft</strong> for the bottom-left corner;</li>
</ul>
<p>So if for example you only want to round the top right corner: </p>
<pre class="brush: css;">
#box { -moz-border-radius-topright: 30px; }
</pre>
<p>Here is what you&#8217;d get: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/border-radius/border-radius-5.png" alt="The CSS3 border-radius property" title="The CSS3 border-radius property" class="margbot" /></p>
<h2>The horizontal radius and the vertical radius</h2>
<p>I have so far made examples that assumed that we want each angle to be a perfect <strong>quarter circle</strong>, so that I could focus on showing you the basic syntax of the border-radius property. But with CSS3 you can also have <strong>quarter ellipses</strong> rather than quarter circles.</p>
<p>Let&#8217;s round the top-left corner of our box with the following CSS code: </p>
<pre class="brush: css;">
#box { -moz-border-radius-topleft: 30px; }
</pre>
<p>Here is what we get:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/border-radius/border-radius-6.png" alt="The CSS3 border-radius property" title="The CSS3 border-radius property" class="margbot" /></p>
<p>The top-left corner is a perfect quarter circle. But let&#8217;s add a second value to the above CSS code: </p>
<pre class="brush: css;">
#box { -moz-border-radius-topleft: 30px 15px; }
</pre>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/border-radius/border-radius-7.png" alt="The CSS3 border-radius property" title="The CSS3 border-radius property" class="margbot" /></p>
<p>You can see the top-left corner is now a quarter ellipse. This is because the two values represent the <strong>horizontal radius</strong> and the <strong>vertical radius</strong> of the angle respectively. <strong>When using one value, the browser interprets that value as assigned for both the horizontal and vertical radii</strong>, and therefore renders a quarter circle. </p>
<h2>The radii with the shorthand property</h2>
<p>How can we declare different values for the horizontal and vertical radii when we use the shorthand property though? Enters the <strong>slash</strong>. Look at the following CSS code: </p>
<pre class="brush: css;">
#box { -moz-border-radius: 30px / 15px; }
</pre>
<p>In the above CSS code, <strong>the first value works as the horizontal radius</strong> of each angle, while <strong>the second works as the vertical radius</strong>. </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/border-radius/border-radius-8.png" alt="The CSS3 border-radius property" title="The CSS3 border-radius property" class="margbot" /></p>
<p>The syntax to declare all the other forms of shorthand properties follows the same logic. If we wanted to use different values for both the horizontal and vertical radii of each angle, we would write the following CSS code: </p>
<pre class="brush: css;">
#box { -moz-border-radius: 10px 20px 30px 40px / 5px 10px 15px 20px; }
</pre>
<p>Here is the result: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/border-radius/border-radius-9.png" alt="The CSS3 border-radius property" title="The CSS3 border-radius property" class="margbot" /></p>
<p>Why would you ever want such a rectangle is beyond me ;) But my job here is to present you with all the possibilities. The rest is up to you!</p>
<h2>What about Safari and Chrome?</h2>
<p>As pointed out at the beginning of the tutorial, everything as described so far works in Firefox, while <strong>Safari and Chrome currently use a slightly different syntax</strong> (by currently I mean July 13th 2009).</p>
<h2>Declaring the border-radius property for each angle in Safari and Chrome</h2>
<p>The formulas used to declare the border-radius property for each angle are different in Safari and Chrome. Here they are: </p>
<ul>
<li><strong>-webkit-border-top-left-radius</strong> for the top-left corner;</li>
<li><strong>-webkit-border-top-right-radius</strong> for the top-right corner;</li>
<li><strong>-webkit-border-bottom-right-radius</strong> for the bottom-right corner;</li>
<li><strong>-webkit-border-bottom-left-radius</strong> for the bottom-left corner;</li>
</ul>
<p><strong>Note</strong> that Safari and Chrome use the same syntax suggested in the W3C CSS3 Working Draft. </p>
<h2>Using the shorthand property in Safari and Chrome</h2>
<p>Safari and Chrome only support the possibility to declare one value for all the four angles. If you want to assign different values to one or more angles, you&#8217;ll have to do so by using the specific properties for each desired angle (as listed above).</p>
<p>The following shorthand property to assign different values for the four angles doesn&#8217;t work in Safari/Chrome:</p>
<pre class="brush: css;">
#box { -webkit-border-radius: 10px 20px 30px 40px; }
</pre>
<p>To get the desired effect, you should change the CSS as following:</p>
<pre class="brush: css;">
#box {
   -webkit-border-top-left-radius: 10px;
   -webkit-border-top-right-radius: 20px;
   -webkit-border-bottom-right-radius: 30px;
   -webkit-border-bottom-left-radius: 40px; }
</pre>
<h2>Horizontal and vertical radii in Safari and Chrome</h2>
<p>Safari and Chrome support the possibility to assign different radii with specific-angle properties. To make the top left corner a quarter ellipse, you should use the following CSS code: </p>
<pre class="brush: css;">
#box { -webkit-border-top-left-radius: 30px 15px; }
</pre>
<p>As to shorthand properties, the only case Safari and Chrome allow for assigning a vertical radius is when all the four angles have the same value. Besides, <strong>the syntax doesn&#8217;t require a slash</strong>; it&#8217;s enough to write the two values consequently: </p>
<pre class="brush: css;">
#box { -webkit-border-radius: 30px 15px; }
</pre>
<p>The above CSS code results in the following image: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/border-radius/border-radius-8.png" alt="The CSS3 border-radius property" title="The CSS3 border-radius property" class="margbot" /></p>
<h2>Attention, please</h2>
<p>I found out about Safari and Chrome inconsistencies by <strong>trying</strong> different CSS codes - not reading about them somewhere - so I might have made some mistakes. If you actually spot any inaccuracy, please <a href="mailto:bloggingcss@gmail.com">contact me</a> and I&#8217;ll correct the tutorial.</p>
<h2>What can apply the CSS3 border-radius property to?</h2>
<p>The answer is: <strong>everything</strong>. All border-related properties are applied to the boxes each HTML elements is included in according to the CSS box model. Therefore you can apply border-radius to menus, paragraphs, images, lists, etc. In the following images there are three examples: a paragraph, a menu with rounded links, and another paragraph with a border. Note how the border gets rounded, too:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/border-radius/border-radius-10.png" alt="The CSS3 border-radius property" title="The CSS3 border-radius property" class="margbot" /></p>
<h2>So, what do you think?</h2>
<p>Are you excited about creating rounded rectangles just with CSS? Have you used the border-radius property already? <strong>Share your thoughts in the comments</strong>! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggingcss.com/en/tutorials/the-css3-border-radius-property/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bits of Inspiration #4</title>
		<link>http://www.bloggingcss.com/en/showcases/bits-of-inspiration-4/</link>
		<comments>http://www.bloggingcss.com/en/showcases/bits-of-inspiration-4/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 09:15:26 +0000</pubDate>
		<dc:creator>grazz</dc:creator>
		
		<category><![CDATA[Bits of Inspiration]]></category>

		<category><![CDATA[Showcases]]></category>

		<category><![CDATA[headings]]></category>

		<category><![CDATA[headline]]></category>

		<category><![CDATA[layout]]></category>

		<category><![CDATA[palette]]></category>

		<category><![CDATA[texture]]></category>

		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://www.bloggingcss.com/en/?p=133</guid>
		<description><![CDATA[I travel to a number of websites everyday as I think this is essential to keep up with the latest best practices and always improve my design skills. Also, it&#8217;s fun :)
There is a good number of websites out there that are awesome in every way. It&#8217;s a good number, but not great: perfection is [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-133"></span>I travel to a number of websites everyday as I think this is essential to keep up with the latest best practices and always improve my design skills. Also, it&#8217;s fun :)</p>
<p>There is a good number of websites out there that are awesome in every way. It&#8217;s a good number, but not great: perfection is not exactly around the corner. I also happen to see a lot of websites that are just nice but won&#8217;t make your jaw drop thinking &#8220;Geez, why didn&#8217;t I design that?&#8221;. Yet some of these websites have really great details, such as a nice color palette or a well designed form. </p>
<p>Enters Bits of Inspiration, a series that showcases nice web design bits. </p>
<h2>1. Arcade Wordpress theme light spots</h2>
<p><a href="http://demo.obox-design.com/arcade/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/arcade.jpg" alt="Arcade Wordpress theme light spots" title="Arcade Wordpress theme light spots" width="600" height="200" class="size-full wp-image-134" /></a></p>
<p><a href="http://demo.obox-design.com/arcade/" target="_blank">http://demo.obox-design.com/arcade/</a></p>
<p>I really like all the light spots on the Arcade Wordpress Theme. They&#8217;re very well crafted and add a metallic feel to the design. </p>
<h2>2. Demonico the Day Dreamer headings</h2>
<p><a href="http://dthe3d.tumblr.com/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/demonico.png" alt="Demonico headings" title="Demonico headings" width="600" height="100" class="size-full wp-image-135" /></a></p>
<p><a href="http://dthe3d.tumblr.com/" target="_blank">http://dthe3d.tumblr.com/</a></p>
<p>The headings on this Tumblog are very creative and catchy.</p>
<h2>3. Carsonified background gif</h2>
<p><a href="http://carsonified.com/team/mike/" target="_blank"><img alt="Carsonified background gif" src="http://carsonified.com/wp-content/themes/carsonified/img/presentation/tv_fuzz_dark.gif" title="Carsonified background gif" width="149" height="149" /></a><a href="http://carsonified.com/team/mike/" target="_blank">http://carsonified.com/team/mike/</a></p>
<p>This gif actually isn&#8217;t the background of the whole website but it is only used on the page of one of Carsonified team members. Gifs like this one are probably not the best choice to go with in most cases, but we&#8217;re talking about one of the most creative agencies here.
<div class="clear"></div>
<h2>4. Carsonified typography</h2>
<p><a href="http://carsonified.com/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/carsonified-typography.png" alt="Carsonified typograhpy" title="Carsonified typograhpy" width="433" height="342" class="size-full wp-image-136" /></a><a href="http://carsonified.com/" target="_blank">http://carsonified.com/</a></p>
<p>Yep, Carsonified new website makes the list once again. I&#8217;m a fan of typography so I couldn&#8217;t ignore the way they used big <a href="http://new.myfonts.com/fonts/linotype/cooper-black/" target="_blank">Cooper Black</a> headings.</p>
<p>I strongly advice you to browse all the rest of the website because it&#8217;s creative in a lot of other ways. Check out how little icons show up hovering on the main menu, how illustrations are consistently used through the whole website and how each page has a different background color. Lots of inspiration.</p>
<h2>5. Hope Unlimited color palette</h2>
<p><a href="http://www.hopeunlimited.org/" target="_blank"><img alt="The color palette of Hope Unlimited" src="http://www.colourlovers.com/paletteImgDetail/1280/591/FFFFFF/F2EADC/DE8C50/C5B369/A9C7CF/Hope_Unlimited.png" title="The color palette of Hope Unlimited" width="200" /></a><a href="http://www.hopeunlimited.org/" target="_blank">http://www.hopeunlimited.org/</a></p>
<p>Hope Unlimited uses a nice palette made up of grungy light colors.</p>
<p>By the way, <a href="http://www.colourlovers.com/lover/bloggingcss" target="_blank">I have created a profile for Blogging CSS</a> over at COLOURlovers where I create palettes from websites with nice colors. Go take a look if you want to ;)</p>
<h2>6. 5pieces background texture</h2>
<p><a href="http://5pieces.com/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/5pieces-texture.jpg" alt="5pieces texture" title="5pieces texture" width="600" height="301" class="size-full wp-image-137" /></a></p>
<p><a href="http://5pieces.com/" target="_blank">http://5pieces.com/</a></p>
<p>This website isn&#8217;t exceptionally designed in my opinion, but I think the background texture is a good one.</p>
<h2>7. Mirasim header</h2>
<p><a href="http://www.mirasim.com/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/mirasim-header.jpg" alt="Mirasim header" title="Mirasim header" width="600" height="277" class="size-full wp-image-138" /></a></p>
<p><a href="http://www.mirasim.com/" target="_blank">http://www.mirasim.com/</a></p>
<p>I think it&#8217;s great how colorful and vivid this website header is. You just can&#8217;t not like it.</p>
<h2>8. Treforest contact page</h2>
<p><a href="http://www.treforestdesign.com/contact.html" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/treforest-contacts.jpg" alt="Treforest contact page" title="Treforest contact page" width="600" height="322" class="size-full wp-image-139" /></a></p>
<p><a href="http://www.treforestdesign.com/contact.html" target="_blank">http://www.treforestdesign.com/contact.html</a></p>
<p>The contact page on Treforest portfolio is quite unusual, starting with the nice What can we do for you? headline to the &#8220;untidy&#8221; layout of the contact information. Huh.</p>
<h2>9. James Chambers portfolio layout</h2>
<p><a href="http://www.jameschambers.co.uk/" target="_blank"><img src="http://www.bloggingcss.com/en/wp-content/uploads/2009/07/jameschambers.jpg" alt="James Chambers portfolio layout" title="James Chambers portfolio layout" width="600" height="457" class="size-full wp-image-140" /></a></p>
<p><a href="http://www.jameschambers.co.uk/" target="_blank">http://www.jameschambers.co.uk/</a></p>
<p>You can totally feel the use of grids on this portfolio website, which features a very clean, tidy and well-spaced layout. </p>
<h2>10. Weightshift headline</h2>
<p><a href="http://weightshift.com/" target="_blank"><img alt="Weightshift headline" src="http://weightshift.com/_gfx/cover_04.gif" title="Weightshift headline" width="600" /></a></p>
<p><a href="http://weightshift.com/" target="_blank">http://weightshift.com/</a></p>
<p>This image is an example of how great graphic design can serve a website well. Love it. </p>
<h2>So, what do you think?</h2>
<p>Did you like these bits? Did they inspire you? If you&#8217;ve seen something that could qualify for this series and want to suggest it, <a href="mailto:bloggingcss@gmail.com">email</a> me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggingcss.com/en/showcases/bits-of-inspiration-4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sport News PVM, a free HTML/CSS template by PV. M. Garage</title>
		<link>http://www.bloggingcss.com/en/risorse/sport-news-pvm-a-free-htmlcss-template-by-pv-m-garage/</link>
		<comments>http://www.bloggingcss.com/en/risorse/sport-news-pvm-a-free-htmlcss-template-by-pv-m-garage/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 14:41:33 +0000</pubDate>
		<dc:creator>grazz</dc:creator>
		
		<category><![CDATA[Resources]]></category>

		<category><![CDATA[pvmgarage]]></category>

		<category><![CDATA[resources]]></category>

		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.bloggingcss.com/en/?p=130</guid>
		<description><![CDATA[Are you looking for a free HTML/CSS template to build an online magazine with? Well, look no further. Here is a free HTML/CSS template for a Sport News magazine (but you could easily customize it to work with any kind of news) that you can download over at PV. M. Garage (a great blog by [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-130"></span>Are you looking for a free HTML/CSS template to build an online magazine with? Well, look no further. Here is a <a href="http://www.pvmgarage.com/en/2009/07/sportnewspvm-coded-how-to-plan-a-web-layout-for-a-wordpress-theme/#content" target="_blank">free HTML/CSS template for a Sport News magazine</a> (but you could easily customize it to work with any kind of news) that you can download over at <strong>PV. M. Garage</strong> (a great blog by Italian Piervincenzo Madeo about graphics, web design and web development).  </p>
<p>This resource is great for many reasons: first of all, Piervincenzo also shows you how you could create the HTML/CSS from scratch, so it&#8217;s basically a tutorial about HTML and CSS; beside this, you can also <strong>grab the PSD template</strong> which he made available <a href="http://www.pvmgarage.com/en/2009/05/sportnewspvm-free-psd-template-free-for-a-sport-magazine/" target="_blank">for free download</a> in a previous post; lastly, Piervincenzo will publish another tutorial to show you how to turn this HTML/CSS template into a Wordpress theme. Don&#8217;t miss it! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggingcss.com/en/risorse/sport-news-pvm-a-free-htmlcss-template-by-pv-m-garage/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CSS3 box-shadow property</title>
		<link>http://www.bloggingcss.com/en/tutorials/css3-box-shadow-property/</link>
		<comments>http://www.bloggingcss.com/en/tutorials/css3-box-shadow-property/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 10:22:45 +0000</pubDate>
		<dc:creator>grazz</dc:creator>
		
		<category><![CDATA[CSS3]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[blur radius]]></category>

		<category><![CDATA[box-shadow]]></category>

		<category><![CDATA[inset]]></category>

		<category><![CDATA[spread radius]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.bloggingcss.com/en/?p=101</guid>
		<description><![CDATA[In this tutorial I will show you how to use the CSS3 box-shadow property to add shadows to a box. For box here I mean the box each HTML element is included in by the CSS box model (if you want to know more about the CSS box model read this tutorial). 
Cross-browser compatibility of [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-101"></span>In this tutorial I will show you how to use the CSS3 box-shadow property to add shadows to a box. For box here I mean the box each HTML element is included in by the CSS box model (if you want to know more about the CSS box model <a href="http://www.bloggingcss.com/en/tutorials/css-box-model/">read this tutorial</a>). </p>
<h2>Cross-browser compatibility of box-shadow property</h2>
<p>Let me tell you which browsers support the box-shadow property so that you know if you can have fun playing with it with your browser. </p>
<p>Box-shadow is supported by Firefox (since the latest 3.5 version), Safari (since version 3.1) and by Chrome (since its first version). It&#8217;s not supported by Internet Explorer (maybe in 9?) and Opera (it should be supported in version 10). </p>
<p><strong>Warning</strong>: since the box-shadow property is not standard yet, you&#8217;ll need to add a <strong>prefix</strong> before its name depending on the browser you want to experiment it with. To use it with Firefox the property must be declared as <strong>-moz-box-shadow</strong>, with Safari and Chrome it must be <strong>-webkit-box-shadow</strong>.</p>
<h2>The box-shadow property values</h2>
<p>Box-shadow can take up to four numeric values: </p>
<ul>
<li>the first value is the <strong>horizontal offset</strong> of the shadow;</li>
<li>the second value is the <strong>vertical offset</strong> of the shadow;</li>
<li>the third value represents the shadow <strong>blur radius</strong>;</li>
<li>the fourth value represents the shadow <strong>spread radius</strong>;</li>
</ul>
<p>The box-shadow property can also take two non-numeric values:</p>
<ul>
<li>the exadecimal value of the shadow <strong>color</strong>;</li>
<li>the <strong>inset</strong> word: if assigned, the outer shadow becomes an inner shadow.</li>
</ul>
<h2>The box</h2>
<p>Let&#8217;s create a box to experiment the CSS3 box-shadow property with. For the HTML we simply add an empty div that will work as our box: </p>
<pre class="brush: html;">
&lt;body&gt;
&lt;div id=&quot;box&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
</pre>
<p>We add some colors and measures in the CSS: </p>
<pre class="brush: css;">
body { background-color:#EBEBDF; }

#box {
	width:300px; height:300px;
	margin:100px auto 0;
/*	-moz-box-shadow:inset 10px 10px 40px 20px #fff;
	-webkit-box-shadow:10px 10px #555;*/
	background-color:#6B86A6; }
</pre>
<p>Here is our box:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/box-shadow/box-shadow-1.png" alt="La proprietà box-shadow dei CSS3" title="La proprietà box-shadow dei CSS3" /></p>
<h2>The offset</h2>
<p>Let&#8217;s add the box-shadow property in the CSS file. <strong>Note</strong> that for this tutorial I&#8217;m using the declaration needed to work with Firefox; if you want to try it with Safari or Chrome just remember to replace webkit with moz. </p>
<p>We only assign a color and the offset values to begin with:</p>
<pre class="brush: css;">
#box { -moz-box-shadow:10px 10px #aaa; }
</pre>
<p>Here is what we get:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/box-shadow/box-shadow-2.png" alt="La proprietà box-shadow dei CSS3" title="La proprietà box-shadow dei CSS3" /></p>
<p>We&#8217;ve created a shadow that is offset 10px both horizontally and vertically via CSS. </p>
<p>We could also use <strong>negative values</strong>: doing so offsets the shadows upwards and rightwards rather than downwards and leftwards. If we assigned the following values to the box-shadow property: </p>
<pre class="brush: css;">
#box { -moz-box-shadow:-10px -10px #aaa; }
</pre>
<p>we would get something like this:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/box-shadow/box-shadow-3.png" alt="La proprietà box-shadow dei CSS3" title="La proprietà box-shadow dei CSS3" /></p>
<p>The shadow is still solid in both cases though. We&#8217;ll blur it in the next step. </p>
<h2>The blur radius</h2>
<p>Let&#8217;s add a third value to the same box-shadow property previously declared. This third value represents the shadow blur radius: </p>
<pre class="brush: css;">
#box { -moz-box-shadow:10px 10px 10px #aaa; }
</pre>
<p>You can see how the shadow is blurred by 10px: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/box-shadow/box-shadow-4.jpg" alt="La proprietà box-shadow dei CSS3" title="La proprietà box-shadow dei CSS3" /></p>
<p><strong>The greater this value the more the shadow is blurred</strong>. <strong>Negative values</strong> are not allowed for blur radius.</p>
<h2>The spread radius</h2>
<p>I think it&#8217;s easier for you to see how spread radius works if we cancel the blur radius for the moment. So let&#8217;s make the blur radius 0 and add a fourth 5px value for the spread radius:</p>
<pre class="brush: css;">
#box { -moz-box-shadow:10px 10px 0 5px #aaa; }
</pre>
<p>Here is what we get: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/box-shadow/box-shadow-5.png" alt="La proprietà box-shadow dei CSS3" title="La proprietà box-shadow dei CSS3" /></p>
<p>The shadow has spread by 5px on each side. In the following image I have visualized this by coloring the expansion with a darker gray: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/box-shadow/box-shadow-6.png" alt="La proprietà box-shadow dei CSS3" title="La proprietà box-shadow dei CSS3" /></p>
<p>The dark 5px border you see on each side of the shadow is the result of assigning a 5px spread radius via the box-shadow property in the CSS. <strong>Remember</strong> you won&#8217;t see this color difference though: the effective result is the one you see in the previous image. </p>
<p>You can also use <strong>negative values</strong> for spread radius. If you do, the shadow will <strong>contract</strong> itself rather than expand: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/box-shadow/box-shadow-7.png" alt="La proprietà box-shadow dei CSS3" title="La proprietà box-shadow dei CSS3" /></p>
<p>We can now try applying both a blur radius and a spread radius to see the result:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/box-shadow/box-shadow-8.jpg" alt="La proprietà box-shadow dei CSS3" title="La proprietà box-shadow dei CSS3" /></p>
<h2>The inset value</h2>
<p>CSS3 also give the option to create an <strong>inner</strong> shadow exclusively via CSS. To do this, you just need to declare the inset value before all the other ones:</p>
<pre class="brush: css;">
#box { -moz-box-shadow:inset 10px 10px 10px 5px #aaa; }
</pre>
<p>Here is what we get:</p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/box-shadow/box-shadow-9.jpg" alt="La proprietà box-shadow dei CSS3" title="La proprietà box-shadow dei CSS3" /></p>
<h2>More on crossbrowser compatibility</h2>
<p>After going through all the options given by the CSS3 box-shadow property, I should tell you one more thing about crossbrowser compatibility issues. Firefox is the only browser that supports all of the box-shadow property values, while <strong>Safari and Chrome don&#8217;t support the possibility to apply a spread radius and to create an inner shadow</strong>. These two browsers only allow you to offset the shadow, blur it and give it a color:</p>
<pre class="brush: css;">
#box { -webkit-box-shadow:10px 10px 10px #aaa; }
</pre>
<h2>The secret to a good shadow</h2>
<p>In this tutorial I&#8217;ve created a very visible shadow to clearly show you how the CSS3 box-shadow property works. The secret to a good shadow though is <strong>subtlety</strong>. For our example, the following combination would have been a good choice: </p>
<pre class="brush: css;">
#box { -moz-box-shadow:3px 3px 12px 0 #999; }
</pre>
<p>See for yourself: </p>
<p><img src="http://www.bloggingcss.com/wp-content/uploads/box-shadow/box-shadow-10.jpg" alt="La proprietà box-shadow dei CSS3" title="La proprietà box-shadow dei CSS3" /></p>
<h2>Experiment</h2>
<p>Have fun playing with the box-shadow property, and experiment. You could for example use dark colors for your elements and a light color for the shadow, turning it into a <strong>glow</strong>.</p>
<p>Although you can apply a shadow to each HTML element, <strong>remember</strong> to only use it if appropriate and to create subtle shadows ;)</p>
<h2>So, what do you think?</h2>
<p>Did you know about the CSS3 box-shadow property? Maybe you have already used it on one of your web design projects? <strong>Share your thoughts in the comments</strong>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggingcss.com/en/tutorials/css3-box-shadow-property/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Margin and padding properties uncovered</title>
		<link>http://www.bloggingcss.com/en/tutorials/how-to-declare-the-margin-and-padding-properties/</link>
		<comments>http://www.bloggingcss.com/en/tutorials/how-to-declare-the-margin-and-padding-properties/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 14:11:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[css properties]]></category>

		<category><![CDATA[margin]]></category>

		<category><![CDATA[padding]]></category>

		<category><![CDATA[shorthand properties]]></category>

		<guid isPermaLink="false">http://www.bloggingcss.com/en/?p=13</guid>
		<description><![CDATA[In a previous tutorial about the CSS box model I&#8217;ve explained that there are three CSS properties that can alter the appereance of a box: margin, padding and border. 
Grammatically speaking, these three properties are very similar. The margin and padding property in particular are declared in the exact same way; the border property on [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-13"></span>In a previous tutorial about the CSS box model I&#8217;ve explained that there are three CSS properties that can alter the appereance of a box: <strong>margin</strong>, <strong>padding</strong> and <strong>border</strong>. </p>
<p><strong>Grammatically</strong> speaking, these three properties are very similar. <strong>The margin and padding property in particular are declared in the exact same way</strong>; the border property on the other hand is declared in a slightly different way. This is why in this tutorial I&#8217;m only going to show you how to declare the margin and padding property. You can read about declaring the border property in this tutorial. </p>
<h2>Declaring margin and padding properties: a premise</h2>
<p>The margin and padding properties can take <strong>up to four values</strong>: the top margin/padding, the right margin/padding, the bottom margin/padding, the left margin/padding. You can choose whether to declare these values at once or individually. </p>
<h2>Declaring the values at once</h2>
<p>To declare all values at once, the margin/padding property should be followed by the four values in the same order as above (top value, right value, bottom value, left value):</p>
<pre class="brush: css;">
p { margin:10px 10px 10px 10px; }
a { padding:5px 5px 5px 5px; }
</pre>
<p>There are <strong>shorthand</strong> versions of these properties. You can see in the example above the same value is repeated four times. In such a case, you can just declare the value once:</p>
<pre class="brush: css;">
p { margin:10px; }
a { padding:5px; }
</pre>
<p>If the top value is the same as the bottom value, and the right value is the same as the left value, you can declare just two values: the first one will work as the top/bottom value, the second one as the right/left value. Remember: values have to be assigned in this order, otherwise you&#8217;ll get the exact opposite of what you want. </p>
<pre class="brush: css;">
p { margin:10px 20px; }
a { padding:2px 5px; }
</pre>
<p>There is one last shorthand option. If you have the same value for the right and left margin/padding but two different ones for the top and bottom margin/padding, it&#8217;s enough to declare three values: the first one will work as the top value, the second one will work as both the right and left value, the last one will work as the bottom value.</p>
<pre class="brush: css;">
p { margin:10px 10px 5px; }
a { padding:5px 10px 2px; }
</pre>
<h2>Declaring the values individually</h2>
<p>If you want to declare your values individually, you have to add <strong>suffixes</strong> to the margin/padding properties. </p>
<p>Suppose you want to just declare the bottom margin. The CSS property becomes margin-bottom, and it only takes up one value:</p>
<pre class="brush: css;">
p { margin-bottom: 20px;  }
[css]

The syntax is super intuitive: you'll have to add to the margin/padding word a top suffix for the top value, a right suffix for the right value, a bottom suffix for the bottom value and a left suffix for the left value.

[css]
p {
   margin-top:10px;
   margin-right:10px;
   margin-bottom:10px;
   margin-left:10px;
}

a {
   padding-top:5px;
   padding-right:5px;
   padding-bottom:5px;
   padding-left:5px;
}
&lt;/div&gt;

&lt;h2&gt;When should I declare the values at once and when individually?&lt;/h2&gt;

Using the shorthand properties is much more &lt;strong&gt;convenient&lt;/strong&gt;: it saves time and bytes. On a general level, you can declare the values at once the first time you assign margin/padding to a class of elements; if you need to override one of those values for a specific element in that class, you would declare that value individually later on in the CSS. 

[css]
p { margin:20px; }

p.last { margin-bottom:0; }
</pre>
<p>The second declaration overrides the 20px bottom value assigned with the first one.</p>
<p>This of course is just an idea. You&#8217;ll end up developing your own practice to suit to your needs and your coding style.</p>
<p><strong>Remember</strong> that many HTML elements have default margins and paddings (headings, paragraphs, lists, ecc.). If you want to have full control, you can zero them at the top of your CSS file like this:</p>
<pre class="brush: css;">
* { margin:0; padding:0; }
</pre>
<p>The * is called <strong>universal selector</strong>: the properties assigned to it are inherited by all the elements. </p>
<h2>So, what do you think?</h2>
<p>Did you find this tutorial useful? There&#8217;s still something you didn&#8217;t quite understand and need help? <strong>Leave a comment</strong>! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggingcss.com/en/tutorials/how-to-declare-the-margin-and-padding-properties/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Free resources of the week #2</title>
		<link>http://www.bloggingcss.com/en/risorse/free-resources-of-the-week-2/</link>
		<comments>http://www.bloggingcss.com/en/risorse/free-resources-of-the-week-2/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 13:08:55 +0000</pubDate>
		<dc:creator>grazz</dc:creator>
		
		<category><![CDATA[Free resources of the week]]></category>

		<category><![CDATA[Resources]]></category>

		<category><![CDATA[blogger]]></category>

		<category><![CDATA[brushes]]></category>

		<category><![CDATA[form templates]]></category>

		<category><![CDATA[icons]]></category>

		<category><![CDATA[paper]]></category>

		<category><![CDATA[patterns]]></category>

		<category><![CDATA[resources]]></category>

		<category><![CDATA[social network]]></category>

		<category><![CDATA[spray]]></category>

		<category><![CDATA[stone]]></category>

		<category><![CDATA[swirls]]></category>

		<category><![CDATA[templates]]></category>

		<category><![CDATA[textures]]></category>

		<category><![CDATA[twitter]]></category>

		<category><![CDATA[vectors]]></category>

		<guid isPermaLink="false">http://www.bloggingcss.com/en/?p=69</guid>
		<description><![CDATA[Do you need free resources for your web design (or graphic design projects)? Things such as textures, Photoshop brushes, icons, fonts, vector shapes, blog templates, etc.? Then you&#8217;re in the right place. Every week I collect a lot of good quality freebies that I stumble upon in my RSS feed or via Twitter. Hope you [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-69"></span>Do you need free resources for your web design (or graphic design projects)? Things such as textures, Photoshop brushes, icons, fonts, vector shapes, blog templates, etc.? Then you&#8217;re in the right place. Every week I collect a lot of good quality freebies that I stumble upon in my RSS feed or via Twitter. Hope you find this useful ;)</p>
<h2>165 icons in 5 different colors</h2>
<p><a href="http://www.gosquared.com/images/help_sheets/Icon_Set_1_white_small.jpg" target="_blank"><br />
<img alt="165 icons in 5 different colors" src="http://www.gosquared.com/images/help_sheets/Icon_Set_1_white_small.jpg" title="165 icons in 5 different colors" width="500" height="500" /></a>
<div class="clear"></div>
<p>This is a nice set of 165 icons available in 5 different colors: black (see image), green, blue, red and gray. The download pack includes both the icons jpgs and the soruce file in .ai and .svg formats, so you can edit them to your liking. </p>
<p><a href="http://www.gosquared.com/images/help_sheets/Icon_Set_1_white_small.jpg">165 icons in 5 different colors&#8230;</a></p>
<h2>100 Adobe icon sets</h2>
<p><a href="http://blog.iconshock.com/design/extra-extra-100-best-adobe-icon-sets-on-the-net/" target="_blank"><img alt="100 Adobe icon sets" src="http://blog.iconshock.com/wp-content/uploads/2009/06/rashy-adobe.jpg" title="100 Adobe icon sets" /></a>
<div class="clear"></div>
<p>Here is a massive collection of over a 100 sets of Adobe products&#8217; icons. Some of them are really great. You could use them in your portfolio to visualize the list of Adobe softwares you can use, for example. </p>
<p><a href="http://blog.iconshock.com/design/extra-extra-100-best-adobe-icon-sets-on-the-net/" target="_blank">100 Adobe icon sets&#8230;</a></p>
<h2>40 social network icons</h2>
<p><a href="http://www.komodomedia.com/wp-content/uploads/2009/06/social_network_icons_blog_banner.png" target="_blank"><img alt="40 social network icons" src="http://www.komodomedia.com/wp-content/uploads/2009/06/social_network_icons_blog_banner.png" title="40 social network icons" /></a>
<div class="clear"></div>
<p>This 40 social network icon set is really high quality. Icons are in .png format and both in 16&#215;16 and 32&#215;32 sizes (so you actually get 80 icons). To use these icons attribution is required.</p>
<p><a href="http://www.komodomedia.com/wp-content/uploads/2009/06/social_network_icons_blog_banner.png" target="_blank">40 social network icons&#8230;</a></p>
<h2>Twitter icon set</h2>
<p><a href="http://www.smashingmagazine.com/2009/06/24/birdies-cute-free-twitter-icons-for-your-blog/" target="_blank"><img src="http://www.bloggingcss.com/wp-content/uploads/2009/07/birdies.png" alt="Twitter icon set" title="Twitter icon set" class="size-full wp-image-1145" /></a>
<div class="clear"></div>
<p>Speaking of social network, here is a sweet free Twitter icon set released by Smashing Magazine. Don&#8217;t miss it!</p>
<p><a href="http://www.smashingmagazine.com/2009/06/24/birdies-cute-free-twitter-icons-for-your-blog/" target="_blank">Twitter icon set&#8230;</a></p>
<h2>Twitter backgrounds</h2>
<p><a href="http://pelfusion.com/freebies/free-twitter-background-templates-with-psd-files/" target="_blank"><img alt="Twitter backgrounds" src="http://pelfusion.com/wp-content/uploads/2009/06/paper-twitter-template.jpg" title="Twitter backgrounds" /></a>
<div class="clear"></div>
<p>Yep, yet another Twitter freebie. This is a nice collection of free backgrounds for your Twitter profile page. Each background comes with the Photoshop source file so you can edit to your liking. </p>
<p><a href="http://pelfusion.com/freebies/free-twitter-background-templates-with-psd-files/" target="_blank">Twitter backgrounds&#8230;</a></p>
<h2>Blogger templates</h2>
<p><a href="http://dzineblog.com/2009/06/fresh-and-beautifull-blogger-templates.html" target="_blank"><img alt="Blogger templates" src="http://dzineblog.com/wp-content/uploads/2009/06/blogger_templates/15.jpg" title="Blogger templates" /></a>
<div class="clear"></div>
<p>Do you run your blog on Blogger? Try Wordpress! Just kidding ;) If you use Blogger you and want to refresh your blog look you can&#8217;t miss this collection of very beautiful Blogger templates.</p>
<p><a href="http://dzineblog.com/2009/06/fresh-and-beautifull-blogger-templates.html" target="_blank">Blogger templates&#8230;</a></p>
<h2>5 free form templates</h2>
<p><a href="http://cssglobe.com/post/3875/cssg-collections-web-forms" target="_blank"><img alt="5 free form templates" src="http://cssglobe.com/collections/forms/forms.jpg" title="5 free form templates" /></a>
<div class="clear"></div>
<p>This resource is for web designers only. It&#8217;s a collection of 5 CSS form templates. You can preview the template styles <a href="http://cssglobe.com/collections/forms/" target="_blank">here</a>. </p>
<p><a href="http://cssglobe.com/post/3875/cssg-collections-web-forms" target="_blank">5 free form templates&#8230;</a></p>
<h2>7 stone textures</h2>
<p><a href="http://www.myinkblog.com/2009/06/25/freebie-7-high-resolution-stone-textures/" target="_blank"><img alt="7 stone textures" src="http://www.myinkblog.com/wp-content/uploads/2009/06/stone4.jpg" title="7 stone textures" /></a>
<div class="clear"></div>
<p><a href="http://www.myinkblog.com/2009/06/25/freebie-7-high-resolution-stone-textures/" target="_blank">7 stone textures&#8230;</a></p>
<h2>5 floral textures</h2>
<p><a href="http://www.bittbox.com/freebies/free-texture-tuesday-floral/" target="_blank"><img alt="5 floral textures" src="http://www.bittbox.com/~caleb/free_high_res_texture_153.jpg" title="5 floral textures" /></a>
<div class="clear"></div>
<p><a href="http://www.bittbox.com/freebies/free-texture-tuesday-floral/" target="_blank">5 floral textures&#8230;</a></p>
<h2>7 coffee-stained paper textures</h2>
<p><a href="http://lostandtaken.com/blog/2009/6/23/7-coffee-stained-paper-textures.html" target="_blank"><img alt="7 coffee-stained paper textures" src="http://www.unsigneddesign.com/CoffeeStainedPaper/IMG_0002-w640.jpg" title="7 coffee-stained paper textures" /></a>
<div class="clear"></div>
<p><a href="http://lostandtaken.com/blog/2009/6/23/7-coffee-stained-paper-textures.html" target="_blank">7 coffee-stained paper textures&#8230;</a></p>
<h2>20 spray and splat Photoshop brushes</h2>
<p><a href="http://colorburned.com/2009/06/20-spray-splat-brushes-for-photoshop.html" target="_blank"><img alt="20 spray and splat Photoshop brushes" src="http://colorburned.com/wp-content/themes/cb-wp/timthumb.php?src=http://colorburned.com/wp-content/uploads/20-sprats-splats-photoshop-1.jpg&#038;w=570&#038;h=260&#038;q=100&#038;zc=1" title="20 spray and splat Photoshop brushes" /></a>
<div class="clear"></div>
<p>This set includes 20 spray and splat brushes. The brushes come in very high resolutions (over 2000px).</p>
<p><a href="http://colorburned.com/2009/06/20-spray-splat-brushes-for-photoshop.html" target="_blank">20 spray and splat Photoshop brushes&#8230;</a></p>
<h2>Light swirl Photoshop brushes collection</h2>
<p><a href="http://www.minervity.com/features/photoshop/the-ultimate-collection-of-the-best-light-swirl-photoshop-brushes/" target="_blank"><img alt="Photoshop light swirl brushes collection" src="http://static0.brusheezy.com/images/screenshots/0000/1696/genisis.PNG?1199309951" title="Photoshop light swirl brushes collection" /></a>
<div class="clear"></div>
<p>There is a ton of light swirl brushes in this collection. Be sure to check it out! </p>
<p><a href="http://www.minervity.com/features/photoshop/the-ultimate-collection-of-the-best-light-swirl-photoshop-brushes/" target="_blank">Photoshop light swirl brushes collection&#8230;</a></p>
<h2>12 paper Photoshop brushes</h2>
<p><a href="http://designm.ag/freebies/grungy-paper-photoshop-brushes/" target="_blank"><img alt="12 paper Photoshop brushes" src="http://designm.ag/images/0609/brushpack/3.jpg" title="12 paper Photoshop brushes" /></a>
<div class="clear"></div>
<p>These brushes have very high resolutions (over 2000px).</p>
<p><a href="http://designm.ag/freebies/grungy-paper-photoshop-brushes/" target="_blank">12 paper Photoshop brushes&#8230;</a></p>
<h2>8 seamless grungy stars Photoshop patterns</h2>
<p><a href="http://webtreats.mysitemyway.com/tileable-grungy-stars-photoshop-patterns-seamless-textures/" target="_blank"><img alt="8 seamless grungy stars Photoshop patterns" src="http://webtreats.mysitemyway.com/wp-content/Userfiles/Galleries/cache/66__600x600_8-webtreatsetc-grunge-star-patterns.jpg" title="8 seamless grungy stars Photoshop patterns" /></a>
<div class="clear"></div>
<p>You can download these 8 grungy stars Photoshop patterns also in .jpg formats and use them as textures.  </p>
<p><a href="http://webtreats.mysitemyway.com/tileable-grungy-stars-photoshop-patterns-seamless-textures/" target="_blank">8 seamless grungy stars Photoshop patterns&#8230;</a></p>
<h2>6 Midnight Blue Photoshop Patterns</h2>
<p><a href="http://webtreats.mysitemyway.com/6-free-midnight-blue-photoshop-patterns/" target="_blank"><img alt="6 Midnight Blue Photoshop Patterns" src="http://webtreats.mysitemyway.com/wp-content/Userfiles/Galleries/cache/176__600x600_preview.jpg" title="6 Midnight Blue Photoshop Patterns" /></a>
<div class="clear"></div>
<p><a href="http://webtreats.mysitemyway.com/6-free-midnight-blue-photoshop-patterns/" target="_blank">6 pattern per Photoshop</a></p>
<h2>Advent</h2>
<p><a href="http://inde-graphics.deviantart.com/art/advent-font-57338302" target="_blank"><img alt="Advent" src="http://fc01.deviantart.com/fs40/i/2009/019/7/0/advent_font_by_inde_graphics.jpg" title="Advent" /></a>
<div class="clear"></div>
<p><a href="http://inde-graphics.deviantart.com/art/advent-font-57338302" target="_blank">Advent&#8230;</a></p>
<h2>Women&#8217;s Fashion Vector Collection</h2>
<p><a href="http://www.blog.spoongraphics.co.uk/freebies/free-vector-doodles-womens-clothing-fashion" target="_blank"><img alt="Women's Fashion Vector Collection" src="http://blogspoon.s3.amazonaws.com/wp-content/uploads/2009/womens-fashion/Womens-Fashion-Doodles.png" title="Women's Fashion Vector Collection" /></a>
<div class="clear"></div>
<p>This vector set of clothes and accessories for women was created by Chris Spooner.</p>
<p><a href="http://www.blog.spoongraphics.co.uk/freebies/free-vector-doodles-womens-clothing-fashion" target="_blank">Women&#8217;s Fashion Vector Collection&#8230;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggingcss.com/en/risorse/free-resources-of-the-week-2/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
