<?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>AjaxMasters Blog &#187; css</title> <atom:link href="http://blog.ajaxmasters.com/tag/css/feed/" rel="self" type="application/rss+xml" /><link>http://blog.ajaxmasters.com</link> <description>Just another WordPress weblog</description> <lastBuildDate>Thu, 24 Jun 2010 11:55:25 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Google Font Directory</title><link>http://blog.ajaxmasters.com/google-font-directory/</link> <comments>http://blog.ajaxmasters.com/google-font-directory/#comments</comments> <pubDate>Wed, 19 May 2010 23:37:17 +0000</pubDate> <dc:creator>Chocksy</dc:creator> <category><![CDATA[Trends]]></category> <category><![CDATA[Tutorial]]></category> <category><![CDATA[css]]></category> <category><![CDATA[directory]]></category> <category><![CDATA[fonts]]></category> <category><![CDATA[google]]></category> <category><![CDATA[layout]]></category><guid
isPermaLink="false">http://blog.ajaxmasters.com/?p=381</guid> <description><![CDATA[<a
href="http://blog.ajaxmasters.com/google-font-directory/"><img
align="left" hspace="5" width="150" height="150" src="http://blog.ajaxmasters.com/wp-content/uploads/2010/05/font_directory_logo_beta-170x170.png" class="alignleft tfe wp-post-image" alt="" title="Google Font Directory" /></a>I just watched a video from nettuts where they show the new Google Font Directory and how easy it is to use it. I just had to share this with you guys.
Here is the videoAnd the links to the font directory: Google Font Directory and a tutorial on getting started: tutorial
]]></description> <content:encoded><![CDATA[<p>I just watched a video from <a
href="http://net.tutsplus.com/" target="_blank">nettuts</a> where they show the new <a
href="http://code.google.com/webfonts" target="_blank">Google Font Directory</a> and how easy it is to use it. I just had to share this with you guys.</p><p>Here is the video<br/><br
/> <object
width="600" height="385"><param
name="movie" value="http://www.youtube.com/v/ivhgb0urkFA&#038;hl=en_US&#038;fs=1&#038;"></param><param
name="allowFullScreen" value="true"></param><param
name="allowscriptaccess" value="always"></param><embed
src="http://www.youtube.com/v/ivhgb0urkFA&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="385"></embed></object></p><p>And the links to the font directory: <a
href="http://code.google.com/webfonts" target="_blank">Google Font Directory</a> and a tutorial on getting started: <a
href="http://code.google.com/apis/webfonts/docs/getting_started.html" target="_blank">tutorial</a></p> ]]></content:encoded> <wfw:commentRss>http://blog.ajaxmasters.com/google-font-directory/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Awesome CSS+JS form styling</title><link>http://blog.ajaxmasters.com/awesome-cssjs-form-styling/</link> <comments>http://blog.ajaxmasters.com/awesome-cssjs-form-styling/#comments</comments> <pubDate>Tue, 09 Mar 2010 17:23:39 +0000</pubDate> <dc:creator>Chocksy</dc:creator> <category><![CDATA[Tutorial]]></category> <category><![CDATA[css]]></category> <category><![CDATA[form]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[jquery]]></category> <category><![CDATA[js]]></category> <category><![CDATA[sexy]]></category> <category><![CDATA[styling]]></category><guid
isPermaLink="false">http://blog.ajaxmasters.com/?p=309</guid> <description><![CDATA[<a
href="http://blog.ajaxmasters.com/awesome-cssjs-form-styling/"><img
align="left" hspace="5" width="150" height="150" src="http://blog.ajaxmasters.com/wp-content/uploads/2010/03/sexy-form-170x170.png" class="alignleft tfe wp-post-image" alt="Sexy CSS+JS Form" title="sexy-form" /></a>I was working on our new open source project that i think you will like and I was working on the registration page. This is what I got in the end and i will walk you trough the process with me. This new tutorial is about styling the forms of your website, I find it very good looking and very simple to implement. We will use simple CSS and some [...]]]></description> <content:encoded><![CDATA[<div
id="attachment_312" class="wp-caption alignleft" style="width: 310px"><a
href="http://blog.ajaxmasters.com/awesome-cssjs-form-styling/sexy-form/" rel="attachment wp-att-312"><img
src="http://blog.ajaxmasters.com/wp-content/uploads/2010/03/sexy-form-300x214.png" alt="Sexy CSS Form" title="sexy-form" width="300" height="214" class="size-medium wp-image-312" /></a><p
class="wp-caption-text">Sexy CSS+JS Form</p></div><p>I was working on our new open source project that i think you will like and I was working on the registration page. This is what I got in the end and i will walk you trough the process with me. This new tutorial is about styling the forms of your website, I find it very good looking and very simple to implement. We will use simple CSS and some JavaScript.</p><p>Usually for inserting text into the inputs or our forms we set the value attribute with the text and then use javascript to check for different scenarios for doing some fancy things. This is different we will use labels to fill the text and move them under the inputs and then just do our magic with JS.</p><p>The JavaScript library that we will use to create this effect for our forms is <a
href="http://jquery.com" target="_blank">Jquery</a></p><p><br/><br
/> <strong
class="in_title">1. Creating the markup!</strong><br
/> <br/></p><pre class="brush: xml;">
            &lt;div id=&quot;login&quot;&gt;
                &lt;div class=&quot;sayit&quot;&gt;Log In:&lt;/div&gt;
                &lt;form action=&quot;javascript:void(0)&quot; onsubmit=&quot;login()&quot; autocomplete=&quot;off&quot;&gt;
                    &lt;label for=&quot;username&quot;&gt;Username&lt;/label&gt;
                    &lt;input type=&quot;text&quot; id=&quot;username&quot;/&gt;
                    &lt;label for=&quot;password&quot;&gt;Password&lt;/label&gt;
                    &lt;input type=&quot;password&quot; id=&quot;password&quot;/&gt;
                    &lt;input type=&quot;submit&quot; class=&quot;medium button green&quot; value=&quot;Log me In&quot;/&gt;
                &lt;/form&gt;
            &lt;/div&gt;
</pre><p>The above code is our markup and as you can see is very simple and it can be changed as you like because the code that we will use for checking for different scenarios in javascript will work without necessary classes or ids. We have 2 inputs and 2 labels, one is password one is text and we can work with these ones, you can add as many as you like.</p><p>Now let&#8217;s style these bastards! <img
src='http://blog.ajaxmasters.com/wp-content/plugins/smilies-themer/pidgin/smile-big.png' alt=':D' class='wp-smiley' /></p><p><strong
class="in_title">2. Use CSS to style the form elements!</strong><br
/> <br/></p><pre class="brush: css;">
input[type=text],input[type=password]{padding: 5px 10px; background-color: transparent;	position: relative; z-index: 2;}
label{position: absolute; z-index: 1;-webkit-transition: opacity 0.15s linear; color: #bababa; background-color: #FFFFFF; }

#login{width: 290px; margin: 0 auto;}
#login input[type=text],#login input[type=password]{width:270px; margin: 5px 0; font-size: 24px; font-weight: bold; border: 1px solid #ccc; -moz-border-radius:5px; -webkit-border-radius:5px; color: #595959;}
#login label{font-size: 24px; margin: 14px 10px;}

#login .sayit{font-size:24px; color: #595959; font-style: italic; padding-bottom: 5px;}
</pre><p>What we did here is make the label absolute so it will go under the input. This is important you will have to place the label before the input so remember this! The input will have a position relative and a z-index of 2 so we can be sure it will land above the label. Next we define the login div by using his id(<i>#login</i>). We use CSS3 for creating the round borders for the input and style the label by setting a big font-size to fit the input. The rest is pretty obvious, if you have trouble understanding this then let us know in the comments.</p><p><strong
class="in_title">3. Make everything move with JS!</strong><br
/> <br/></p><pre class="brush: jscript;">
$(document).ready(function(){
    $.string(String.prototype);
    $(&quot;input,textarea&quot;).each(function (type) {
        $(this).focus(function () {
            if($(this).val().blank())
                $(this).prev(&quot;label&quot;).fadeTo('fast',0.45);
        });

        $(this).keypress(function () {
            $(this).prev(&quot;label&quot;).fadeTo('fast',0);
        });

        $(this).blur(function () {
            if($(this).val().blank()){
                $(this).prev(&quot;label&quot;).fadeTo('fast',1);
            }
        });
    });
});
</pre><p>We use here jQuery of course that we add using the google api like this:</p><pre class="brush: xml;">
        &lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js&quot;&gt;&lt;/script&gt;
</pre><p>And one plugin that I use to extend the jQuery string properties and that is <a
href="http://stilldesigning.com/dotstring/">$.string plugin</a>. After we do that we create the above code and we assign to input and textarea elements a focus, keypress and blur actions. We use the focus action to lower the labels opacity to 45% then on keypress we just hide it for good. Then on blur we check to see if anything was written in our sexy element and if not then we fade the label back to 100%. This is kind of everything we do here, pretty simple. <img
src='http://blog.ajaxmasters.com/wp-content/plugins/smilies-themer/pidgin/smile.png' alt=':)' class='wp-smiley' /></p><p><strong
class="in_title">4. Showing of a demo and download source</strong><br
/> <br/></p><p>I&#8217;ve set up a demo here: <a
href="http://tutorials.ajaxmasters.com/sexy-form/" target="_blank"><b><i>DEMO</i></b></a></p><p>The source code you can either pick it from the demo page or from here: <a
href="http://tutorials.ajaxmasters.com/sexy-form/source.zip"><b><i>SOURCE</i></b></a></p><p><strong
class="in_title">5. Wrapping up!</strong><br
/> <br/></p><p>So here is our nice form styling that you can use on your website and that can be done very easily. Feel free to leave us comments and suggestions. <b>Thanks a lot!</b></p><p>Have fun coding!</p> ]]></content:encoded> <wfw:commentRss>http://blog.ajaxmasters.com/awesome-cssjs-form-styling/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Playing with CSS3</title><link>http://blog.ajaxmasters.com/playing-with-css3/</link> <comments>http://blog.ajaxmasters.com/playing-with-css3/#comments</comments> <pubDate>Thu, 01 Oct 2009 18:55:57 +0000</pubDate> <dc:creator>Chocksy</dc:creator> <category><![CDATA[Tutorial]]></category> <category><![CDATA[css]]></category> <category><![CDATA[css3]]></category> <category><![CDATA[imageroll]]></category> <category><![CDATA[shadows]]></category><guid
isPermaLink="false">http://blog.ajaxmasters.com/?p=185</guid> <description><![CDATA[<a
href="http://blog.ajaxmasters.com/playing-with-css3/"><img
align="left" hspace="5" width="150" height="150" src="http://blog.ajaxmasters.com/wp-content/uploads/2009/10/play_css3-170x170.png" class="alignleft wp-post-image tfe" alt="Play with CSS3" title="play_css3" /></a><p>If you saw our "<b>ImageRoll</b>" page and you used Firefox, Chrome or Safari then you saw the images being rotated in different angles well the way i did that is by using CSS3. I guess you already figured that out from the title. :)</p><p>CSS3 implements a lot of new features that can make your life easier of course you will not be able to use them quite yet. IE is not supporting like more than 90% of them so it's useless if you want to make this for a client. The ones that we used on our blog are: <b>box-shadow</b>, <b>border-radius</b> and <b>text-shadow</b>. [...]</p>]]></description> <content:encoded><![CDATA[<div
id="attachment_186" class="wp-caption alignleft" style="width: 249px"><a
href="http://blog.ajaxmasters.com/wp-content/uploads/2009/10/play_css3.png"><img
src="http://blog.ajaxmasters.com/wp-content/uploads/2009/10/play_css3.png" alt="Play with CSS3" title="play_css3" width="239" height="239" class="size-full wp-image-186" /></a><p
class="wp-caption-text">Play with CSS3</p></div><p>If you saw our &#8220;<b>ImageRoll</b>&#8221; page and you used Firefox, Chrome or Safari then you saw the images being rotated in different angles well the way i did that is by using CSS3. I guess you already figured that out from the title. <img
src='http://blog.ajaxmasters.com/wp-content/plugins/smilies-themer/pidgin/smile.png' alt=':)' class='wp-smiley' /></p><p>CSS3 implements a lot of new features that can make your life easier of course you will not be able to use them quite yet. IE is not supporting like more than 90% of them so it&#8217;s useless if you want to make this for a client. The ones that we used on our blog are: <b>box-shadow</b>, <b>border-radius</b> and <b>text-shadow</b>. I think these are the most important of them but you can check all of them out by taking a look at this page: <a
href="http://www.css3.info/preview/" title="http://www.css3.info/preview/">css3.info/preview/</a>.</p><p>I&#8217;m gonna do a simple explanation on the ones we used and show you some code.</p><p>We used on the hrefs of the page this property:</p><pre class="brush: css;">
-moz-box-shadow: 0px 2px 15px #333;
</pre><p>Now let&#8217;s explain. Why &#8220;-moz&#8221; in front of it? This is a simple hack for those who don&#8217;t know it. It tells the browser to render this only in <b>mozilla</b> based browsers. Next we have the property box-shadow  and 0px means the top margin of the shadow, 2px means we move the shadow 2 pixels to the left and 15px<br
/> means we create a shadow with 15 pixels of size of blur if you want, #333 is of course the color of the box shadow. Pretty simple <img
src='http://blog.ajaxmasters.com/wp-content/plugins/smilies-themer/pidgin/smile.png' alt=':)' class='wp-smiley' /> .</p><p>Now let&#8217;s rotate the images:</p><pre class="brush: css;">
   -webkit-transform: rotate(-10deg);
    -moz-transform: rotate(-10deg);
</pre><p>You know -moz- already but we have a new one &#8220;-webkit-&#8221; this one means it will render in webkit based browsers, the most popular are: Safari and Chrome. Next we have the property &#8220;transform&#8221; and the degree of rotation &#8220;-10deg&#8221;.</p><p>The other one that we used all over the blog is text-shadow</p><pre class="brush: css;">
text-shadow:1px 1px 0px #000;
</pre><p>This property is like this 1px means we move the shadow with 1 pixel from the top, 1 pixel from the left and 0 blur or size, #000 means of course the color of the shadow.</p><p>And here is a preview in 2 browsers IE and Firefox so you can see maybe you are not using a browser that supports CSS3.</p><div
id="attachment_193" class="wp-caption aligncenter" style="width: 610px"><a
href="http://blog.ajaxmasters.com/wp-content/uploads/2009/10/ie.png"><img
src="http://blog.ajaxmasters.com/wp-content/uploads/2009/10/ie-600x705.png" alt="Ie view" title="ie" width="600" height="705" class="size-large wp-image-193" /></a><p
class="wp-caption-text">Ie view</p></div><br
/><div
id="attachment_194" class="wp-caption aligncenter" style="width: 610px"><a
href="http://blog.ajaxmasters.com/wp-content/uploads/2009/10/firefox.png"><img
src="http://blog.ajaxmasters.com/wp-content/uploads/2009/10/firefox-600x642.png" alt="Firefox view" title="firefox" width="600" height="642" class="size-large wp-image-194" /></a><p
class="wp-caption-text">Firefox view</p></div><p>My imageroll page is inspired from this page: <a
href="http://line25.com/tutorials/how-to-create-a-pure-css-polaroid-photo-gallery">line25.com/tutorials/how-to-create-a-pure-css-polaroid-photo-gallery</a> . Go and check it out <img
src='http://blog.ajaxmasters.com/wp-content/plugins/smilies-themer/pidgin/good.png' alt='(Y)' class='wp-smiley' /> .</p><p>Thank you and happy coding! <img
src='http://blog.ajaxmasters.com/wp-content/plugins/smilies-themer/pidgin/wink.png' alt=';)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://blog.ajaxmasters.com/playing-with-css3/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Write better CSS</title><link>http://blog.ajaxmasters.com/css-shortcuts/</link> <comments>http://blog.ajaxmasters.com/css-shortcuts/#comments</comments> <pubDate>Wed, 23 Sep 2009 23:10:09 +0000</pubDate> <dc:creator>Chocksy</dc:creator> <category><![CDATA[Tutorial]]></category> <category><![CDATA[css]]></category><guid
isPermaLink="false">http://blog.ajaxmasters.com/?p=94</guid> <description><![CDATA[<a
href="http://blog.ajaxmasters.com/css-shortcuts/"><img
align="left" hspace="5" width="150" height="150" src="http://blog.ajaxmasters.com/wp-content/uploads/2009/09/css-blog-pic-170x170.png" class="alignleft wp-post-image tfe" alt="Write Better CSS" title="css-blog-pic" /></a><p>When writing your CSS, it is possible to write neater, more readable code by making use of CSS shortcuts. A shortcut is a feature of CSS that allows the developer to specify a number of related properties on a single line rather than specify them all separately. Lets look at the following example:</p> .header {
padding-top:5px;
padding-right:10px;
padding-bottom:5px;
[...]]]></description> <content:encoded><![CDATA[<div
id="attachment_108" class="wp-caption aligncenter" style="width: 310px"><a
href="http://blog.ajaxmasters.com/wp-content/uploads/2009/09/css-blog-pic.png"><img
src="http://blog.ajaxmasters.com/wp-content/uploads/2009/09/css-blog-pic.png" alt="Write Better CSS" title="css-blog-pic" width="300" height="300" class="size-full wp-image-108" /></a><p
class="wp-caption-text">Write Better CSS</p></div><p>When writing your CSS, it is possible to write neater, more readable code by making use of CSS shortcuts. A shortcut is a feature of CSS that allows the developer to specify a number of related properties on a single line rather than specify them all separately. Lets look at the following example:</p><pre class="brush: css;">
.header {
padding-top:5px;
padding-right:10px;
padding-bottom:5px;
padding-left:10px;
}
</pre><p>The code above is perfectly valid and will work fine, but we can save time and make the code much neater using the following code:</p><pre class="brush: css;">
.header {
padding:5px 10px 5px 10px;
}
</pre><p>Using the code above we can specify all of the padding for the header div on one line. It works by applying the first attribute (5px) to the top padding of the div. The second (10px) applies to the right side padding, the 3rd (5px) attribute means the padding on the bottom of the div, and the forth (10px) attribute means the left side padding. The padding is always applied in this order.</p><p>It is possible to shorten this code even further using the following code:</p><pre class="brush: css;">
.header {
padding:5px 10px;
}
</pre><p>This works by taking the first (5px) attribute to mean the top and bottom, or vertical padding, and the second (10px) attribute to mean the horizontal padding (left and right).</p><p>The exact same principles can be used to declare the margin of your divs, so what could have looked like this:</p><pre class="brush: css;">
.header {
padding-top:5px;
padding-right:10px;
padding-bottom:5px;
padding-left:10px;
margin-top:5px;
margin-right:10px;
margin-bottom:5px;
margin-left:10px;
}
</pre><p>Can now look much neater, and is obviously much quicker to write using the following:</p><pre class="brush: css;">
.header {
padding:5px 10px;
margin:5px 10px;
}
</pre><div
class="in_title"><strong>Background properties</strong></div><p>One of my favorite CSS shortcuts is the background property shortcut. This is how a typical CSS file could look without shortcuts:</p><pre class="brush: css;">
.header {
background-image:url(images/image.jpg);
background-position:top;
background-repeat:repeat-x;
background-color:#fff;
}
</pre><p>However, with some nifty CSS it could look like this:</p><pre class="brush: css;">
.header {
background: #fff url(images/image.jpg) repeat-x top;
}
</pre><p>The above code is much quicker and more manageable. Take note though, that all of the properties must be provided when using the background shortcut. If I missed off the colour specification at the beginning for example, the code would not work.</p><div
class="in_title"><strong>Font shortcuts</strong></div><p>Another very useful shortcut is the font shortcut. The code below can be shorted considerably:</p><pre class="brush: css;">
body {
font-weight: bold;
font-family: verdana, sans-serif;
font-size: 0.8em;
line-height: 1.2em;
}
</pre><p>Here is the shortcut:</p><pre class="brush: css;">
body {
font: bold 0.8em/1.2em verdana, sans-serif;
}
</pre><p>It is important to write the shortcut in the same order as above so that web browsers don&#8217;t get confused!</p><div
class="in_title"><strong>Borders</strong></div><p>This is my favorite shortcut of all. This saves me a great deal of time when I am developing web sites because whenever I have a problem with a layout or an element, the first thing I do is put a border around it so that I can see its dimensions and work out what&#8217;s going on.</p><p>Here is some typical code:</p><pre class="brush: css;">
.header {
border-width: 1px;
border-color: #000;
border-style: solid;
}
</pre><p>This can be shorted to the following:</p><pre class="brush: css;">
.header {
border:1px solid #000;
}
</pre><p>Then, whenever you are not sure why an element is not behaving properly, just use the border shortcut above to debug your code and see what the dimensions of the element are.</p><div
class="in_title"><strong>Conclusion</strong></div><p>As you can see, you can make your code much shorter and neater using the CSS shortcuts outlined here. Once you get into the habit of using them, I guarantee that you will wonder why you ever did it differently in the past!</p> ]]></content:encoded> <wfw:commentRss>http://blog.ajaxmasters.com/css-shortcuts/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 6/36 queries in 0.032 seconds using disk

Served from: blog.ajaxmasters.com @ 2010-07-31 13:29:57 -->