<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"><id>tag:blogger.com,1999:blog-4843224028361594470</id><updated>2012-05-25T01:40:36.608-07:00</updated><category term="Image Captioning" /><category term="a href" /><category term="Descendants" /><category term="list-style-type" /><category term="Image Grid" /><category term="outside" /><category term="Unordered Lists" /><category term="HTML5 Rocks" /><category term="mysqli_num_rows" /><category term="Google Font" /><category term="border" /><category term="PHP sort" /><category term="Intermediate" /><category term="Barrel Distortion" /><category term="Global Object" /><category term="Apache" /><category term="IP Packet" /><category term="Caltech" /><category term="Raspberry Pi" /><category term="Hollow Photoshop Circles" /><category term="IPv6" /><category term="Eric Meyer" /><category term="RFC" /><category term="SSH" /><category term="CSS" /><category term="Javascript" /><category term="Network Address Translation" /><category term="Substring Matching Attribute Selector" /><category term="wf-inactive" /><category term="font-style" /><category term="Pseudo Element" /><category term="networking" /><category term="The Cascade" /><category term="-moz-border-radius" /><category term="Microsoft Security Essentials" /><category term="WIFI" /><category term="Life" /><category term="Array" /><category term="Firefox" /><category term="INSERT INTO" /><category term="Centering Images" /><category term="z-index" /><category term="IP Address" /><category term="Sessions" /><category term="Headings" /><category term="FAT32" /><category term="PNG Transparency Files" /><category term="Internet Explorer" /><category term="Modifying Blogger" /><category term="Webkit" /><category term="DIV" /><category term="CDN" /><category term="Inline Element" /><category term="outline:none" /><category term="wf-active" /><category term="3 Column Layout" /><category term="Bob Parsons" /><category term="Microsoft" /><category term="Chaining" /><category term="gparted" /><category term="Cache" /><category term="hr" /><category term="jQuery UI" /><category term="Meddon" /><category term="Router" /><category term="CSS Resets" /><category term="Browsers" /><category term="Color Swatch" /><category term="Photoshop Action" /><category term="text-indent" /><category term="USB Device" /><category term="Variables" /><category term="Browser Wars" /><category term="a:hover" /><category term="Notepad++" /><category term="Shared Hosting" /><category term="Particular Attribute Selector" /><category term="Transparency" /><category term="FOUT" /><category term="Pullqutoes" /><category term="mysqli_query" /><category term="Inheritance" /><category term="list marker" /><category term="Size an Image Using CSS" /><category term="Parallelism" /><category term="watermark" /><category term="IE6" /><category term="td" /><category term="ASCII" /><category term="Secure Shell" /><category term="Parsing RSS Feed" /><category term="CSS 3" /><category term="PHP" /><category term="Value Attribute Selector" /><category term="Google Chrome" /><category term="CSS Tutorials" /><category term="Unordered List" /><category term="CSS3" /><category term="Truncation" /><category term="Browser Internals" /><category term="Descendant Selector" /><category term="Tools" /><category term="Dedicated Server" /><category term="CSS visibility" /><category term="inline style" /><category term="Horizontal Bar Graph" /><category term="Blogger Template" /><category term="Form Element" /><category term="PHP Array of Arrays" /><category term="MYSQLI_ASSOC" /><category term="tbody" /><category term="overflow: hidden;" /><category term="Expand Widget Templates" /><category term="clear" /><category term="li" /><category term="display" /><category term="italic" /><category term="Scrolling Tables" /><category term="C" /><category term="Networking Driver" /><category term="CSS 3.0 Gradient" /><category term="Stu Nicholls" /><category term="PHP Syntax" /><category term="PHP if" /><category term="XAMPP" /><category term="Computing News" /><category term="HTTP" /><category term="Photoshop" /><category term="Foreign Keys" /><category term="nav" /><category term="IP Header" /><category term="Flash" /><category term="Sonet OC3" /><category term="UDP" /><category term="Form Tag" /><category term="Google Privacy" /><category term="Console" /><category term="Safari" /><category term="Google API" /><category term="IP" /><category term="top" /><category term="Specificity" /><category term="Escaping Characters in CSS" /><category term="Inserting Records into Database" /><category term="Adobe" /><category term="Rounded Corners" /><category term="jQuery" /><category term="display:block; Cookie Cutter Method" /><category term="IP Packets" /><category term="Inserting MySQL Records" /><category term="SFTP" /><category term="Anti-Virus Software" /><category term="mysqli_connect" /><category term="Crop an Image Using CSS" /><category term="Sprites" /><category term="Developer" /><category term="Padding and Margins" /><category term="Objects" /><category term="first-child" /><category term="Transparent Border in Photoshop" /><category term="Protocol" /><category term="important" /><category term="-webkit-gradient" /><category term="background-image" /><category term="CSS Bar Graphs" /><category term="Photoshop Macro" /><category term="VPS" /><category term="FTP/SFTP Clients" /><category term="Cookies" /><category term="Recipes" /><category term="Cufon" /><category term="line-height" /><category term="Google Maps" /><category term="Graph" /><category term="Cloud Hosting" /><category term="Twitter" /><category term="Multiple Backgrounds" /><category term="PHP in_array" /><category term="Domain Registrar" /><category term="Dave Shea" /><category term="Favicon" /><category term="overflow:auto" /><category term="gutter" /><category term="Windows Driver" /><category term="TCP/IP" /><category term="Reset" /><category term="print_r" /><category term="Tweet" /><category term="Friends of Apache" /><category term="Embedded Styles" /><category term="HTTP Headers" /><category term="CSS3.0" /><category term="Faux Columns" /><category term="HTML Elements" /><category term="CSS Zen Garden" /><category term="CPU" /><category term="background" /><category term="Curl" /><category term="Websites" /><category term="User Style Sheet" /><category term="IE Compatibility Mode" /><category term="GraublauWeb" /><category term="Menu" /><category term="Virtual Private Server" /><category term="LAMP" /><category term="Internet" /><category term="list-style-image" /><category term="CSS Quote Property" /><category term="Tantek Celik" /><category term="Positioning Elements" /><category term="NexStar" /><category term="Definition Lists" /><category term="CSS 3.0 Transforms" /><category term="Drop Cap" /><category term="Blogspot" /><category term="Search" /><category term="API" /><category term="border-radius" /><category term="C#" /><category term="Domain Name Server" /><category term="right-margin" /><category term="Firebug Console" /><category term=":before" /><category term="p element" /><category term="Blog Software" /><category term="Data Cells" /><category term="CSS 3.0 last-child" /><category term="E Ink" /><category term="article" /><category term="Primary Keys" /><category term="Pop-ups" /><category term="Compiler" /><category term="Ordered Lists" /><category term="-moz-linear-gradient" /><category term="Blockquotes" /><category term="Google AdSense" /><category term="Windows" /><category term="WebFontConfig" /><category term="Stephen Hawking" /><category term="SELECT" /><category term="Table Layout" /><category term="thead" /><category term="Backward Slash" /><category term="External Stye Sheets" /><category term="Search Engine Optimization" /><category term="Cron Job" /><category term="Hex Codes" /><category term="Events" /><category term="Forms" /><category term="Relative Path" /><category term="Background Property" /><category term="Reader Style Sheet" /><category term="Absolute Positioning" /><category term="photo gallery" /><category term="font-face" /><category term="HTML Forms" /><category term="Negative Margin" /><category term="Origin" /><category term="span" /><category term="left" /><category term="Captioning" /><category term="p" /><category term="MySpace" /><category term="Firefox Personas" /><category term="Margins between Floated and Cleared Elements" /><category term="Styling a Page" /><category term="server side" /><category term="float next to ul" /><category term="Cascade" /><category term="HTML Blockquote" /><category term="CSS Zen Garden Dave Shea" /><category term="Parent-Child Relationship" /><category term="Typekit" /><category term="h1" /><category term="cross-domain" /><category term="Layout" /><category term="Floating LI element" /><category term="Creating MySQL Tables" /><category term="HTTP Request Headers" /><category term="Copyright Symbol" /><category term="Eclipse" /><category term="Search Engine" /><category term="Order" /><category term="CSS Syntax" /><category term="Cross Browser Platforms" /><category term="Navigation Menu" /><category term="NTFS" /><category term="PHP foreach" /><category term="Sprite" /><category term="HTTP GET" /><category term="PHP empty" /><category term="The Flow" /><category term="display:block; Fonts and Text" /><category term="Floats" /><category term="Fluid Rose for Zen Garden" /><category term="wf-loading" /><category term="Background Positioning" /><category term="Software Testing" /><category term="CSS Content Property" /><category term="Oracle" /><category term="IDE" /><category term="Google Search" /><category term="Simple Attribute Selector" /><category term="Selectors" /><category term="The Site" /><category term="Software Design" /><category term="Margin Collapsing" /><category term="Searching RSS Feed" /><category term="CSS 3.0 Multiple Background Images" /><category term="JSON" /><category term="markup" /><category term="Removing Hard Disk in a Laptop" /><category term="Adjusting Blogger Profile Image" /><category term="Image Captioning Tool" /><category term="background-repeat" /><category term="Margin" /><category term="Classes and IDs" /><category term="Disk Partitions" /><category term="header" /><category term="Server" /><category term="CREATE TABLE" /><category term="Relative Positioning" /><category term="Beginner" /><category term="PHP Short Tags" /><category term="Google" /><category term="Framing an Image" /><category term="Functions" /><category term="I'm not a witch" /><category term="The Right To Be Forgotten Initiative" /><category term="Bing" /><category term="IPC" /><category term="Content Delivery Network" /><category term="Linux" /><category term="Author Style Sheet" /><category term="Ubuntu" /><category term="Regular Expression" /><category term="ul" /><category term="Opacity" /><category term="External Enclosure" /><category term="hgroup" /><category term="DNS" /><category term="HTTPS" /><category term="inside" /><category term="Attribute Selectors" /><category term="Technorati" /><category term="img" /><category term="visibility" /><category term="PS Lens Flare" /><category term="localhost" /><category term="Scope" /><category term="DOM" /><category term="Image Replacement" /><category term="RSS" /><category term="Period in a Class/ID Name" /><category term="Adobe Photoshop Tutorials" /><category term="DSL" /><category term="containing block" /><category term="IP Route" /><category term="Style Sheets" /><category term="link" /><category term="Float" /><category term="IE Punches" /><category term="Multi-Column Layout" /><category term="Nameserver" /><category term="Funny" /><category term="Class" /><category term="PS Mosaic" /><category term="Block Element" /><category term="HTTP Response Headers" /><category term="MySQL" /><category term="Rounding Corners of an Image" /><category term="Input" /><category term="aside" /><category term="Positioning" /><category term="Tables with Fixed Headings" /><category term="th" /><category term="Ubuntu 10.04" /><category term="Browser Default Style Sheet" /><category term="display: none; visibility" /><category term="HTML" /><category term="overflow property" /><category term="list-style-position" /><category term="Floating" /><category term="Google Webfonts" /><category term="text-align" /><category term="multiple class" /><category term="Relational Database" /><category term="Kindle" /><category term="Automated Tools" /><category term="display:block;" /><category term="width" /><category term="Auto Margins" /><category term="background-position" /><category term="RSS Feed" /><category term="Latency" /><category term="overflow" /><category term="Fonts and Text" /><category term="Drop Shadow" /><category term="Apache Server on Local Environment" /><category term="$geo_status" /><category term="Positioning Context" /><category term="C++" /><category term="PS Find Edges" /><category term="display:block; display:none" /><category term="How CSS Works" /><category term="PS Perspective" /><category term="CEO" /><category term="IPv4" /><category term="Dual Stack" /><category term="height" /><category term="Footer" /><category term="XHTML" /><category term="port" /><category term="Flash of Unstyled Text" /><category term="PHP Variable Dump" /><category term="box-shadow" /><category term="Digg" /><category term="Floating IMG element" /><category term="IETF.org" /><category term="Toshiba R500" /><category term="HTML5" /><category term="StumbleUpon" /><category term="Windows 7" /><category term="PHP count" /><category term="Godaddy" /><category term="phpMyAdmin" /><category term="background-color" /><category term="Ethernet" /><category term="border-bottom" /><category term="Loading Times" /><category term="h3" /><category term="Fading Image" /><category term="Microsoft Word" /><category term="text-shadow" /><category term="last-child" /><category term="Caching" /><category term="Art" /><category term="PNG Format" /><category term="MySpace Layout Tutorials" /><category term="Website Design" /><category term="ID" /><category term="mysqli_fetch_array" /><category term="FileZilla" /><category term="SEO" /><category term="HTML Table" /><category term="IE" /><category term="Code Igniter" /><category term="Photoshop Action Palette" /><category term=":after" /><category term="Google GeoCoding" /><title type="text">CSS Bakery</title><subtitle type="html">An interactive reference guide for Cascading Style Sheets - CSS.  Also includes tutorials and information on HTML, PHP, Javascript, Adobe Photoshop and Blogger modifications.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.cssbakery.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.cssbakery.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default?start-index=26&amp;max-results=25" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>238</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/CssBakery" /><feedburner:info uri="cssbakery" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-6034152448479689566</id><published>2012-05-22T00:15:00.004-07:00</published><updated>2012-05-22T01:16:41.957-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DNS" /><category scheme="http://www.blogger.com/atom/ns#" term="Nameserver" /><category scheme="http://www.blogger.com/atom/ns#" term="Godaddy" /><category scheme="http://www.blogger.com/atom/ns#" term="Domain Name Server" /><category scheme="http://www.blogger.com/atom/ns#" term="Domain Registrar" /><title type="text">Setting Name Servers for Your Domains</title><content type="html">After you get a new domain name, you need to tell DNS how to resolve that name into an IP address for your Web server. DNS requests are initiated by the browser.  Anytime you go to a website, the domain name must be mapped into an IP address.&lt;br /&gt;&lt;br /&gt;The first step in setting up your domain is to map your domain name to your hosting provider's name servers.  If you are using GoDaddy, here's the domain details page, where you'll find the "Nameservers" pulldown.  Select "Set Nameservers".&lt;br /&gt;&lt;br /&gt;&lt;img alt="Domain Name Server" src="http://pics.cssbakery.com/pics/DomainNameServer3.jpg" /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;This screenshot is specific to GoDaddy, but then it's a very popular domain registrar.  If you use someone else they will have similar functionality.&lt;br /&gt;&lt;br /&gt;Here I've set the names of three nameservers from my hosting provider:&lt;br /&gt;&lt;br /&gt;&lt;img alt="Domain Name Server" src="http://pics.cssbakery.com/pics/DomainNameServer2.jpg" /&gt;&lt;br /&gt;The DNS (Domain Name Server) from my hosting provider which is Rackspace (previously Slicehost) will handle the DNS request and map it into an IP address of my server. I'll talk about the next step in the process - configuring your hosting provider's DNS records - later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-6034152448479689566?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/JU8nVCObhI8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/6034152448479689566/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/05/setting-name-servers-for-your-domain.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/6034152448479689566" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/6034152448479689566" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/JU8nVCObhI8/setting-name-servers-for-your-domain.html" title="Setting Name Servers for Your Domains" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/05/setting-name-servers-for-your-domain.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-8705099842058581537</id><published>2012-05-07T15:18:00.006-07:00</published><updated>2012-05-07T15:23:41.386-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP" /><category scheme="http://www.blogger.com/atom/ns#" term="Javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="Variables" /><category scheme="http://www.blogger.com/atom/ns#" term="Functions" /><category scheme="http://www.blogger.com/atom/ns#" term="Events" /><category scheme="http://www.blogger.com/atom/ns#" term="Global Object" /><category scheme="http://www.blogger.com/atom/ns#" term="Scope" /><category scheme="http://www.blogger.com/atom/ns#" term="Chaining" /><category scheme="http://www.blogger.com/atom/ns#" term="C++" /><category scheme="http://www.blogger.com/atom/ns#" term="Objects" /><category scheme="http://www.blogger.com/atom/ns#" term="Firebug Console" /><category scheme="http://www.blogger.com/atom/ns#" term="Console" /><title type="text">Introduction to Javascript</title><content type="html">&lt;script type="text/javascript"&gt;$(window).load(function(){ $('#googlecodepng').cssBakeryCaption({'opacity':'0.4','center':true,'centerCaption':true,'round':true,'top':true,'hide':true,'color':'white','bgcolor':'#1ea1f4'}); }); &lt;/script&gt;&lt;img alt="Javascript: Example Code&amp;lt;br&amp;gt;[with jQuery calls]&amp;lt;br&amp;gt;© 2012 Copyright www.cssbakery.com All Rights Reserved" id="googlecodepng" src="http://pics.cssbakery.com/pics//javascsriptexample2.png" style="display: none;" /&gt;&lt;br /&gt;&lt;a href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742/ref=sr_1_1?ie=UTF8&amp;amp;qid=1334444170&amp;amp;sr=8-1"&gt;Javascript&lt;/a&gt; is a client-side programming language that runs within the web browser providing access to all parts of a page including the markup, content, and CSS properties.  If HTML is structure, CSS is style and presentation, Javascript is the functional arm of a page. Web browsers run Javascript based upon events.  (note:  for completeness, Javascript does run in other environments besides the web browser.  For example, &lt;a href="http://nodejs.org/"&gt;node.js&lt;/a&gt; uses Javascript on the server side).&lt;br /&gt;&lt;br /&gt;From Javascript, you can also send data to and receive data from the server and use the data you receive to dynamically update part of the page.  AJAX which is a technique for making pages more interactive - like when you click a button and it updates a small part of the page rather than doing a complete page reload - is built upon Javascript's capability to do this.  &lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;EVENTS AND EVENT ATTRIBUTES&lt;/h1&gt;&lt;div style="clear: both; padding-top: 10px;"&gt;A browser is a busy piece of software.  It interfaces with a user via a mouse and keyboard, or touch interface (e.g. iPad) as well as the Internet and web servers.   As it's interacting various events occur.  The browsers allows your Javascript code to register event handlers that are called when specific events occur.  So whenever an event occurs, the browser checks to see if there are event handler callbacks registered for that event.  If so, it calls each of the handler for that event, passing in some information on the event context.&lt;/div&gt;&lt;div style="margin-top: 10px;"&gt;&lt;ul class="starlist" style="float: left; margin-left: 70px; margin-right: 50px;"&gt;&lt;li&gt;click - onclick&lt;/li&gt;&lt;li&gt;change - onchange&lt;/li&gt;&lt;li&gt;submit - onsubmit&lt;/li&gt;&lt;li&gt;load - onload&lt;/li&gt;&lt;li&gt;mouseover - onmouseover&lt;/li&gt;&lt;li&gt;mouseout - onmouseout&lt;/li&gt;&lt;li&gt;focus - onfocus&lt;/li&gt;&lt;li&gt;blur - onblur&lt;/li&gt;&lt;li&gt;select - onselect&lt;/li&gt;&lt;/ul&gt;&lt;ul class="starlist" style="float: left;"&gt;&lt;li&gt;dblclick - ondblclick&lt;/li&gt;&lt;li&gt;keydown - onkeydown&lt;/li&gt;&lt;li&gt;keyup - onkeyup&lt;/li&gt;&lt;li&gt;keypress - onkeypress&lt;/li&gt;&lt;li&gt;unload - onunload&lt;/li&gt;&lt;li&gt;mousedown - onmousedown&lt;/li&gt;&lt;li&gt;mousemove - onmousemove&lt;/li&gt;&lt;li&gt;mouseup - onmouseup&lt;/li&gt;&lt;li&gt;reset - onreset&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;br /&gt;&lt;h1 style="padding-top: 20px;"&gt;JAVASCRIPT VARIABLES&lt;/h1&gt;&lt;br /&gt;Javascript has the following built-in datatypes:  &lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;&lt;span style="font-size: 100%;"&gt;numbers&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 100%;"&gt;strings&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: 100%;"&gt;booleans&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;You don't declare the type.  Javascript figures it out from what you assign to the variable.&lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;var n=42;&lt;/li&gt;&lt;li&gt;var s='a string';&lt;/li&gt;&lt;li&gt;var b=true;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;There is no distinction between floating point and integers, they are all just numbers:&lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;n=42.23;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;You can inspect the type of any variable using the built in 'typeof' operator:&lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;typeof n =&amp;gt; "number"&lt;/li&gt;&lt;li&gt;typeof s =&amp;gt; "string"&lt;/li&gt;&lt;li&gt;typeof b =&amp;gt; "boolean"&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;If you re-assign the variable with a different type of data, it's type changes:&lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;b="some string"&lt;/li&gt;&lt;li&gt;typeof b will now return a "string"&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;If you haven't defined something, then it's type is:  undefined.&lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;typeof x will return "undefined"&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h1&gt;JAVASCRIPT ARRAYS&lt;/h1&gt;&lt;br /&gt;You can define an array of data like this:&lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;var a = [42, 23, 89];&lt;/li&gt;&lt;/ul&gt;Arrays indexes start at zero:&lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;a[0] is 42&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The data in an array doesn't have to all be the same type:&lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;var b=[42, 'a string', false]&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;You can find out how many elements are in an array:&lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;b.length =&amp;gt; 3&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;You can also nest arrays:&lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;var c=[42,'a string',[3,9,2],false]&lt;/li&gt;&lt;li&gt;c.length =&amp;gt; 4&lt;/li&gt;&lt;li&gt;c[2] =&amp;gt; [3,9,2]&lt;/li&gt;&lt;li&gt;c[2][1] =&amp;gt; 9&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;There are a lot of built-in functions that can operate on arrays.  We can look at those in a future post.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;JAVASCRIPT OBJECTS&lt;/h1&gt;&lt;br /&gt;In addition to arrays, Javascript supports Objects, which you can think of as just a collection of data using name-value pairs.  Here's an example:&lt;br /&gt;&lt;pre&gt;var o = {&lt;br /&gt;    'airline':'United',&lt;br /&gt;    'flight':'1777',&lt;br /&gt;    'airport': 'LAX'&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;o.airline ==&amp;gt; United&lt;br /&gt;&lt;br /&gt;Objects can also nest:&lt;br /&gt;&lt;pre&gt;var o = {&lt;br /&gt;    'airline':'United',&lt;br /&gt;    'flight':{&lt;br /&gt;        'from':'LAX',&lt;br /&gt;        'to':'ORD',&lt;br /&gt;        'time:'9am'&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;o.flight.from =&amp;gt; 'LAX'&lt;br /&gt;&lt;br /&gt;So here 'flight' is an object that is nested inside another object, o.  When you say o.flight, you are accessing the 'flight' object inside of o.  The second dot operator then accesses the 'from' property of the flight object.&lt;br /&gt;&lt;br /&gt;The dot operator works a lot like the dot operator in C structs, or C++ classes. It accesses a member of the object data structure.  You can actually write the example above differently using square brackets.  For example:&lt;br /&gt;&lt;br /&gt;o['flight']['from'] =&amp;gt; LAX&lt;br /&gt;&lt;br /&gt;Using this uncommon syntax, it looks like an associative array. You can run this short example in the Firebug console to see the results yourself:&lt;br /&gt;&lt;br /&gt;console.log(o['flight']['from']);&lt;br /&gt;console.log(o.flight.from);&lt;br /&gt;&lt;br /&gt;The syntax above that we used to define the variable o is called an object literal in Javascript.  There are other ways to create an object but using the curly braces surrounding name-value pairs is the most common and is known as the object literal syntax.  Because you are literally saying this is what the object contains.  In other words, spelling it out...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;FIREBUG JAVASCRIPT CONSOLE&lt;/h1&gt;&lt;br /&gt;If you use Firefox, chances are you are familiar with its built-in Firebug tool that comes in very handy debugging CSS.  Same tool also provides a console for Javascript in which you can run your JS code.  Let's try our example by adding member functions to the o object and then run it in the Firebug Console. I pressed on the bottom "Run" button after I pasted my JS into the right pane(red).  The results showed up in the left pane(green).&lt;br /&gt;&lt;br /&gt;&lt;img alt="firebug console" src="http://pics.cssbakery.com/pics/javascriptconsole2.jpg" title="Firebug Console" /&gt;&lt;br /&gt;var o = {&lt;br /&gt;'airline':'United',&lt;br /&gt;'flight':{&lt;br /&gt;'from':'ORD',&lt;br /&gt;'to':'CAS',&lt;br /&gt;'time':'6am',&lt;br /&gt;//Return the object's "time" object (just a string in this case)&lt;br /&gt;getTime: function() { return this.time; }&lt;br /&gt;},&lt;br /&gt;// Return the object's "flight" object&lt;br /&gt;getFlight: function() { return this.flight; }&lt;br /&gt;}&lt;br /&gt;console.log(o['flight']['to']);&lt;br /&gt;console.log(o.flight.to);&lt;br /&gt;console.log(o.getFlight().getTime()); &lt;br /&gt;&lt;br /&gt;When you run this code, you will get:&lt;br /&gt;CAS&lt;br /&gt;CAS&lt;br /&gt;6am&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;CHAINING&lt;/h1&gt;&lt;br /&gt;In the above function calls the parser goes left to right, first it sees o.getFlight(), and it calls this function.  It then takes the return value from getFlight() and calls getTime() on it.  It's as if you did this instead:&lt;br /&gt;&lt;br /&gt;var f=o.getFlight();&lt;br /&gt;f.getTime();&lt;br /&gt;&lt;br /&gt;The chaining syntax lets you shorten this to just:&lt;br /&gt;&lt;br /&gt;o.getFlight().getTime();&lt;br /&gt;&lt;br /&gt;Thus eliminating the need for you to use an extra variable to temporarily hold the return value from getFlight().&lt;br /&gt;&lt;br /&gt;Objects have some other important features which we will look at in a future post.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;CHAIN, CHAIN, CHAIN.... CHAIN OF FOOLS&lt;/h1&gt;&lt;br /&gt;If you get lost chaining your JS or are unlucky in love, you know which song to sing.&lt;br /&gt;&lt;br /&gt;First I'm going to write a simple Javascript object:&lt;br /&gt;&lt;br /&gt;var myJSobject = {&lt;br /&gt;// two name-value pairs that are integers&lt;br /&gt;// comma endings instead of semicolons because we are separating the items in &lt;br /&gt;// in a list of properties of an object literal&lt;br /&gt;a: 23,&lt;br /&gt;b: 45,&lt;br /&gt;&lt;br /&gt;// two name-value pairs where the returning value is a function&lt;br /&gt;showa: function() {&lt;br /&gt;console.log(this.a);&lt;br /&gt;return this;&lt;br /&gt;},&lt;br /&gt;&lt;br /&gt;showb: function() {&lt;br /&gt;console.log(this.b);&lt;br /&gt;// returning an object so it can be used for the next&lt;br /&gt;// call in the chain&lt;br /&gt;return this;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Chaining Examples:&lt;br /&gt;&lt;br /&gt;myJSobject.showa()  .... will output the first 24 below&lt;br /&gt;console.log(myJSobject.showa().a)  .... will output 24 and 23&lt;br /&gt;console.log("--------------")&lt;br /&gt;console.log(myJSobject.showa().b)  .... will output 24, 45&lt;br /&gt;console.log(myJSobject.showa().showb()) ... 24, 45, and the whole object &lt;br /&gt;console.log("--------------")&lt;br /&gt;&lt;br /&gt;// a long chain:&lt;br /&gt;myJSobject.showa().showb().showa().b  will output 24, 45, 24.  &lt;br /&gt;&lt;br /&gt;Actual Console Output:&lt;br /&gt;&lt;br /&gt;24&lt;br /&gt;24&lt;br /&gt;23&lt;br /&gt;--------------&lt;br /&gt;24&lt;br /&gt;45&lt;br /&gt;24&lt;br /&gt;45&lt;br /&gt;Object { a=23, b=45, showa=function(), more...}&lt;br /&gt;&lt;div style="font-style: italic; padding-left: 55px;"&gt;will return a reference to the whole object which is the reason the chaining works because when you return a reference to the whole object you can now call another function on that object or the way I would say is another member function like we say in C++.  Another word for it is a method.&lt;/div&gt;--------------&lt;br /&gt;24&lt;br /&gt;45&lt;br /&gt;24&lt;br /&gt;45&lt;br /&gt;&lt;br /&gt;The last 45 is an oddball which I believe the console is outputting since that's the last value seen in the code that was run in the console.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;THE MEANING OF JAVASCRIPT &lt;i&gt;this&lt;/i&gt;&lt;/h1&gt;&lt;br /&gt;Whenever a function is called, it is passed a hidden first parameter called 'this'.  So when you see a function like this one:&lt;br /&gt;function add3(x,y,z) {&lt;br /&gt;return x+y+z;&lt;br /&gt;}&lt;br /&gt;You can think of it as being defined like this:&lt;br /&gt;function myfunc(this,x,y,z) {   // you would never write it this way.&lt;br /&gt;return x+y+z;&lt;br /&gt;}&lt;br /&gt;Inside the function you can use the 'this' parameter just like any other parameter.  &lt;br /&gt;When you call a "stand alone" function, the this parameter will be a reference to the global object (window).  So for the above function call, the 'this' parameter will be equal to window.&lt;br /&gt;&lt;br /&gt;If the function is instead part of an object, then the 'this' parameter will  be a reference to the current object instance.  This is very much like the 'this' parameter passed to member functions of objects in C++, or PHP.  In all of these languages, 'this' refers to the current instance of the object that the function is being run on.  &lt;br /&gt;&lt;br /&gt;&lt;h1&gt;&lt;i&gt;this&lt;/i&gt; IN PHP&lt;/h1&gt;&lt;br /&gt;In a PHP object, 'this' is written as '$this', and the object must be referenced via a pointer operator, like this:&lt;br /&gt;&lt;pre&gt;class SomePHPclass {&lt;br /&gt;  $message = "Hello world";&lt;br /&gt;  function sayMessage() {&lt;br /&gt;    echo $this-&amp;gt;message;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;$phpObj = new SomePHPclass;&lt;br /&gt;$phpObj-&amp;gt;sayMessage();&lt;br /&gt;&lt;/pre&gt;Here's the equivalent example in Javascript:&lt;br /&gt;&lt;pre&gt;var SomeJSobject  = {&lt;br /&gt;  message: "Hello world",&lt;br /&gt;  sayMessage: function() {  &lt;br /&gt;    console.log(this.message);&lt;br /&gt;  } &lt;br /&gt;}&lt;br /&gt;SomeJSobject.sayMessage();&lt;br /&gt;// Notice we don't need a new operator to create the object, since that was done &lt;br /&gt;// via the object literal notation.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h1&gt;&lt;i&gt;this&lt;/i&gt; IN C++&lt;/h1&gt;&lt;br /&gt;In C++ it would look something like this:&lt;br /&gt;&lt;pre&gt;class SomeCPPclass {&lt;br /&gt;public:&lt;br /&gt;    string message;&lt;br /&gt;    SomeCPPclass() { this-&amp;gt;message = "Hello world"; }&lt;br /&gt;    void sayMessage() {&lt;br /&gt;      cout &amp;lt;&amp;lt; this-&amp;gt;message &amp;lt;&amp;lt; "\n";&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;SomeCPPclass o;&lt;br /&gt;o.sayMessage();&lt;br /&gt;// or:&lt;br /&gt;SomeCPPclass *optr;&lt;br /&gt;optr = new SomeCPPclass;&lt;br /&gt;optr-&amp;gt;sayMessage();&lt;br /&gt;&lt;/pre&gt;In this C++ example, the compiler sets the 'this' pointer so that it points at the object instance in memory.  That way, when a member function references this-&amp;gt;message, it is going to memory where the object instance resides, and offsetting to the 'message' field.&lt;br /&gt;&lt;br /&gt;In Javascript, there are no pointers, but there are references.  When you call a function and pass an object, it's passed as a reference.  Like a pointer, a reference knows the location in memory where the object resides and allows you to update that object directly.  The difference is that the actual underlying pointer that a reference uses is hidden from you so you can't do things like pointer arithmetic.  Syntactically you use the dot operator (.) with the Javascript reference, instead of the right arrow operator (-&amp;gt;) in C++.  Those differences aside, it's basically the same idea.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;THE MEANING OF THE TRIPLE EQUAL SIGN &lt;/h1&gt;&lt;br /&gt;Javascript has both  double equal and  triple equal comparison operators.   The difference is that double equals will try to perform type conversion to the same type and then compare values.  Triple equal does not do type conversion, and if the types are different it will say they are not equal.  Here are some examples: &lt;br /&gt;3=="3"  // true: because "3" is converted to a number before comparison.&lt;br /&gt;3==="3" // false: because one is a number and the other is a string.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;JAVASCRIPT GLOBAL OBJECT&lt;/h1&gt;&lt;br /&gt;Javascript has what's called the "global object".  In Browsers, this global object is called "window".  Whenever you create a global variable, it gets added to the global object.  Here's an example:&lt;br /&gt;&lt;br /&gt;//When a variable is declared outside of a function, it's always global&lt;br /&gt;var x=45;&lt;br /&gt;&amp;gt;x&lt;br /&gt;45&lt;br /&gt;&lt;br /&gt;&amp;gt;window.x&lt;br /&gt;45&lt;br /&gt;&lt;br /&gt;So the global variable 'x' can be referenced by just it's name, or via the global object.  You can use either to change it:&lt;br /&gt;&amp;gt;x=x+1&lt;br /&gt;&amp;gt;x&lt;br /&gt;46&lt;br /&gt;&lt;br /&gt;&amp;gt;window.x=window.x+1&lt;br /&gt;&amp;gt;x&lt;br /&gt;47&lt;br /&gt;&lt;br /&gt;Having this global object is considered a weakness of Javascript because your page could be mixing in Javascript code from various sources and they could collide in their use of global variables.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;GLOBAL VS LOCAL SCOPE&lt;/h1&gt;&lt;br /&gt;You should always declare variables before using them with the 'var' keyword:&lt;br /&gt;var x;&lt;br /&gt;x=10;&lt;br /&gt;&lt;br /&gt;Javascript does allow you to implicitly declare a variable by just using it (skipping 'var'):&lt;br /&gt;y=11;&lt;br /&gt;&lt;br /&gt;But it's not a good habit.&lt;br /&gt;&lt;br /&gt;The problem occurs when you declare variables inside a function.  If you do it the right way and use 'var', then the variable is made local to the function, not global.  But if you skip the 'var', then any variable declared inside the function becomes global.  This is bad. Example:&lt;br /&gt;&lt;br /&gt;function f() {&lt;br /&gt;var a=5;&lt;br /&gt;b=6;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// call the function:&lt;br /&gt;f()&lt;br /&gt;&lt;br /&gt;console.log(a)&lt;br /&gt;undefined&lt;br /&gt;console.log(b)&lt;br /&gt;6&lt;br /&gt;console.log(window.b)&lt;br /&gt;6&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;JAVASCRIPT FUNCTIONS&lt;/h1&gt;&lt;br /&gt;In Javascript, functions can be defined like this:&lt;br /&gt;&lt;pre&gt;function addThreeNumbers(a,b,c) {&lt;br /&gt;  return a+b+c;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;But they can also be defined like this:&lt;br /&gt;&lt;pre&gt;var addThreeNumbers = function(a,b,c) {&lt;br /&gt;  return a+b+c;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;In this second case, the function has been assigned to a variable.&lt;br /&gt;You can then pass that variable as an argument to another function:&lt;br /&gt;&lt;pre&gt;function callWith123(f) {&lt;br /&gt;  return f(1,2,3);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var total = callWith123(addThreeNumbers);&lt;br /&gt;&lt;/pre&gt;The result will be that total is set to 6.&lt;br /&gt;Here's another way to do this:&lt;br /&gt;&lt;pre&gt;var total2 = callWith123( function(a,b,c) { return a+b+c; } );&lt;br /&gt;&lt;/pre&gt;Here we didn't even bother to assign the function to a variable, we just passed it as a parameter. You will see this pattern a lot when using jQuery.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;CALL BY VALUE, CALL BY REFERENCE&lt;/h1&gt;&lt;br /&gt;In Javascript, if you pass a built-in fundamental type (string, number, boolean) as an argument to a function, it is a call by value.  That means the function gets it's own local variable representing the parameter and the value is copied in from the invocation.  Here's an example:&lt;br /&gt;&lt;pre&gt;function dosomething(a) {&lt;br /&gt;  a=10; &lt;br /&gt;  alert(a);  // a is 10 (but a is local)&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;a=4;&lt;br /&gt;dosomething(a);&lt;br /&gt;alert(a);  // a is still 4&lt;br /&gt;&lt;br /&gt;If what you are passing in is an Object or Array, it's a different story.  Now the call is by reference. (note for completeness: an Array in Javascript is really a type of object).  Here's an example:&lt;br /&gt;&lt;pre&gt;function dosomething(a) {&lt;br /&gt;  a[0] = 10;&lt;br /&gt;  alert(a[0]);  // a[0] is 10&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var a=[4,3,2];&lt;br /&gt;dosomething(a);&lt;br /&gt;alert(a[0]); // a[0] is 10 (it was changed by the function call)&lt;br /&gt;&lt;br /&gt;// Lets try with an object literal:&lt;br /&gt;&lt;br /&gt;function dosomething(o) {&lt;br /&gt;  o.a = 10;&lt;br /&gt;  alert(o.a);  // o.a is 10&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var o = { a: 4, b: 3, c: 2 };&lt;br /&gt;dosomething(o);&lt;br /&gt;alert(o.a);  // o.a is 10 (it was changed by the function call)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-8705099842058581537?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/CdNehiJqaAQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/8705099842058581537/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/05/introduction-to-javascript.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/8705099842058581537" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/8705099842058581537" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/CdNehiJqaAQ/introduction-to-javascript.html" title="Introduction to Javascript" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/05/introduction-to-javascript.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-8219536020251856271</id><published>2012-04-21T10:15:00.000-07:00</published><updated>2012-04-21T10:15:08.042-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Fonts and Text" /><category scheme="http://www.blogger.com/atom/ns#" term="Typekit" /><category scheme="http://www.blogger.com/atom/ns#" term="Adobe" /><title type="text">Fonts for the Web: Typekit by Adobe</title><content type="html">&lt;pre&gt;&lt;script type="text/javascript"&gt;&lt;br /&gt;$(window).load(function(){ $('#typekitjpg').cssBakeryCaption({'opacity':'0.4','center':true,'centerCaption':true,'round':true,'hide':true,'color':'white','bgcolor':'black'});&lt;br /&gt;});&lt;br /&gt;&lt;/script&gt;&lt;img alt="Typekit Fonts&amp;lt;br&amp;gt;[Adobe]&amp;lt;br&amp;gt;© 2012 Copyright www.cssbakery.com All Rights Reserved" id="typekitjpg" src="http://pics.cssbakery.com/pics/typekit.jpg" style="display: none;" /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href="https://typekit.com/" target="_blank"&gt;Typekit Adobe&lt;/a&gt; provides online fonts for websites.&amp;nbsp; You can sign up for different plans&lt;a href="https://typekit.com/plans" target="_blank"&gt; here&lt;/a&gt;.&amp;nbsp; Here are the steps for using the service:&lt;br /&gt;&lt;br /&gt;1. Go to www.typekit.com and Sign In (upper right).&lt;br /&gt;2. In the pulldown at the upper right, select the site to work with.&lt;br /&gt;3. Click "Launch Kit Editor"&lt;br /&gt;4. Find a font and click "Add to Kit"&lt;br /&gt;5. Now in the typekitEditor, add a selector for the new font and click Add.&lt;br /&gt;6. There may be multiple weights and styles available, if so choose the ones you want.  Note that the more you add, the more your kit download will grow in size.&lt;br /&gt;7. In your markup, use the selectors that you added for the font.&lt;br /&gt;&lt;br /&gt;Also:  If you haven't already embedded the kit code in the  section of your page that will be using the fonts, then in the typekitEditor, click "Embed Code" (at upper right).  Cut and paste the two script sections into your document head.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-8219536020251856271?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/l1CE2PXj2mk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/8219536020251856271/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/04/fonts-for-web-typekit-by-adobe.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/8219536020251856271" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/8219536020251856271" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/l1CE2PXj2mk/fonts-for-web-typekit-by-adobe.html" title="Fonts for the Web: Typekit by Adobe" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/04/fonts-for-web-typekit-by-adobe.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-8626216592485496306</id><published>2012-04-18T18:57:00.005-07:00</published><updated>2012-05-21T17:56:54.094-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Server" /><category scheme="http://www.blogger.com/atom/ns#" term="Notepad++" /><category scheme="http://www.blogger.com/atom/ns#" term="FileZilla" /><category scheme="http://www.blogger.com/atom/ns#" term="FTP/SFTP Clients" /><category scheme="http://www.blogger.com/atom/ns#" term="SFTP" /><title type="text">Using Notepad++ to Edit Files on the Server over SFTP</title><content type="html">&lt;script type="text/javascript"&gt;$(window).load(function(){ $('#worktrafficjpg').cssBakeryCaption({'opacity':'0.5','center':true,'centerCaption':true,'round':true,'hide':true,'color':'white','bgcolor':'black'}); }); &lt;/script&gt;&lt;img alt="[city from moving car]&amp;lt;br&amp;gt;Winter 2010&amp;lt;br&amp;gt;© 2012 Copyright www.cssbakery.com All Rights Reserved" id="worktrafficjpg" src="http://pics.cssbakery.com/pics/automaticSFTP2.jpg" style="display: none;" /&gt;&lt;br /&gt;For quick tasks and transfers, &lt;a href="http://filezilla-project.org/"&gt;FileZilla&lt;/a&gt;, an SFTP client, is great but manually uploading local files to the server via standalone FTP/SFTP clients can waste time if there's a lot of back and forth.  By configuring the built-in SFTP client within Notepad++, you can edit files directly from the server, validate from the browser - Tools option in Firefox Web Developer Add-on gives you direct access to W3C HTML and CSS Validators - and be finished in a flash.  &lt;br /&gt;&lt;br /&gt;Notepad++, written in C++, is a &lt;a href="http://en.wikipedia.org/wiki/Notepad%2B%2B"&gt;source code editor&lt;/a&gt;, not a word processor. &lt;br /&gt;&lt;br /&gt;&lt;h1&gt;SETTING IT UP&lt;/h1&gt;&lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;In Notepad++ go to the Plugins menu and select NppFTP-&amp;gt;Show NppFTP Window.&lt;/li&gt;&lt;li&gt;Click on the "gear" icon (6th icon from the left).&lt;/li&gt;&lt;li&gt;Choose "Profile Settings"&lt;/li&gt;&lt;li&gt;Click the "Add new" button.&lt;/li&gt;&lt;li&gt;Enter the name of the new profile and click OK.&lt;/li&gt;&lt;li&gt;Enter the hostname which is the full URL.  &lt;/li&gt;&lt;li&gt;For connection type choose SFTP.&lt;/li&gt;&lt;li&gt;Leave port number at 22.&lt;/li&gt;&lt;li&gt;Enter username and password.&lt;/li&gt;&lt;li&gt;For Initial remote directory, enter:  public_html&lt;/li&gt;&lt;li&gt;Click "Close"&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h1&gt;CONNECTING&lt;/h1&gt;&lt;br /&gt;Click the connection list icon is NppFTP. and choose the server you want to connect to.  The first time you connect to a given server you will be asked if you trust the host key.  Say yes.  You shouldn't be asked again after the first time.  Now you should see the directory structure on the server.  Choose a file to edit and double click it. Make your edits, and Save the file.  Notepad++ will send the changed file up to the server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-8626216592485496306?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/wFP3doHDGlI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/8626216592485496306/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/04/using-notepad-to-edit-files-on-server.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/8626216592485496306" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/8626216592485496306" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/wFP3doHDGlI/using-notepad-to-edit-files-on-server.html" title="Using Notepad++ to Edit Files on the Server over SFTP" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/04/using-notepad-to-edit-files-on-server.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-272059688419892767</id><published>2012-04-17T13:04:00.014-07:00</published><updated>2012-04-18T18:28:26.010-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Word" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows 7" /><title type="text">Changing File Associations in Windows 7</title><content type="html">&lt;script type='text/javascript'&gt;$(window).load(function(){ $('#ballmerjpg').cssBakeryCaption({'opacity':'0.3','center':true,'centerCaption':true,'round':true,'hide':true,'color':'white','bgcolor':'black'}); }); &lt;/script&gt;&lt;img id='ballmerjpg' style='display:none;' src='http://pics.cssbakery.com/pics/microsoftword.jpg' alt='[unrequited love]&amp;lt;br&amp;gt;Image Source: Warner Brothers'&gt;&lt;br /&gt;Microsoft Word's been driving me crazy, popping up every time I click on a text file.  Thinking I’ll be on WordPad, I am taken to the trial version of Microsoft Word instead, which asks me for a key, and registration that I do not have.  You are forced to click through a series of buttons before Microsoft lets you go.&lt;br /&gt;&lt;br /&gt;Here are the instructions for changing file associations in Windows 7.&lt;br /&gt;&lt;br /&gt;From the Start menu:&lt;br /&gt;&lt;ul class="starlist indent"&gt;&lt;li&gt;Choose “Default Programs”&lt;/li&gt;&lt;li&gt;Choose “Associate a file type or protocol with a program”&lt;/li&gt;&lt;li&gt;Wait while it loads...&lt;/li&gt;&lt;li&gt;Double Click on the extension (e.g. .doc, .rtf).&lt;/li&gt;&lt;li&gt;Double Click on program to use:  e.g. Wordpad.&lt;/li&gt;&lt;li&gt;If you don’t see the program you want, click the little pulldown icon on the “Other Programs” line, then choose.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-272059688419892767?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/Z8_NlDxssUc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/272059688419892767/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/04/changing-file-associations-in-windows-7.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/272059688419892767" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/272059688419892767" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/Z8_NlDxssUc/changing-file-associations-in-windows-7.html" title="Changing File Associations in Windows 7" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/04/changing-file-associations-in-windows-7.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-3836132176325692354</id><published>2012-03-29T14:20:00.018-07:00</published><updated>2012-03-30T09:01:22.815-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="CDN" /><category scheme="http://www.blogger.com/atom/ns#" term="jQuery UI" /><category scheme="http://www.blogger.com/atom/ns#" term="Content Delivery Network" /><category scheme="http://www.blogger.com/atom/ns#" term="Caching" /><category scheme="http://www.blogger.com/atom/ns#" term="jQuery" /><category scheme="http://www.blogger.com/atom/ns#" term="Parallelism" /><category scheme="http://www.blogger.com/atom/ns#" term="Latency" /><title type="text">jQuery and jQuery UI</title><content type="html">&lt;script type='text/javascript'&gt;$(window).load(function(){ $('#sepiapalettejpg').cssBakeryCaption({'opacity':'0.3','center':true,'centerCaption':true,'round':true,'hide':true,'color':'white','bgcolor':'black'}); }); &lt;/script&gt;&lt;br /&gt;&lt;img id='sepiapalettejpg' style='display:none;' src='http://pics.cssbakery.com/pics/sepiapalette.jpg' alt='Oil Painting with Palette Knife in Sepia&amp;lt;br&amp;gt;&amp;lt;em&amp;gt;Grace Kelly by Peter Engels&amp;lt;/em&amp;gt;&amp;lt;br&amp;gt;&amp;copy; 2012 Copyright www.cssbakery.com All Rights Reserved'&gt;&lt;br /&gt;jQuery is a Javascript library that allows you to easily manipulate - compared to writing your own raw Javascript - your HTML document, handle events such as mouse clicks and perform AJAX calls to a server.  It hides many cross-browser inconsistencies from you.  It's also easy to extend by writing plug-ins. &lt;br /&gt;&lt;br /&gt;jQuery UI provides reusable user interface components including things like datepicker, tabbed interface, accordion and dialog boxes.  It also makes it easy to create drag and drop functionality.  You can customize the appearance of the components - called widgets - using a number of predefined themes or you can roll your own.&lt;br /&gt;&lt;br /&gt;When you download these libraries, you have the option of using a minified, smaller version or the more readable version that includes all the whitespace formatting and commentary.  &lt;br /&gt;&lt;br /&gt;&lt;ul class="starlist"&gt;&lt;li&gt;&lt;a href="http://jquery.com/"&gt;jQuery Library&lt;/a&gt;, currently at 1.7.2&lt;/li&gt;&lt;li&gt;&lt;a href="http://jqueryui.com/download"&gt;jQuery UI&lt;/a&gt;, currently at 1.8.18 &lt;/li&gt;&lt;li&gt;3 Reasons for letting Google &lt;a href="http://encosia.com/3-reasons-why-you-should-let-google-host-jquery-for-you/"&gt;host&lt;/a&gt; your jQuery&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-3836132176325692354?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/a7r6QbMD-QE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/3836132176325692354/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/03/jquery-and-jquery-ui.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/3836132176325692354" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/3836132176325692354" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/a7r6QbMD-QE/jquery-and-jquery-ui.html" title="jQuery and jQuery UI" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/03/jquery-and-jquery-ui.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-7668877477442003004</id><published>2012-03-17T21:02:00.062-07:00</published><updated>2012-03-29T15:33:14.573-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Background Property" /><category scheme="http://www.blogger.com/atom/ns#" term="background-image" /><category scheme="http://www.blogger.com/atom/ns#" term="DIV" /><category scheme="http://www.blogger.com/atom/ns#" term="CSS 3" /><category scheme="http://www.blogger.com/atom/ns#" term="Padding and Margins" /><category scheme="http://www.blogger.com/atom/ns#" term="Multiple Backgrounds" /><category scheme="http://www.blogger.com/atom/ns#" term="Background Positioning" /><category scheme="http://www.blogger.com/atom/ns#" term="p" /><category scheme="http://www.blogger.com/atom/ns#" term="Funny" /><title type="text">A Simple Plan</title><content type="html">&lt;div style="background: url(http://pics.cssbakery.com/pics/smiley2.png) 97% 12% no-repeat;  background-color: #cdccc7; padding-right: 51px; border-radius:15px;"&gt;&lt;p class="justforfun" style="background-color: #eeeeee; padding: 25px; padding-left:30px; padding-right:30px; font-family: tahoma, sans-serif;"&gt;"An attempt to rob a  jewelry store failed dramatically  when the shop owner shot one of the intruders.  The men fled the store and jumped into a Ford minivan, where a waiting driver took them around the corner and they all switched to a Chevy Tahoe.  The nervous robbers crashed their SUV into a parked car less than half a mile from the store, sending the four occupants running in different directions.  All were quickly apprehended by police.  The four uninjured suspects  ages ranging from 18 to 22 who did not realize that the police station was only four blocks away from the jewelry store, were booked into the local jail." &lt;i&gt;-Yahoo News&lt;/i&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;The styles for the quote:&lt;br /&gt;&lt;br /&gt;.justforfun_div {&lt;br /&gt;padding-right:51px; &lt;br /&gt;background: url(images/smiley2.png) 97% 12% no-repeat;&lt;br /&gt;background-color: #cdccc7;&lt;br /&gt;border-radius:15px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.justforfun_p {&lt;br /&gt;background-color: #eeeeee;&lt;br /&gt;padding:25px 30px;&lt;br /&gt;font-family: tahoma, sans-serif;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The Markup is a paragraph enveloped in a div.  We need the div to display the bitmap on the right padding.  I did not start out with a bitmap.  For me, a plain blue bar was more than enough but then I wanted to show how you would go about placing an image on the blue bar.   &lt;br /&gt;&lt;br /&gt;Initially I had drawn the bar via a simple border statement.  Your first thought may be to place the image on that border but borders in CSS do not  allow us to write over them.  That's when the extra div for the smiling face came in. &lt;br /&gt;&lt;br /&gt;Without any images, this would be even simpler with only a p tag, a right border and a right padding.&lt;br /&gt;&lt;br /&gt;&lt;pre class="Blue"&gt;&amp;lt;div class="justforfun_div"&amp;gt;&lt;br /&gt;&amp;lt;p class="justforfun_p"&amp;gt;&lt;br /&gt;"An attempt to rob a  jewelry store .... only four blocks away from the jewelry store, were booked into the local jail." &amp;lt;i&amp;gt;-Yahoo News&amp;lt;/i&amp;gt;&lt;br /&gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;  &lt;/pre&gt;&lt;br /&gt;&lt;h1&gt;MULTIPLE BACKGROUNDS OF CSS 3&lt;/h1&gt;&lt;br /&gt;How about outputting &lt;a href="http://pics.cssbakery.com/pics/twobitmapscss3.jpg"&gt;two bitmaps&lt;/a&gt; one on each side?  The styling for the div changes and keep in mind this will only work in a browser that permits the multiple backgrounds of CSS 3.0 in which you list the backgrounds back to back, separating them with a comma.  The left padding will give us the blue strip that will contain the new image.  I'll just be using the same bitmap but you can use something new. &lt;br /&gt;&lt;br /&gt;&lt;pre class='Blue'&gt;.justforfun_div {&lt;br /&gt;   background: url(images/smiley2.png) 97% 12% no-repeat,url(images/smiley2.png) 3% 90% no-repeat; &lt;br /&gt;   background-color: #aecae6;&lt;br /&gt;   padding-right: 51px; &lt;br /&gt;   padding-left: 51px;  &lt;br /&gt;   border-radius:15px;&lt;br /&gt;   } &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-7668877477442003004?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/KjzVuQGLBns" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/7668877477442003004/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/03/simple-plan.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/7668877477442003004" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/7668877477442003004" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/KjzVuQGLBns/simple-plan.html" title="A Simple Plan" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/03/simple-plan.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-8293008602668521233</id><published>2012-03-04T11:01:00.006-08:00</published><updated>2012-03-29T21:13:42.881-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Internet Explorer" /><category scheme="http://www.blogger.com/atom/ns#" term="Software Testing" /><category scheme="http://www.blogger.com/atom/ns#" term="IE Compatibility Mode" /><category scheme="http://www.blogger.com/atom/ns#" term="Cross Browser Platforms" /><title type="text">Testing in IE7/IE8 using IE Compatibility Mode</title><content type="html">&lt;img src="http://pics.cssbakery.com/pics/cambridge1.jpg" alt="IE Compatibility Mode" /&gt;&lt;br /&gt;Microsoft has never supported installing multiple versions of IE on a single PC.  (They do provide some virtual machine images for running older version of IE, but that's not the same as having multiple IE versions on the same Windows OS instance.)  To run virtual machines,  you have to own Windows 7 Pro or Ultimate, it will not work with Windows 7 Home Premium. &lt;br /&gt;&lt;br /&gt;But there is still something that everyone can do: You can tell IE to go into "compatibility mode" where it behaves like an older version of IE.  For example, if you are running IE8 or IE9, hit the F12 key to bring up Developer Tools.  Now go to the "Browser Mode" pull down menu, and select IE 7.  Your page will be re-rendered in IE7 mode.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-8293008602668521233?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/Dwgg9XG4obc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/8293008602668521233/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/03/testing-for-ie7ie8-using-ie.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/8293008602668521233" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/8293008602668521233" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/Dwgg9XG4obc/testing-for-ie7ie8-using-ie.html" title="Testing in IE7/IE8 using IE Compatibility Mode" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/03/testing-for-ie7ie8-using-ie.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-263230890613133942</id><published>2012-03-01T15:35:00.006-08:00</published><updated>2012-03-01T16:08:43.822-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computing News" /><category scheme="http://www.blogger.com/atom/ns#" term="Raspberry Pi" /><title type="text">A Computer Holga? $35 Raspberry Pi</title><content type="html">&lt;img style="margin-top: 7px; margin-bottom:3px;" src="http://pics.cssbakery.com/pics/raspberrypi.jpg" alt="Raspberry Pi" /&gt;&lt;br /&gt;Tiny but powerful $35 Raspberry Pi computer causes &lt;a href="http://www.cnn.com/2012/02/29/tech/raspberry-pi-launch/index.html"&gt;big stir&lt;/a&gt; on launch day. Image Credit: Schematic by &lt;a href="http://raspberrypi.org"&gt;Raspberry Pi&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-263230890613133942?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/WSnN3Kpx3gs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/263230890613133942/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/03/holga-for-hacker-35-raspberry-pi.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/263230890613133942" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/263230890613133942" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/WSnN3Kpx3gs/holga-for-hacker-35-raspberry-pi.html" title="A Computer Holga? $35 Raspberry Pi" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/03/holga-for-hacker-35-raspberry-pi.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-2115344725696549271</id><published>2012-02-27T10:37:00.005-08:00</published><updated>2012-02-27T10:56:11.193-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Search Engine" /><category scheme="http://www.blogger.com/atom/ns#" term="Google Search" /><category scheme="http://www.blogger.com/atom/ns#" term="Google" /><category scheme="http://www.blogger.com/atom/ns#" term="Google Privacy" /><title type="text">Behind the Scenes When You Click a Search Result</title><content type="html">Although not visible to the user,   Google takes you on a quick detour every time you click on one of your search results.    So Google knows not only what you searched on, but where you went with that search.   That would be Ok if they did not store these searches that are associated with you indefinitely in a database on their servers which was the topic of my &lt;a href="http://www.cssbakery.com/2012/02/google-knows-too-much-about-you.html"&gt;previous post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Take for example the following link that is supposed to take me to a newspaper article.    The Google search results page certainly looks as if I will directly go to the newspaper's site but that's not what really happens behind the scenes.     While the yellow portion of the link is where I chose to go - my actual and eventual destination -  the unhighligted portion has been inserted into the link string  by Google without my knowledge.  &lt;br /&gt;&lt;br /&gt;&lt;img alt="Google Changing Search List Link Behind the Scenes" src="http://pics.cssbakery.com/pics/googleaddress.jpg" /&gt;&lt;a name='more'&gt;&lt;/a&gt; &lt;br /&gt;So before I view the newspaper article, I will go through Google where they will collect more information on me although this portion of my journey will be invisible to me.&lt;br /&gt;&lt;br /&gt;If you want to see how this works, go to google.com and search on something.  You'll get the usual search results page that all of us are familiar with.  Right click on one of the links and choose  "Copy Link Location".  You'll find out that the link is reconstructed such as the one I have above and looks different than what Google's showing you on their search results page. &lt;br /&gt;&lt;br /&gt;&lt;div class="related_thumbnail"&gt;&lt;img alt="" src="http://pics.cssbakery.com/pics/googleicon.png" title="Privacy on the Internet" /&gt;&lt;h4&gt;Privacy on the Internet&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2012/02/google-knows-too-much-about-you.html"&gt;Google Knows Too Much About You&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2012/02/behind-scenes-when-you-click-search.html#more"&gt;Behind the Scenes&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-2115344725696549271?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/8sZeDjPFNt8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/2115344725696549271/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/02/behind-scenes-when-you-click-search.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/2115344725696549271" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/2115344725696549271" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/8sZeDjPFNt8/behind-scenes-when-you-click-search.html" title="Behind the Scenes When You Click a Search Result" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/02/behind-scenes-when-you-click-search.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-2476096751657975597</id><published>2012-02-11T21:07:00.001-08:00</published><updated>2012-02-27T10:40:49.906-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="The Right To Be Forgotten Initiative" /><category scheme="http://www.blogger.com/atom/ns#" term="Computing News" /><category scheme="http://www.blogger.com/atom/ns#" term="Search Engine" /><category scheme="http://www.blogger.com/atom/ns#" term="Google Search" /><category scheme="http://www.blogger.com/atom/ns#" term="Google" /><category scheme="http://www.blogger.com/atom/ns#" term="Google Privacy" /><title type="text">Google Knows Too Much About You</title><content type="html">&lt;script type='text/javascript'&gt;$(window).load(function(){ $('#justbetweenusjpg').cssBakeryCaption({'opacity':'0.4','center':true,'centerCaption':true,'round':true,'hide':true,'color':'white','bgcolor':'#D305E6'}); }); &lt;/script&gt;&lt;br /&gt;&lt;img id='justbetweenusjpg' style='display:none;' src='http://pics.cssbakery.com/pics/jbs.jpg' alt='A Boston Whaler&amp;lt;br&amp;gt;[yacht tender]&amp;lt;br&amp;gt;&amp;copy; 2012 Copyright www.cssbakery.com All Rights Reserved'&gt; &lt;br /&gt;&lt;br /&gt;In her article titled, &lt;a href="http://www.cnn.com/2012/02/09/opinion/ghitis-google-privacy/index.html?hpt=hp_abar"&gt;Google Knows Too Much About You&lt;/a&gt;, Ghitis says, "&lt;i&gt;Google has every search you ever made and every e-mail you ever sent or received on Gmail. If you ever used Google while logged in to your account to search for a person, a symptom, a medical side effect, a political idea; all of this is on Google's servers.  You've done it, said it, clicked it, searched it, Googled it. You can never undo it or unclick it. It stays there forever&lt;/i&gt;."&lt;br /&gt;&lt;br /&gt;The tracking is not a revelation to anyone but storing the compiled information indefinitely sounds disturbing.  The &lt;a href="http://www.pcworld.com/businesscenter/article/248709/proposed_eu_data_protection_rules_include_right_to_be_forgotten.html"&gt;right to be forgotten&lt;/a&gt; initiative may be the way to protect users by providing them with the option to purge search engine data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-2476096751657975597?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/rgOs7nVI1nQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/2476096751657975597/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/02/google-knows-too-much-about-you.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/2476096751657975597" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/2476096751657975597" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/rgOs7nVI1nQ/google-knows-too-much-about-you.html" title="Google Knows Too Much About You" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/02/google-knows-too-much-about-you.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-8121132893745505069</id><published>2012-01-28T09:24:00.005-08:00</published><updated>2012-03-02T10:51:01.922-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Relative Positioning" /><category scheme="http://www.blogger.com/atom/ns#" term="Blockquotes" /><category scheme="http://www.blogger.com/atom/ns#" term="Funny" /><title type="text">Writing a Generic CSS Blockquote Class</title><content type="html">&lt;blockquote class="gen"&gt;&lt;img alt="" src="http://pics.cssbakery.com/pics/tallship2.png" /&gt;&lt;br /&gt;&lt;p class="first"&gt;People do odd things in an emergency and we all have stories of ludicrous situations in an emergency which we laugh afterwards, if we are still alive. &lt;/p&gt;&lt;p class="last"&gt;My favorite one is of the &lt;a href="http://en.wikipedia.org/wiki/Third_mate"&gt; third mate&lt;/a&gt; of a merchant ship who, after a tremendous explosion and thinking his ship had been torpedoed, leapt naked from his bunk and jammed both his legs down one leg of his shorts, so immobilizing himself that he had to crawl out on deck on his hands and knees. Fortunately the explosion hadn't come from a torpedo but from a closely dropped depth charge.&lt;/p&gt;&lt;br /&gt;&lt;span&gt;D. Robertson, &lt;a href="http://www.amazon.com/Survive-Savage-Sea-Sailing-Classics/dp/0924486732/ref=sr_1_1?ie=UTF8&amp;amp;qid=1327696188&amp;amp;sr=8-1"&gt;Survive the Savage Sea&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;I wanted to post a funny paragraph from a paperback I've been  reading.  Since we had covered &lt;a href="http://www.cssbakery.com/2010/12/html-blockquote-element-css-content-and.html"&gt;CSS blockquotes&lt;/a&gt; before, I went  back to find out how to use that class with my quote.  &lt;a name='more'&gt;&lt;/a&gt;As it  is, every blockquote gets &lt;a href="http://www.cssbakery.com/2010/12/html-blockquote-element-css-content-and.html"&gt; an airplane&lt;/a&gt;  but I had a boat to display.  I must have assumed that the  user would rewrite the background statements to fulfill their needs.   This is a very easy change. But sometimes people just want to use things  as is and have it work for them.  So now, I am going to rewrite a more  generic blockquote class without a background image - you can always add  one if you desire using &lt;a href="http://www.cssbakery.com/2010/12/html-blockquote-element-css-content-and.html"&gt;this post&lt;/a&gt; as a guide. &lt;br /&gt;&lt;br /&gt;&lt;h1&gt;THE CSS&lt;/h1&gt;&lt;pre class="Blue"&gt;/* blockquote generic*/&lt;br /&gt;div.post-body blockquote.gen img  { &lt;br /&gt;   float: left;  &lt;br /&gt;   margin-right: 25px; &lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;div.post-body blockquote.gen span { &lt;br /&gt;   float: right; &lt;br /&gt;   margin-top: 5px;&lt;br /&gt;   font-size: 13px;&lt;br /&gt;   font-weight: normal;&lt;br /&gt;   text-transform: uppercase;&lt;br /&gt;   clear: both;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;blockquote.gen p.first:before,  &lt;br /&gt;blockquote.gen p.last:after {&lt;br /&gt;   font-weight: bold;&lt;br /&gt;   font-size: 4em;&lt;br /&gt;   color: #909090;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*MS repositioning upper quote*/&lt;br /&gt;blockquote.gen p.first:before {&lt;br /&gt;   /*push the upper quote down, line up with the text*/&lt;br /&gt;   position: relative;&lt;br /&gt;   top: 0.4em;&lt;br /&gt;   /*to push the text away from the quote symbol*/&lt;br /&gt;   padding-right: 0.2em;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;.post blockquote.gen {&lt;br /&gt;   width: 490px;&lt;br /&gt;   margin: 0px;&lt;br /&gt;   padding: 18px 30px 30px;&lt;br /&gt;&lt;br /&gt;   background-color: #d9e8fa;&lt;br /&gt;   border-top: 5px solid #b29b81;&lt;br /&gt;   border-bottom: 5px solid #b29b81;&lt;br /&gt;   quotes: "\201C" "\201D";&lt;br /&gt;&lt;br /&gt;   font-family: Calibri, sans-serif;&lt;br /&gt;   font-size: 15px;&lt;br /&gt;   color: #363636;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; blockquote.gen p.first:before { content: open-quote; }&lt;br /&gt; blockquote.gen p.last:after   { &lt;br /&gt;    content: close-quote; &lt;br /&gt;    float: right; &lt;br /&gt;    padding-top:20px;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; .post blockquote.gen p {&lt;br /&gt;   margin: 0 0 0.75em;&lt;br /&gt; }          &lt;br /&gt; /* end of blockquotes */      &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;THE HTML&lt;/h1&gt;&lt;pre class="MiamiVice"&gt;&amp;lt;blockquote class="gen"&amp;gt;&lt;br /&gt;&amp;lt;img src="images/tallship2.png" alt="" /&amp;gt;&lt;br /&gt;&amp;lt;p class="first"&amp;gt;&lt;br /&gt;People do odd things...... alive. &amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;p class="last"&amp;gt;My favorite one is of the ...... charge.&amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;span&amp;gt;D. Robertson, &amp;lt;a href="#"&amp;gt;Surviving the Savage Sea&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;&amp;lt;/blockquote&amp;gt;  &lt;/pre&gt;&lt;br /&gt;&lt;h1&gt;RELATIVE POSITIONING TO NUDGE THE QUOTE DOWN&lt;/h1&gt;&lt;br /&gt;Given the 4em font size, the first quote comes out rather large, producing a large line height to go with it.  Since the text within the quote is in a much smaller font, we end up with a pretty large offset between the quote and the first letter of the text.  The upper quote still looks decent but if you want to make it perfect, we can fix it using relative positioning.&lt;br /&gt;&lt;br /&gt;&lt;img alt="Quote Repositioning" src="http://pics.cssbakery.com/pics/cssquotepositioning2.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;HOW TO USE THE CLASS&lt;/h1&gt;&lt;br /&gt;Your markup will be very similar to the above.  If you wish, you can change the background color from blue to a color of your choosing by rewriting the background color statement in the CSS and of course find a substitute for the image in the markup.  Remember the filename and path "images/tallship2.png" are generic, you need to write your own URL.&lt;br /&gt;&lt;br /&gt;&lt;div class="creditsL"&gt;The ship graphic used in the blockquote demo is by http://cemagraphics.deviantart.com &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-8121132893745505069?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/p01HsJ5h4bk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/8121132893745505069/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/01/writing-generic-css-blockquote-class.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/8121132893745505069" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/8121132893745505069" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/p01HsJ5h4bk/writing-generic-css-blockquote-class.html" title="Writing a Generic CSS Blockquote Class" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/01/writing-generic-css-blockquote-class.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-5353653687374164437</id><published>2012-01-20T23:28:00.000-08:00</published><updated>2012-01-22T13:31:42.705-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="first-child" /><category scheme="http://www.blogger.com/atom/ns#" term="Padding and Margins" /><category scheme="http://www.blogger.com/atom/ns#" term="Descendant Selector" /><category scheme="http://www.blogger.com/atom/ns#" term="Modifying Blogger" /><title type="text">Blogger Adjustments Using CSS</title><content type="html">&lt;script type="text/javascript"&gt;$(window).load(function(){ $('#visionofhomejpg').cssBakeryCaption({'opacity':'0.3','center':true,'centerCaption':true,'round':true,'hide':true,'color':'white','bgcolor':'white'}); }); &lt;/script&gt;&lt;img alt="[looking back]&amp;lt;br&amp;gt;© 2012 Copyright www.cssbakery.com All Rights Reserved" id="visionofhomejpg" src="http://pics.cssbakery.com/pics/visionofhome.jpg" style="display: none;" /&gt;&lt;br /&gt;Another post working on Blogger software.  I host my own images and have my own domain but my blog is on Blogger so any time I update the look and feel of the site, I have to work with their software.  The placement of my post date could use some improvement.  &lt;a href="http://pics.cssbakery.com/pics/firstchildh2.jpg"&gt;Here's how it looks now&lt;/a&gt;.&lt;a name='more'&gt;&lt;/a&gt; I highlighted the gap between the date and my site logo in purple.  Either the logo or the date needs to move.  I will pull up the date for the first post, which means I will initialize the top margin for h2 to zero.  One caveat: I wouldn't want the new change to effect every post since I need that top margin for separating successive posts.  CSS first-child property will allow us to write a style that will be exclusively for the first post only.&lt;br /&gt;&lt;br /&gt;div.blog-posts h2:first-child { margin-top: 0px; }&lt;br /&gt;&lt;br /&gt;Zeroing the top margin of the post aligns us better but now I feel we are looking too crowded.  &lt;a href="http://pics.cssbakery.com/pics/toocrowded.jpg"&gt;See what you think&lt;/a&gt;.  I think we need some breathing room.&lt;br /&gt;&lt;br /&gt;Let's try lining up the blue block lettered CSS in my logo, with my main (the second column) and the right sidebar (the third column).  &lt;a href="http://pics.cssbakery.com/pics/bloggerUImain.jpg"&gt;Here's what we are going for&lt;/a&gt;. This will require rewriting our first style because we want to push it down and also push down the right sidebar:&lt;br /&gt;&lt;br /&gt;div.blog-posts h2:first-child { margin-top: 50px; }&lt;br /&gt;#sidebar-wrapper { padding-top: 63px; }&lt;br /&gt;&lt;br /&gt;I embedded these two statements into my local file but best way to do this is to keep an external style sheet and link that file into your Blogger style/markup template which is accessible via DESIGN/EDIT HTML.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-5353653687374164437?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/uhHjOLs_E7M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/5353653687374164437/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/01/more-blogger-adjustments.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/5353653687374164437" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/5353653687374164437" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/uhHjOLs_E7M/more-blogger-adjustments.html" title="Blogger Adjustments Using CSS" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/01/more-blogger-adjustments.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-7461356939202841188</id><published>2012-01-17T18:00:00.000-08:00</published><updated>2012-01-17T19:41:59.532-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blogger Template" /><category scheme="http://www.blogger.com/atom/ns#" term="Modifying Blogger" /><category scheme="http://www.blogger.com/atom/ns#" term="Blogspot" /><title type="text">Blogger Avatar Sitting on Top of Sidebar</title><content type="html">I was reading comments on the blog recently when I noticed the &lt;a href="http://pics.cssbakery.com/pics/avatarbug.jpg"&gt;avatar images &lt;/a&gt;sitting on top of my left sidebar.   &lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If I pushed the #comments div to the right,  the avatar would move along with it.  This would change my overall margins for the comment section which bothers the symmetrical strain in me but without a clear and apparent place for the avatar to go, was the easiest, fastest way to fix the problem. I decided I could always revisit the styling of comments later.&lt;br /&gt;&lt;br /&gt;div#main-wrapper #comments {&lt;br /&gt;margin-left: 20px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;does the trick.&lt;br /&gt;&lt;br /&gt;We are not writing over the &lt;a href="http://pics.cssbakery.com/pics/avataradjustment.jpg"&gt;left sidebar anymore&lt;/a&gt; which is good. We could push the avatar down  some to align it with the user name better.  Based on whether it's next to a user name that starts with lowercase or uppercase letters, the alignment looks different so I went for the middle of the road which looks pretty decent.  &lt;br /&gt;&lt;br /&gt;#comments-block .avatar-image-container {&lt;br /&gt;padding-top: 5px;&lt;br /&gt;}   &lt;br /&gt;&lt;br /&gt;Blogger users to make these changes, go to DESIGN &amp;gt; EDIT HTML and add the new CSS to your styles.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-7461356939202841188?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/Jt089rN1ND8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/7461356939202841188/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/01/blogger-avatar-sitting-on-top-of.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/7461356939202841188" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/7461356939202841188" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/Jt089rN1ND8/blogger-avatar-sitting-on-top-of.html" title="Blogger Avatar Sitting on Top of Sidebar" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/01/blogger-avatar-sitting-on-top-of.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-7312546326496393606</id><published>2012-01-15T20:25:00.001-08:00</published><updated>2012-05-05T02:10:43.628-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS 3.0 Transforms" /><category scheme="http://www.blogger.com/atom/ns#" term="Google Chrome" /><title type="text">CSS3 3D Transform Example</title><content type="html">&lt;a href="http://pics.cssbakery.com/pics/3drun.html"&gt;&lt;img alt="" src="http://pics.cssbakery.com/pics/3d.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;Above you see an image of a 3D box made from a single div element, and  rendered in Chrome using CSS3 3D Transforms.  On one side of the box you  see a small window with CSSBakery showing in it.  In the live demo,  that is actually an iframe that allows you to scroll and click around.&lt;br /&gt;&lt;br /&gt;If you click on the image you'll go to the live demo, but at the moment  3D Transforms are only supported on Apple Safari and Google Chrome (and  based on my tests, Chrome doesn't render it when running on Windows XP).   If you don't have a Browser with 3D transform support then it'll just  look like&lt;i&gt; a lot of gibberish&lt;/i&gt; and that includes Firefox which is the browser that I use.  If you are on IE, you need more than a prayer.  To download Chrome for Windows, visit &lt;a href="https://www.google.com/chrome/?brand=ECWB&amp;amp;installdataindex=welcome-ntp&amp;amp;hl=en&amp;amp;brand=CHFX&amp;amp;utm_campaign=en&amp;amp;utm_source=en-oa-na-us-bk-bng&amp;amp;utm_medium=oa"&gt;Google&lt;/a&gt;.  Google Chrome with Windows 7 as your OS will display the example correctly.&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The markup for this is really simple:&lt;br /&gt;&lt;br /&gt;&lt;pre class="Blue"&gt;&amp;lt;div id="bar1" class="bar"&amp;gt;  &lt;br /&gt; &amp;lt;iframe src="http://cssbakery.com"&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;br /&gt;The CSS is a bit longer, but still not too bad.  The main things we are doing are:&lt;br /&gt;&lt;ul class="starlist"&gt;&lt;li&gt;Setting up a common perspective value and origin in a parent element (body).  These values are then used by all 3D transforms that are done in all child elements.&lt;/li&gt;&lt;li&gt;We set the transform style to:  preserve-3d&lt;/li&gt;&lt;li&gt;We create a couple of pseudo elements to go along with our content div.  These are the ::before and ::after pseudo elements, which we'll use for rendering the right side and top of the 3d bar.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;We use the transform property on each of the 3 elements to rotate and translate it in space to form the image of a 3d box.&lt;/li&gt;&lt;li&gt;We add some styles for the iframe I mentioned earlier, including some positioning and a scaling factor to make it fit.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Here's the CSS:&lt;br /&gt;&lt;pre class="Blue"&gt;body {&lt;br /&gt; -webkit-perspective: 1000px;&lt;br /&gt; -webkit-perspective-origin: 200px -150px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#bar1 {&lt;br /&gt; color: white;&lt;br /&gt; font-size: 50px;&lt;br /&gt; text-align: center;&lt;br /&gt; background: navy;&lt;br /&gt; top: 300px;&lt;br /&gt; left: 400px; &lt;br /&gt; -webkit-transform-style: preserve-3d;&lt;br /&gt; -webkit-transform: translateX(-20%) rotateY(-45deg);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.bar, .bar::before, .bar::after {&lt;br /&gt; padding: 0;&lt;br /&gt; margin: 0;&lt;br /&gt; position: absolute;&lt;br /&gt; left: 100px;&lt;br /&gt; width: 200px;&lt;br /&gt; height: 260px; &lt;br /&gt; display: block;&lt;br /&gt; position: absolute;&lt;br /&gt; font-size: 25px;&lt;br /&gt; line-height: 35px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.bar::before {&lt;br /&gt; &lt;br /&gt; content: 'Before';&lt;br /&gt; top: -100px;&lt;br /&gt; height: 200px;&lt;br /&gt; background-color: rgba(0, 0, 255, .4);&lt;br /&gt; -webkit-transform: rotateY(90deg) rotateX(90deg) translate(50%, -50%);&lt;br /&gt; -moz-transform: rotateY(90deg) rotateX(90deg) translate(50%, -50%);&lt;br /&gt; -o-transform: rotateY(90deg) rotateX(90deg) translate(50%, -50%);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.bar::after {&lt;br /&gt; content: 'After';&lt;br /&gt; top: 0px;&lt;br /&gt; background-color: rgba(0, 255, 0, .4);&lt;br /&gt; -webkit-transform: rotateY(90deg) translateX(50%);&lt;br /&gt; -moz-transform: rotateY(90deg) translateX(50%);&lt;br /&gt; -o-transform: rotateY(90deg) translateX(50%);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;iframe {&lt;br /&gt;    position: absolute;&lt;br /&gt;    left: -50px;&lt;br /&gt;    top: -96px;&lt;br /&gt;    height: 438px;&lt;br /&gt;    -webkit-transform: scale(.48);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-7312546326496393606?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/nm2dQXZvegg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/7312546326496393606/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/01/css3-3d-transform-example.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/7312546326496393606" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/7312546326496393606" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/nm2dQXZvegg/css3-3d-transform-example.html" title="CSS3 3D Transform Example" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/01/css3-3d-transform-example.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-4044703752139372443</id><published>2012-01-04T23:00:00.000-08:00</published><updated>2012-01-09T10:58:30.926-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computing News" /><category scheme="http://www.blogger.com/atom/ns#" term="CSS Bar Graphs" /><category scheme="http://www.blogger.com/atom/ns#" term="Browsers" /><category scheme="http://www.blogger.com/atom/ns#" term="IE6" /><category scheme="http://www.blogger.com/atom/ns#" term="Google Chrome" /><category scheme="http://www.blogger.com/atom/ns#" term="Firefox" /><category scheme="http://www.blogger.com/atom/ns#" term="Browser Wars" /><title type="text">King's Crown to be Made of Chrome?</title><content type="html">&lt;div class="bargraph" style="width: 292px;"&gt;&lt;ul class="bars chrome-watermark"&gt;&lt;li class="bar1 orangebar" style="height: 12px;"&gt;&lt;span&gt;6%&lt;/span&gt;&lt;/li&gt;&lt;li class="bar2 crimsonbar" style="height: 50px;"&gt;25%&lt;/li&gt;&lt;li class="bar3 navybar" style="height: 54px;"&gt;27%&lt;/li&gt;&lt;li class="bar4 tealbar" style="height: 70px;"&gt;35%&lt;/li&gt;&lt;/ul&gt;&lt;ul class="label"&gt;&lt;li&gt;Safari&lt;/li&gt;&lt;li&gt;Firefox&lt;/li&gt;&lt;li&gt;Chrome&lt;/li&gt;&lt;li&gt;IE&lt;/li&gt;&lt;/ul&gt;&lt;ul class="y-axis"&gt;&lt;li&gt;100&lt;/li&gt;&lt;li&gt;75&lt;/li&gt;&lt;li&gt;50&lt;/li&gt;&lt;li&gt;25&lt;/li&gt;&lt;li&gt;0&lt;/li&gt;&lt;/ul&gt;&lt;p class="centered"&gt;Browser Market Share &lt;br /&gt;&lt;span class="graphfooter"&gt;©2012 &lt;a href="http://www.cssbakery.com/2009/06/data-visualisation-flexible-bar-graphs.html"&gt;bar graphs&lt;/a&gt; by cssbakery.com&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;Could Google Chrome overtake Microsoft's Internet Explorer in the browser wars? That's what people are asking after StatCounter reported that &lt;a href="http://www.blogger.com/%20http://www.cnn.com/2012/01/04/tech/web/google-chrome-browser/index.html?hpt=hp_bn6"&gt;Chrome has just bypassed Firefox&lt;/a&gt; in browser market share.  &lt;a name='more'&gt;&lt;/a&gt; Firefox and Chrome, long favored by developers, have steadily gone up in number of downloads over the years.   Internet Explorer is still the leader but everybody, including Microsoft, is happy  &lt;a href="http://technolog.msnbc.msn.com/_news/2012/01/04/9947042-ding-dong-ie-6-is-dead"&gt;IE6&lt;/a&gt; share is down to less than 1%. Not unlike those scenes in the movies when no matter what you do, you just can't kill the scary beast, there's a  reason why IE6 has staying power.&lt;br /&gt;&lt;br /&gt;Some corporations and government entities are still using IE6 because they have a suite of applications developed and tested on that particular browser.  Moving to a new browser means they have to re-test all those applications and fix the ones that are broken, all of which costs them money.  Of course, they should realize that there is also a large cost for staying on IE6, including extra effort for new applications and the potential cost of security breaches caused by the use of a 10 year old browser.&lt;br /&gt;&lt;br /&gt;Here's a set of earlier CSSBakery posts on &lt;a href="http://www.cssbakery.com/2010/09/building-chrome-on-64-bit-ubuntu-1004.html"&gt;Google Chrome&lt;/a&gt;.  The bar graph with the &lt;a href="http://pics.cssbakery.com/pics/emblemchrome.png"&gt;emblem&lt;/a&gt; was made using CSS classes  that we developed &lt;a href="http://www.cssbakery.com/2009/06/data-visualisation-flexible-bar-graphs.html"&gt;here&lt;/a&gt;.  For the markup and watermark css, look &lt;a href="http://pics.cssbakery.com/pics/chromebargraph.txt"&gt;here&lt;/a&gt;.  &lt;br /&gt;&lt;br /&gt;Google Chrome is written in C++.  I'm including a &lt;a href="http://pics.cssbakery.com/pics/chromesamplecode.txt"&gt; sample&lt;/a&gt; of the source code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-4044703752139372443?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/aas_wtRkj5E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/4044703752139372443/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/01/googles-chrome-is-on-rise.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/4044703752139372443" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/4044703752139372443" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/aas_wtRkj5E/googles-chrome-is-on-rise.html" title="King's Crown to be Made of Chrome?" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/01/googles-chrome-is-on-rise.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-5566153170882033052</id><published>2012-01-01T10:58:00.000-08:00</published><updated>2012-01-07T15:22:51.882-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Security Essentials" /><category scheme="http://www.blogger.com/atom/ns#" term="Anti-Virus Software" /><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu" /><title type="text">Microsoft Security Essentials</title><content type="html">&lt;script type="text/javascript"&gt;$(window).load(function(){ $('#BAILINGgif').cssBakeryCaption({'opacity':'0.3','center':true,'centerCaption':true,'round':true,'hide':true,'color':'white','bgcolor':'black'}); }); &lt;/script&gt;&lt;img alt="Happy New Year! :-)&amp;lt;br&amp;gt;© 2012 Copyright www.cssbakery.com All Rights Reserved" id="BAILINGgif" src="http://pics.cssbakery.com/pics/BAILING.gif" style="display: none;" /&gt;&lt;br /&gt;I had a Coast Guard instructor once, a gruff but lovable &lt;a href="http://en.wikipedia.org/wiki/File:Captain_Haddock.png"&gt;Captain Haddock&lt;/a&gt; type with a penchant for donuts, who used to tell us that anybody who gets on his boat has to wear a life vest at all times.  On board, he kept three of anything that was important - 3 GPS'es, 3 batteries, 3 radios that I can remember.  Inside a large, lake-like harbor or with a computer that rarely goes to unknown sites,  life vests and anti-virus software start feeling bulky, obstructive and you start bending the golden rules. &lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;When another computer detected problems with some of my files,  I scanned the suspect laptop with McAfee and Avast which revealed surprises in the form of Siveras-B. Feeling invincible, I hadn't run any anti-virus software on it for awhile (a sheepish grin). Even though I removed the threats identified by Avast and McAfee,  MSE full scan, a free &lt;a href="http://windows.microsoft.com/en-US/windows/products/security-essentials"&gt;downloadable&lt;/a&gt; from Microsoft, which took six hours to run, came up with more.   &lt;a href="http://windows.microsoft.com/en-US/windows/products/security-essentials"&gt;Microsoft Security Essentials&lt;/a&gt; Quick scan had declared it clean.  The lesson to learn from my example:  Run regular scans on all of your computers and any medium that comes into contact with them. An SD card that was infected is how I became aware of my situation.&lt;br /&gt;&lt;br /&gt;If you find yourself in a similar or worse predicament and you want to back up your data before you reformat a disk, remember that even when your operating system's gone belly up, you can always boot using &lt;a href="http://www.ubuntu.com/download/ubuntu/download"&gt;Ubuntu Linux&lt;/a&gt; on a portable medium to access your files.  After saving important data, reformat the disk and reload the OS for a fresh start.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-5566153170882033052?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/5AotauooaNM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/5566153170882033052/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2012/01/microsoft-security-essentials.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/5566153170882033052" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/5566153170882033052" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/5AotauooaNM/microsoft-security-essentials.html" title="Microsoft Security Essentials" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2012/01/microsoft-security-essentials.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-1941726766665404933</id><published>2011-12-31T15:02:00.000-08:00</published><updated>2012-01-07T17:38:16.916-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blogger Template" /><category scheme="http://www.blogger.com/atom/ns#" term="Blog Software" /><category scheme="http://www.blogger.com/atom/ns#" term="Class" /><category scheme="http://www.blogger.com/atom/ns#" term="Modifying Blogger" /><category scheme="http://www.blogger.com/atom/ns#" term="Expand Widget Templates" /><category scheme="http://www.blogger.com/atom/ns#" term="Blogspot" /><title type="text">Styling Blogger Differently for Single Post vs. Multiple Posts</title><content type="html">&lt;script type="text/javascript"&gt;$(window).load(function(){ $('#hldylites1gif').cssBakeryCaption({'opacity':'0.1','center':true,'centerCaption':true,'round':true,'hide':true,'color':'white','bgcolor':'white'}); }); &lt;/script&gt;&lt;br /&gt;&lt;img alt="Happy New Year&amp;lt;br&amp;gt;© 2011 Copyright www.cssbakery.com All Rights Reserved" id="hldylites1gif" src="http://pics.cssbakery.com/pics/hldylites1.gif" style="display: none;" /&gt;&lt;br /&gt;If you are a Blogger user, you may find this useful.  I had a situation where I wanted to style something differently for the individual post page vs. the main page where all the latest blog entries are displayed.  Looking at the Blogger HTML markup, I found that the HTML is very similar between these two pages.  So similar in fact that I could not write a CSS selector that would apply to one and not the other. &lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To solve this, I added a div that will have a different class name when viewing a single post vs. the main list of recent posts.  To do this, I had to edit my Blogger template and 'expand widget templates'.  I found the place I wanted to add the new div and entered it as follows&lt;br /&gt;&lt;br /&gt;&lt;pre class="Blue"&gt;&amp;lt;div expr:class='data:blog.pageType''&amp;gt;&lt;br /&gt;    &amp;lt;!-- the div's I want to enclose for styling --&amp;gt;&lt;br /&gt;  &amp;lt;/div&amp;gt;  &lt;/pre&gt;&lt;br /&gt;Note the 'expression' used within the div tag ("expr:class='data:blog.pageType'").  This is a Blogger scripting expression that will be evaluated at runtime.  Blogger will evaluate it and render something different based on the value of it's blog.pageType internal variable.  For a single post page, this expression will evalute to "class='item'", whereas on a mult-post home page it will evaluate to "class='index'".&lt;br /&gt;&lt;br /&gt;So, after doing this, the single post view will have the following div:&lt;br /&gt;&lt;br /&gt;&amp;lt;div class='item'&amp;gt;&lt;br /&gt;&lt;br /&gt;and the main list of posts will have:&lt;br /&gt;&lt;br /&gt;&amp;lt;div class='index'&amp;gt;&lt;br /&gt;&lt;br /&gt;Now I can write CSS rules that target one or the other using the different class names.&lt;br /&gt;&lt;br /&gt;.blog-pager .item {&lt;br /&gt;/* do something different on the single post page */&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.blog-pager .index {&lt;br /&gt;/* do something else for the main page */&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-1941726766665404933?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/FeE9-qTgM3Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/1941726766665404933/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2011/12/styling-blogger-differently-for-single.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/1941726766665404933" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/1941726766665404933" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/FeE9-qTgM3Y/styling-blogger-differently-for-single.html" title="Styling Blogger Differently for Single Post vs. Multiple Posts" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2011/12/styling-blogger-differently-for-single.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-361388338312954311</id><published>2011-12-26T12:54:00.001-08:00</published><updated>2012-05-08T06:37:08.326-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Relative Positioning" /><category scheme="http://www.blogger.com/atom/ns#" term="float next to ul" /><category scheme="http://www.blogger.com/atom/ns#" term="background-position" /><category scheme="http://www.blogger.com/atom/ns#" term="Sprites" /><category scheme="http://www.blogger.com/atom/ns#" term="span" /><category scheme="http://www.blogger.com/atom/ns#" term="Adobe Photoshop Tutorials" /><category scheme="http://www.blogger.com/atom/ns#" term="li" /><category scheme="http://www.blogger.com/atom/ns#" term="Transparency" /><category scheme="http://www.blogger.com/atom/ns#" term="Background Positioning" /><category scheme="http://www.blogger.com/atom/ns#" term="Hollow Photoshop Circles" /><category scheme="http://www.blogger.com/atom/ns#" term="Absolute Positioning" /><category scheme="http://www.blogger.com/atom/ns#" term="Menu" /><title type="text">CSS Diagonal Menu with Sprites</title><content type="html">&lt;script type='text/javascript'&gt;$(window).load(function(){ $('#swooshAjpg').cssBakeryCaption({'opacity':'0.3','center':true,'centerCaption':true,'round':true,'hide':true,'color':'white','bgcolor':'white'}); }); &lt;/script&gt;&lt;br /&gt;&lt;img id='swooshAjpg' style='display:none;' src='http://pics.cssbakery.com/pics/swooshA.jpg' alt='Large Fleet on a Run&amp;lt;br&amp;gt;[got caught in middle while tacking]&amp;lt;br&amp;gt;&amp;copy; 2011 Copyright www.cssbakery.com All Rights Reserved'&gt;&lt;br /&gt;Below I decided to do another text wrapping experiment - similar to the "stair steps" in the &lt;a href="http://www.cssbakery.com/2011/12/curved-text-wrap-mock-slicing-image.html"&gt;previous post&lt;/a&gt; - where I'll have the right hand side of the text wrap along an angled series of graphics.  The graphics depict the various "points of sail" of a sailboat.  In this post rather than &lt;a href="http://www.cssbakery.com/2011/12/curved-text-wrap-mock-slicing-image.html"&gt;using invisible "steps"&lt;/a&gt; to force the wrapping, I'm going to use a fake stair approach where I'll just insert &amp;lt;br&amp;gt;'s into the text to break lines at appropriate words to form the angled right hand side.  While I'll do this by hand for this example, it wouldn't be too hard to write some server side code to insert the br's at appropriate places. &lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That takes care of the text, but we also have to position the circles along a diagonal line.  We'll do this with a combination of relative and absolute positioning.  We'll also add a hover style to pop up a box of text explaining the point of sail you are currently hovering over.&lt;br /&gt;&lt;br /&gt;In the outer div - POSwrap - we set the position to relative to establish a positioning context. Below, we set an absolute position for the ul.  Since the ul is a descendant of POSwrap it will use the positioning context we established above.  &lt;br /&gt;&lt;br /&gt;By absolutely positioning the entire ul we can move around all the point of sail graphics as a single unit (that is, all the li's within the ul will move together as we move the ul).  Note that we will need to adjust the ul's position to match the amount of text in the paragraphs above the graphics.&lt;br /&gt;&lt;br /&gt;Within the ul, we again use absolute positioning for each of the child li's.  This positioning establishes the angled line of circular graphics. &lt;br /&gt;&lt;br /&gt;In the working example below, hover over the portholes to see the text overlayed on a semi-transparent background.  We discussed CSS transparency in other posts.  The CSS and markup are fully listed, I explain the sprites briefly. If you search the blog, you'll find many other posts where I talk about &lt;a href="http://www.cssbakery.com/2011/12/css-sprites.html"&gt;sprites&lt;/a&gt;. I finish off with Photoshop circles.  Enjoy and watch where you are going! :-)&lt;br /&gt;&lt;br /&gt;&lt;div class="divider"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div id="POSwrap"&gt;&lt;br /&gt;&lt;h1&gt;Points of Sail&lt;/h1&gt;&lt;p&gt;A sailboat cannot sail directly into the eye of the wind, but can sail to within &lt;br /&gt;45 degrees of the wind or closer when close-hauled. If you head into the&lt;br /&gt;wind, your sails will start luffing and you will lose power and the&lt;br /&gt;ability to steer.  Describing a sailboat's course in relation&lt;br /&gt;to the wind direction, the points of sale on the right&lt;br /&gt;show a starboard tack and assume that the&lt;br /&gt;wind is blowing from the top of your &lt;br /&gt;screen. Boat drawings and info &lt;br /&gt;from Chapman Piloting &lt;br /&gt;and Seamanship, &lt;br /&gt;65th edition &lt;br /&gt;by &lt;em&gt;E. Maloney&lt;/em&gt;.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul id="pointsofsail"&gt;&lt;li id="run"&gt;&lt;span&gt;&lt;h2&gt;Run&lt;/h2&gt;When the wind is almost directly aft, the boat is said to be "running".  If the wind is light, it'll feel like you are not moving but just look behind the boat and you'll see a rippling line of water.  In stronger winds, gybing is a danger with this sail.  Aerodynamically simpler but can be the most dangerous point of sail.&lt;/span&gt;&lt;/li&gt;&lt;li id="closehauled"&gt;&lt;span&gt;&lt;h2&gt;Close-Hauled&lt;/h2&gt;When there's the smallest angle between wind direction and heading, the boat is said to be "close-hauled" meaning that it sails are hauled in close to the hull.  My favorite sail.&lt;/span&gt;&lt;/li&gt;&lt;li id="closereach"&gt;&lt;span&gt;&lt;h2&gt;Close Reach&lt;/h2&gt;When the angle between heading and wind direction is increased, the boat begins to "close reach".  A close reach is somewhat toward the wind, and broad reach is a little bit away from the wind. Fast point of sale for most boats.  The sails are eased about halfway out.&lt;/span&gt; &lt;/li&gt;&lt;li id="beamreach"&gt;&lt;span&gt;&lt;h2&gt;Beam Reach&lt;/h2&gt;The boat is "beam reaching" when the wind is on the beam at a right angle to the boat.  &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li id="broadreach"&gt;&lt;span&gt;&lt;h2&gt;Broad Reach&lt;/h2&gt;Further increases to the angle between heading and wind direction (more than 90 degrees) bring the boat to a "broad reach"&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;br /&gt;&lt;h1&gt;THE CSS AND THE MARKUP&lt;/h1&gt;&lt;br /&gt;/* pos */&lt;br /&gt;ul#pointsofsail {   position: absolute;&lt;br /&gt;padding: 0; margin: 0;&lt;br /&gt;list-style-type: none;&lt;br /&gt;&lt;br /&gt;/*these 2 points will position it from title of blog post*/&lt;br /&gt;/*and the title of pointofsale element*/&lt;br /&gt;top:   105px;  /*go below positioning context s 0 0 - go below*/&lt;br /&gt;left: -125px;  /*go left of positioning context s 0 0 - go left*/&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ul#pointsofsail li {&lt;br /&gt;background-image: url("http://pics.cssbakery.com/pics/pointsofsail.png");&lt;br /&gt;background-repeat: none;&lt;br /&gt;height: 102px;&lt;br /&gt;width: 102px;&lt;br /&gt;position: absolute; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ul#pointsofsail li span {&lt;br /&gt;font: 13px Arial, Helvetica, sans-serif;&lt;br /&gt;line-height: 16px;&lt;br /&gt;color: #494949;&lt;br /&gt;width: 200px;&lt;br /&gt;background: #fcf6e6;&lt;br /&gt;padding: 20px;&lt;br /&gt;&lt;br /&gt;border: 3px solid #616161;&lt;br /&gt;-moz-border-radius: 5px;&lt;br /&gt;-webkit-border-radius: 5px;&lt;br /&gt;border-radius: 5px;&lt;br /&gt;&lt;br /&gt;opacity: .90;&lt;br /&gt;filter: alpha(opacity=90);&lt;br /&gt;&lt;br /&gt;display: none;&lt;br /&gt;position: absolute;&lt;br /&gt;top: 120px;&lt;br /&gt;/*lines up with my blogger text but 8px works by shifting &lt;br /&gt;the hover window a little to the right &lt;br /&gt;*/&lt;br /&gt;left: 8px; &lt;br /&gt;text-align: justify;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*the span is always the first child of the li in this &lt;br /&gt;markup.  We are really trying to get to the first&lt;br /&gt;list item in the ul so the first-child goes to the li&lt;br /&gt;element&lt;br /&gt;I want the first popup window to be placed at 0 left and &lt;br /&gt;not 8px like the rest of them&lt;br /&gt;*/&lt;br /&gt;#POSwrap ul#pointsofsail li:first-child span { left: 0; }&lt;br /&gt;&lt;br /&gt;ul#pointsofsail li:hover span {&lt;br /&gt;display: block;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#closehauled {&lt;br /&gt;background-position: 0 0;&lt;br /&gt;height: 102px;&lt;br /&gt;width: 102px; &lt;br /&gt;left: 571px;&lt;br /&gt;top: 9px;&lt;br /&gt;}&lt;br /&gt;#closehauled:hover {&lt;br /&gt;background-position: 0 -102px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#closereach {&lt;br /&gt;background-position: -102px 0;&lt;br /&gt;left: 460px;&lt;br /&gt;top: 72px;&lt;br /&gt;}&lt;br /&gt;#closereach:hover {&lt;br /&gt;background-position: -102px -102px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#beamreach {&lt;br /&gt;background-position: -204px 0;&lt;br /&gt;left: 349px;&lt;br /&gt;top: 138px;&lt;br /&gt;}&lt;br /&gt;#beamreach:hover {&lt;br /&gt;background-position: -204px -102px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#broadreach {&lt;br /&gt;background-position: -306px 0;&lt;br /&gt;background-position: -307px -2px;&lt;br /&gt;left: 235px;&lt;br /&gt;top: 202px;&lt;br /&gt;}&lt;br /&gt;#broadreach:hover {&lt;br /&gt;background-position: -307px -104px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#run {&lt;br /&gt;background-position: -408px 0;&lt;br /&gt;background-position: -409px -2px;&lt;br /&gt;left: 125px;&lt;br /&gt;top: 266px;&lt;br /&gt;}&lt;br /&gt;#run:hover {&lt;br /&gt;background-position: -409px -104px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;div.post-body ul#pointsofsail li span h2 {&lt;br /&gt;font-size: 15px;&lt;br /&gt;line-height: 6px;&lt;br /&gt;font-weight: bold;&lt;br /&gt;padding: 0;&lt;br /&gt;margin: 5px 0 20px 0;&lt;br /&gt;&lt;br /&gt;/*to undo the effects of cascading*/&lt;br /&gt;text-transform: none;&lt;br /&gt;background: none;&lt;br /&gt;font-family : Arial,Helvetica,sans-serif;&lt;br /&gt;font-style : normal;&lt;br /&gt;letter-spacing : normal;&lt;br /&gt;line-height : 6px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*different colors*/&lt;br /&gt;ul#pointsofsail li#closehauled span h2 {&lt;br /&gt;color: #6a2df7;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ul#pointsofsail li#closereach span h2 {&lt;br /&gt;color: #61a1e2;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ul#pointsofsail li#beamreach span h2 {&lt;br /&gt;color: #23689c;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ul#pointsofsail li#broadreach span h2 {&lt;br /&gt;color: #06c2d3;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ul#pointsofsail li#run span h2 {&lt;br /&gt;color: #de0c1b;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;div.post-body div#POSwrap {  &lt;br /&gt;width: 550px;  &lt;br /&gt;margin: 0;&lt;br /&gt;padding: 0 0 90px;&lt;br /&gt;font-family: "Helvetica Neue Medium",Helvetica,"Helvetica Neue",Arial,sans-serif;&lt;br /&gt;position: relative;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;div.post-body div#POSwrap h1 {&lt;br /&gt;background: url(http://pics.cssbakery.com/pics/h2transparent.png) no-repeat;&lt;br /&gt;width: 244px;&lt;br /&gt;height: 56px;&lt;br /&gt;text-indent: -9999px;&lt;br /&gt;margin-top: 20px;&lt;br /&gt;}&lt;br /&gt;/*end of pos*/&lt;br /&gt;&lt;br /&gt;&lt;pre class='MiamiVice'&gt;&amp;lt;div id="POSwrap"&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;&lt;br /&gt;Points of Sail&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&lt;br /&gt;A sailboat cannot sail directly into the eye of the wind, but can sail to within &lt;br /&gt;45 degrees of the wind or closer when close-hauled. If you head into the&lt;br /&gt;wind, your sails will start luffing and you will lose power and the&lt;br /&gt;ability to steer.  Describing a sailboat's course in relation&lt;br /&gt;to the wind direction, the points of sale on the right&lt;br /&gt;show a starboard tack and assume that the&lt;br /&gt;wind is blowing from the top of your &lt;br /&gt;screen. Boat drawings and info &lt;br /&gt;from Chapman Piloting &lt;br /&gt;and Seamanship, &lt;br /&gt;65th edition &lt;br /&gt;by &amp;lt;em&amp;gt;E. Maloney&amp;lt;/em&amp;gt;.&lt;br /&gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ul id="pointsofsail"&amp;gt;&lt;br /&gt;&amp;lt;li id="run"&amp;gt;&amp;lt;span&amp;gt;&amp;lt;h2&amp;gt;&lt;br /&gt;Run&amp;lt;/h2&amp;gt;&lt;br /&gt;When the wind is almost directly aft, the boat is said to be "running".  If the wind is light, it'll feel like you are not moving but just look behind the boat and you'll see a rippling line of water.  In stronger winds, gybing is a danger with this sail.  Aerodynamically simpler but can be the most dangerous point of sail.&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li id="closehauled"&amp;gt;&amp;lt;span&amp;gt;&amp;lt;h2&amp;gt;&lt;br /&gt;Close-Hauled&amp;lt;/h2&amp;gt;&lt;br /&gt;When there's the smallest angle between wind direction and heading, the boat is said to be "close-hauled" meaning that it sails are hauled in close to the hull.   My favorite sail :)&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li id="closereach"&amp;gt;&amp;lt;span&amp;gt;&amp;lt;h2&amp;gt;&lt;br /&gt;Close Reach&amp;lt;/h2&amp;gt;&lt;br /&gt;When the angle between heading and wind direction is increased, the boat begins to "close reach".  A close reach is somewhat toward the wind, and broad reach is a little bit away from the wind. Fast point of sale for most boats.  The sails are eased about halfway out.&amp;lt;/span&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li id="beamreach"&amp;gt;&amp;lt;span&amp;gt;&amp;lt;h2&amp;gt;&lt;br /&gt;Beam Reach&amp;lt;/h2&amp;gt;&lt;br /&gt;The boat is "beam reaching" when the wind is on the beam at a right angle to the boat.  &amp;lt;/span&amp;gt;&lt;br /&gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li id="broadreach"&amp;gt;&amp;lt;span&amp;gt;&amp;lt;h2&amp;gt;&lt;br /&gt;Broad Reach&amp;lt;/h2&amp;gt;&lt;br /&gt;Further increases to the angle between heading and wind direction (more than 90 degrees) bring the boat to a "broad reach"&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;    &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;CSS SPRITES&lt;/h1&gt;&lt;br /&gt;The same rules that set the absolute positions of the graphics, also implements the CSS sprite technique by setting the background position attribute.  An additional hover style makes the sprite dynamic by changing the background offset when you hover over the graphic.  As an added touch, hovering over a graphic also displays the block of text contained in the corresponding li's span element (see the li:hover span" rule).&lt;br /&gt;&lt;br /&gt;Finally, for each of these blocks of text, we set the color of the heading to match the border color of the circular graphic.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://pics.cssbakery.com/pics/spritefile.jpg" alt="CSS Sprite File" /&gt;&lt;br /&gt;The &lt;a href="http://pics.cssbakery.com/pics/pointsofsail.png"&gt;sprite file&lt;/a&gt; that I'm using has the the active (when an image is pressed) and the inactive state (the grey versions) of each bitmap.  For detailed discussion of CSS Sprites, see these &lt;a href="http://www.cssbakery.com/2011/12/css-sprites.html"&gt;links&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;HOLLOW PHOTOSHOP CIRCLES&lt;/h1&gt;&lt;br /&gt;Here is a video briefly describing the steps involved in drawing consistent see through circles in Adobe Photoshop.  You will learn how to use the Ellipse tool to make perfect circles, Stroke, Blending Options Default, and Fill Opacity for vector shapes:&lt;br /&gt;&lt;br /&gt;&lt;iframe title="AdobeTV Video Player" width="480" height="296" src="http://tv.adobe.com/embed/588/10981/" frameborder="0" allowfullscreen scrolling="no"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-361388338312954311?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/FKruLWso5H4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/361388338312954311/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2011/12/css-diagonal-menu-with-sprites.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/361388338312954311" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/361388338312954311" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/FKruLWso5H4/css-diagonal-menu-with-sprites.html" title="CSS Diagonal Menu with Sprites" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.cssbakery.com/2011/12/css-diagonal-menu-with-sprites.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-3828745432855861029</id><published>2011-12-26T12:46:00.000-08:00</published><updated>2011-12-28T18:02:37.590-08:00</updated><title type="text">CSS Sprites</title><content type="html">&lt;div class="related_thumbnail"&gt;&lt;img src="http://pics.cssbakery.com/pics/littlespriteicon.jpg" alt="" title="" /&gt;&lt;h4&gt;CSS Sprites &lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2009/06/shifting-background-image.html"&gt;How Sprites Work: Shifting a Background Image&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2011/12/css-diagonal-menu-with-sprites.html"&gt;CSS Diagonal Menu with Sprites&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2009/04/css-sprite-for-performance-improvement.html"&gt;Sprites for Performance Improvement&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2009/06/data-visualisation-flexible-bar-graphs.html"&gt;Data Visualization: Sprites in Bar Graphs&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2011/05/css-image-grid-using-sprites_30.html"&gt;CSS Image Grid Using Sprites&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-3828745432855861029?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/2JuAy8nTk7k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/3828745432855861029/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2011/12/css-sprites.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/3828745432855861029" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/3828745432855861029" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/2JuAy8nTk7k/css-sprites.html" title="CSS Sprites" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2011/12/css-sprites.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-8799234002396021391</id><published>2011-12-18T08:39:00.000-08:00</published><updated>2011-12-18T09:34:06.909-08:00</updated><title type="text">Happy Holidays</title><content type="html">&lt;script type='text/javascript'&gt;$(window).load(function(){ $('#lightsgif').cssBakeryCaption({'opacity':'0.3','center':true,'centerCaption':true,'round':true,'hide':true,'color':'white','bgcolor':'#c13ef8'}); }); &lt;/script&gt;&lt;img id='lightsgif' style='display:none;' src='http://pics.cssbakery.com/pics/lights.gif' alt='Happy Holidays&amp;lt;br&amp;gt;&amp;copy; 2011 Copyright www.cssbakery.com All Rights Reserved'&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-8799234002396021391?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/LM-1e3rf6yw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/8799234002396021391/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2011/12/happy-holidays.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/8799234002396021391" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/8799234002396021391" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/LM-1e3rf6yw/happy-holidays.html" title="Happy Holidays" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2011/12/happy-holidays.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-2772153359972329062</id><published>2011-12-12T20:42:00.002-08:00</published><updated>2012-03-13T12:19:27.832-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Relative Positioning" /><category scheme="http://www.blogger.com/atom/ns#" term="CSS3" /><category scheme="http://www.blogger.com/atom/ns#" term="box-shadow" /><category scheme="http://www.blogger.com/atom/ns#" term="Positioning Elements" /><category scheme="http://www.blogger.com/atom/ns#" term="Padding and Margins" /><category scheme="http://www.blogger.com/atom/ns#" term="The Flow" /><category scheme="http://www.blogger.com/atom/ns#" term="Negative Margin" /><category scheme="http://www.blogger.com/atom/ns#" term="border-radius" /><category scheme="http://www.blogger.com/atom/ns#" term="Float" /><category scheme="http://www.blogger.com/atom/ns#" term="Absolute Positioning" /><category scheme="http://www.blogger.com/atom/ns#" term="Positioning Context" /><title type="text">The Stair Effect: CSS Curved Text Wrap Using a Mock Sliced Image</title><content type="html">&lt;img src="http://pics.cssbakery.com/pics/CSSMockSlices.jpg" alt="CSS Mock Slicing an Image" /&gt;To view the slideshow which has the major steps of the tutorial, click &lt;a href="http://pics.cssbakery.com/pics/gown.gif" alt=""&gt;here&lt;/a&gt;.  So why are we going to pretend to divide up an image into smaller rectangles?  Because I want to wrap text around an image following a curved path.  Like &lt;a href="http://www.peachpit.com/articles/article.aspx?p=434250&amp;seqNum=4"&gt;many others&lt;/a&gt; have done before, including &lt;a href="http://www.meyerweb.com"&gt;Eric Meyer&lt;/a&gt; in his blue book, you can also cut your image into real slices in Photoshop, which would simplify the CSS but it'd be labor intensive, and requires you to add img tags in the markup.  I want to do the same using CSS (and a bit of markup) without actually editing the image.&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Honestly, CSS was not what I had in mind when I started thinking about wrapping text around a PNG file which contained an unevenly shaped image.  Using Javascript, you can probably check for blank pixels to determine the real contour of an image and then  build a "staircase" based on that.  That would require a bit of programming and writing of some image processing algorithms.  &lt;br /&gt;&lt;br /&gt;Being a CSS-centric blog, I want to share with you a CSS technique that approximates the same thing without any traditional programming.  If you have a good grasp of CSS fundamentals and some patience, you can curve text around an image using only CSS and HTML.  The types of topics that we'll cover during this exercise are Negative Margins, Relative and Absolute Positioning, The Flow, and Floats.  &lt;br /&gt;&lt;br /&gt;The markup for the &lt;a href="http://pics.cssbakery.com/pics/gown.gif" alt="" /&gt;first still&lt;/a&gt; in the animated gif has a div enveloping an img and a p element. The image goes first and because p is a block element, the text starts at a new line.  The red border is for the enveloping div and the dotted black border belongs to the image.  No CSS needed, the markup goes something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class='Blue'&gt;&amp;lt;div id="stairs"&amp;gt;&lt;br /&gt;  &amp;lt;img src="images/gown.png"&amp;gt;&lt;br /&gt;  &amp;lt;p&amp;gt;An evening gown is a long flowing women's....&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;    &lt;/pre&gt;&lt;br /&gt;The output without any CSS &lt;a href="http://pics.cssbakery.com/pics/cssbakeryCURVEDTEXT.jpg"&gt;looks like this&lt;/a&gt;.  The borders are not turned on in this version because I have no CSS.&lt;br /&gt;&lt;br /&gt;Since we want to pull the text to the same level with the image, we begin writing some CSS.  Floating the image to the right should do the trick because this will sort of take the image out of the flow so as long as there's enough space the text and image will sit next to each other.  Text will flow around the floated image but other than that, the image being there will not cause a block level element generate a br.  &lt;br /&gt;&lt;br /&gt;&lt;pre class='Blue'&gt;#stairs img { float: right; border: 1px dotted black; }&lt;br /&gt;#stairs { border: 1px solid red; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Let's add 20 pixels all around to get the image away from the corner of the browser and give the stairs div a width of 500 pixels to contain the text a bit.  The &lt;a href="http://pics.cssbakery.com/pics/gown.gif" alt="" /&gt;third still&lt;/a&gt; is how we'll look at this point.&lt;br /&gt;&lt;br /&gt;&lt;pre class='Blue'&gt;#stairs { &lt;br /&gt;   border: 1px solid red;&lt;br /&gt;   margin: 20px;&lt;br /&gt;   width: 500px;&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;#stairs img { border: 1px dotted black; &lt;br /&gt;              float: right;}&lt;/pre&gt;&lt;br /&gt;The text is confined to a set width and is next to the image  but moving the text more towards the image will benefit the design.  To do this, we will use negative margins.  Remember a left margin controls how far away the neighboring element to your left has to stay from you.  You control how close someone gets to you.  When you have a negative margin, you are in effect saying "come on in" so that the elements actually start overlapping.  A left margin of minus 80 pixels looks okay.&lt;br /&gt;&lt;br /&gt;&lt;pre class='Blue'&gt;#stairs { &lt;br /&gt;   border: 1px solid red;&lt;br /&gt;   margin: 20px;&lt;br /&gt;   width: 500px;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;#stairs img { &lt;br /&gt;   border: 1px dotted black;&lt;br /&gt;   float: right;  &lt;br /&gt;   margin-left: -80px;}&lt;br /&gt;&lt;br /&gt;#stairs p   { text-align: justify; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here's the &lt;a href="http://pics.cssbakery.com/pics/negativemargin.jpg"&gt;output&lt;/a&gt; of our CSS and HTML after the latest changes.  I have the borders turned on for debugging.  &lt;br /&gt;&lt;br /&gt;&lt;h1&gt;STAIR EFFECT&lt;/h1&gt;&lt;br /&gt;With CSS, we do not have access to the internals of an image file so we are going to simulate the curve by stacking up rectangles on top of one another.  This reminds me of how we used to compute an integral using a numerical method.  &lt;br /&gt;&lt;br /&gt;The markup will change.  The finer the slices, the better the curve but for our purposes, four (4) should be sufficient to demonstrate the technique.  Six (6) rectangles will make it perfect which would be a good exercise for you.  All div's will be floated and will have nothing inside them so it's imperative that we declare width and height for each div.  Without dimensions, an empty div will collapse in the flow.  I'll take the negative margin out for now since we don't it for this case.  The containing block for the image is &lt;b&gt;csdiv&lt;/b&gt;, the wrapper div for the stair divs.  I'm sure you can come up with a more descriptive name for your div, cs is short for container-stairs div.&lt;br /&gt;&lt;br /&gt;&lt;pre class='Blue'&gt;/*the css*/&lt;br /&gt;#stairs { &lt;br /&gt;   border: 1px solid red;&lt;br /&gt;   margin: 20px;&lt;br /&gt;   width: 460px;&lt;br /&gt;   font: 13px/1.7 Georgia;&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;#stairs img { &lt;br /&gt;      border: 1px dotted black; &lt;br /&gt;      position: absolute; &lt;br /&gt;      top:0; right:0;  }&lt;br /&gt;&lt;br /&gt;#stairs p   { text-align: justify; }&lt;br /&gt;#csdiv      { position: relative; }&lt;br /&gt;&lt;br /&gt;.stair1, .stair2, .stair3, .stair4 { float: right; }   &lt;br /&gt;.stair2, .stair3, .stair4 { clear: both; }&lt;br /&gt;&lt;br /&gt;.stair1 { width: 181px;&lt;br /&gt;   height: 190px;&lt;br /&gt;   border: 1px solid blue;&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;.stair2 { width:  208px;&lt;br /&gt;   height: 76px;&lt;br /&gt;   border: 1px solid black;&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;.stair3 { width:  245px;  &lt;br /&gt;   height:  70px;&lt;br /&gt;   border: 1px solid red;&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;.stair4 { width:  278px;&lt;br /&gt;   height: 112px;&lt;br /&gt;   border: 1px solid green;&lt;br /&gt;   }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class='Blue'&gt;&amp;lt;!-- The Markup --&amp;gt;&lt;br /&gt;&amp;lt;div id="stairs"&amp;gt;&lt;br /&gt;  &amp;lt;div id="csdiv"&amp;gt;&lt;br /&gt;    &amp;lt;img src="images/gown.png"&amp;gt;&lt;br /&gt;    &amp;lt;div class="stair1"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;div class="stair2"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;div class="stair3"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;div class="stair4"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;  &amp;lt;/div&amp;gt;&lt;br /&gt;  &lt;br /&gt;  &amp;lt;p&amp;gt;&lt;br /&gt;  An evening gown is a long flowing women's dress usually worn....&lt;br /&gt;  &amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;img src="http://pics.cssbakery.com/pics/stairs.jpg" alt="CSS Stair Effect" /&gt;&lt;h1&gt;CSS3 BORDER PROPERTIES&lt;/h1&gt;&lt;br /&gt;You can easily see the different elements when we turn the borders on.  The text is nicely flowing around our image.  We can dress up the border in Firefox by thickening the border, rounding its corners and dropping a shadow. The -webkit- prefix covers Safari/Chrome/Konqueror. I am not including it in the code here but you should:&lt;br /&gt;&lt;br /&gt;#stairs { &lt;br /&gt;border: 9px solid #f8d0d4;&lt;br /&gt;-moz-border-radius: 12px;&lt;br /&gt;-moz-box-shadow: -2px 2px 5px 1px #888;&lt;br /&gt;box-shadow: -2px 2px 5px 1px #888;&lt;br /&gt;border-radius: 12px;&lt;br /&gt;......&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;A LITTLE MARGIN GOES A LONG WAY&lt;/h1&gt;&lt;br /&gt;With the addition of the &lt;a href="http://pics.cssbakery.com/pics/wborder.jpg"&gt;thick border&lt;/a&gt; for the stairs div, the first thing that strikes you is the lack of padding/margin which we can take care of easily.  &lt;br /&gt;&lt;br /&gt;The text runs right up to the red border so one way to fix this is to give some padding or margin to one of the elements.  I'm going to add margin to the p element with &lt;b&gt;margin: 40px 0 40px 40px;&lt;/b&gt; statement.  There will be no margin for the right side because that could create problems by  keeping the text away from our "stairs".&lt;br /&gt;&lt;br /&gt;&lt;img src="http://pics.cssbakery.com/pics/wborder.jpg" alt="CSS3 Border" /&gt;&lt;br /&gt;Let's get the text and the image away from the border:&lt;br /&gt;&lt;br /&gt;#stairs p   { &lt;br /&gt;text-align: justify; &lt;br /&gt;margin: 40px 0 40px 40px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;A SET OF STAIRS KEEP THE TEXT AT BAY&lt;/h1&gt;&lt;br /&gt;Just so we are on the same page - if you are thinking the image itself is playing any role in arranging the text, you'd be wrong.  It's taken out of the flow by the absolute positioning and is only there for displaying purposes.  The 4 rectangles are now the "image".  As long as we overlay the image where the rectangles are stacked up, we'll fool the eye.&lt;br /&gt;&lt;br /&gt;#stairs { &lt;br /&gt;margin: 50px;&lt;br /&gt;width: 360px;&lt;br /&gt;font: 13px/1.7 Georgia;&lt;br /&gt;border: 9px solid #f8d0d4;&lt;br /&gt;-moz-border-radius: 12px;&lt;br /&gt;-moz-box-shadow: -2px 2px 5px 1px #888;&lt;br /&gt;border-radius: 12px;&lt;br /&gt;box-shadow: -2px 2px 5px 1px #888;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;I am going to nudge the image up a little by absolutely positioning the top by -20 pixels.  This will move the image up a little above the border.  &lt;br /&gt;&lt;br /&gt;#stairs img { &lt;br /&gt;position: absolute; &lt;br /&gt;top:-20px; right:0;  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;RELATIVE POSITIONING LEAVES A HOLE IN THE FLOW&lt;/h1&gt;&lt;br /&gt;#csdiv      { &lt;br /&gt;position: relative; &lt;br /&gt;right: -165px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;To see the effects of the relative (moving the stairs to the right) and absolute positioning (moving the image up), take a look &lt;a href="http://pics.cssbakery.com/pics/thehole.jpg"&gt;here&lt;/a&gt;.  &lt;b&gt;csdiv&lt;/b&gt; is relatively positioned.  It's still in the flow but we have moved it to the right by 165 pixels. We are doing this because we want the image to pop out of its container and sit on top of the border.  But doing so will leave a &lt;a href="http://pics.cssbakery.com/pics/thehole.jpg"&gt;"hole"&lt;/a&gt; behind where &lt;b&gt;csdiv&lt;/b&gt; was going to be.  As far as the flow is concerned, it still is.  &lt;br /&gt;&lt;br /&gt;We are going fill in  the&lt;a href="http://pics.cssbakery.com/pics/thehole.jpg"&gt; yellow strip&lt;/a&gt; - leftover from the relative positioning - by bringing the text over to the right.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;NEGATIVE MARGIN TO PULL THE TEXT TO THE RIGHT&lt;/h1&gt;&lt;br /&gt;The curve will stay the same.  Every stair will get the same negative margin of minus 162 pixels.  I can turn off my debugging borders simply by setting all borders to none.&lt;br /&gt;&lt;br /&gt;/*negative margin to pull the text over*/&lt;br /&gt;.stair1, .stair2, .stair3, .stair4 { &lt;br /&gt;float: right; &lt;br /&gt;margin-left: -162px;&lt;br /&gt;border: none;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Notice how we have moved the image over the border of its containing div in the &lt;a href="http://pics.cssbakery.com/pics/finalgown.jpg" alt="CSS Curved Text Wrap" /&gt;final version&lt;/a&gt;.  I thought we were done then I remembered that I had replaced the first letter of the paragraph with a &lt;a href="http://pics.cssbakery.com/pics/35pxdropshadow.jpg" alt="" /&gt;dropcap&lt;/a&gt;.  &lt;br /&gt;&lt;br /&gt;At the time I wrote the &lt;a href="http://www.cssbakery.com/2010/01/drop-caps-in-css.html"&gt;CSS Dropcap post&lt;/a&gt;, I didn't think a non-floated version was going to help anyone but maybe calm down people's fears about floats.  Well, as it turns out, a non-floated dropcap, "stylized_olho-a" in this case, is exactly what I needed for this example to work. &lt;br /&gt;&lt;br /&gt;&lt;h1&gt;THE CSS &amp; THE MARKUP&lt;/h1&gt;&lt;br /&gt;If you want to see the entire CSS and markup based on this version, click &lt;a href="http://pics.cssbakery.com/pics/CSSCurvedTextWrap.txt"&gt;here&lt;/a&gt;.  HTML version &lt;a href="http://pics.cssbakery.com/pics/CSSCurvedText.html"&gt;here&lt;/a&gt;. The introductory gif shows the text lighter than I have in the image below. If you prefer it that way, update the paragraph selector with: #stairs p { color: #999999; }. &lt;br /&gt;&lt;br /&gt;For comparing the image below with what we started out, see  &lt;a href="http://pics.cssbakery.com/pics/cssbakeryCURVEDTEXT.jpg"&gt;here&lt;/a&gt;. Once again, the &lt;a href="http://pics.cssbakery.com/pics/gown.gif" alt="" /&gt;slideshow&lt;/a&gt; has the major steps of the tutorial.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://pics.cssbakery.com/pics/CSSDropCap.jpg" alt="CSS Curved Text Wrap" /&gt;&lt;br /&gt;&lt;br /&gt;Image Credit: Miss USA 2011, www.missusa.com&lt;br /&gt;&lt;!-- By the end of this post, our image will be absolutely positioned and the "stair" divs that will take the place of the image relatively positioned.  Any element that is absolutely positioned is out of the flow, the stairs will still be there but we have to fill in the hole left behind with a negative margin --&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-2772153359972329062?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/_qCoTA8WPuM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/2772153359972329062/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2011/12/curved-text-wrap-mock-slicing-image.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/2772153359972329062" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/2772153359972329062" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/_qCoTA8WPuM/curved-text-wrap-mock-slicing-image.html" title="The Stair Effect: CSS Curved Text Wrap Using a Mock Sliced Image" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2011/12/curved-text-wrap-mock-slicing-image.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-5791852962184539114</id><published>2011-11-11T21:43:00.001-08:00</published><updated>2012-04-07T10:11:57.776-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Classes and IDs" /><category scheme="http://www.blogger.com/atom/ns#" term="Size an Image Using CSS" /><category scheme="http://www.blogger.com/atom/ns#" term="DIV" /><category scheme="http://www.blogger.com/atom/ns#" term="Image Grid" /><category scheme="http://www.blogger.com/atom/ns#" term="overflow: hidden;" /><category scheme="http://www.blogger.com/atom/ns#" term="Float" /><category scheme="http://www.blogger.com/atom/ns#" term="Art" /><category scheme="http://www.blogger.com/atom/ns#" term="multiple class" /><category scheme="http://www.blogger.com/atom/ns#" term="overflow" /><category scheme="http://www.blogger.com/atom/ns#" term="Crop an Image Using CSS" /><title type="text">Building Image Grids: Size and Crop an Image Using CSS</title><content type="html">&lt;script type="text/javascript"&gt;$(window).load(function(){ $('#childjpg').cssBakeryCaption({'opacity':'0.4','center':true,'centerCaption':true,'round':true,'hide':true,'color':'white','bgcolor':'black'}); }); &lt;/script&gt;&lt;br /&gt;&lt;img alt="19th Century Watercolor over Pen and Brown Ink&amp;lt;br&amp;gt;&amp;lt;em&amp;gt;Portrait of a Child, 1840&amp;lt;/em&amp;gt;&amp;lt;br&amp;gt;[Sir Edwin Henry Landseer]&amp;lt;br&amp;gt;© 2011 Copyright www.cssbakery.com All Rights Reserved" id="childjpg" src="http://pics.cssbakery.com/pics/child.jpg" style="display: none;" /&gt;&lt;br /&gt;&lt;br /&gt;Sometimes you want to display an existing image in a different size and with a different crop, but without actually changing the image file itself.  For example if you are displaying a lot of images that reside on Flickr, you could consider making copies of all the images and editing those copies (e.g. using Photoshop) to resize and crop.  But that's a lot of work.  Instead, we can resize and crop the original images directly in the Browser using CSS.&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;RE-SIZING&lt;/h1&gt;&lt;br /&gt;The original image could be any size, so it's likely that we'll need to resize it to fit in with our page layout.  For example if we are laying out a grid of images we'll want to each image in the grid to be the same width and height.  Cropping, which we talk about below, can help, but if the image is large we don't want to just crop a small section of it.  Instead, we first want to scale the image to get as much of it as we can in our target rectangle, then we'll finish it off with a crop.  &lt;br /&gt;&lt;br /&gt;Scaling the image is pretty easy by setting the CSS width and height properties of the img tag.  But there is one trick here:  we never want to set both the width and height because then the image can be streched and distorted to meet the exact height and width we specify.  Instead, what we want to do is set only the width, or only the height, letting the other dimension be determined automatically, and thus preserving the original aspect ratio of the image.&lt;br /&gt;&lt;br /&gt;So one question we must answer for each image is:  Do we scale it by height, or by width?&lt;br /&gt;&lt;br /&gt;The answer depends on the aspect ratios of both the target rectangle, and the image.  Suppose our target rectangle has a height of 100px and a width of 150px, while the image we are displaying has a height of 200px and a width of 450px - the dimensions for the B/W composite image that appears below.  First lets consider what would happen if we scale the image width to be 150px in order to fit it into our target rectangle.&lt;br /&gt;&lt;br /&gt;That's a scaling factor of 1/3, so the height will also be multiplied by 1/3 and we'll end up with an image 150 pixels wide, but only 67 pixels in height.  Note that since we don't want to distort the image, we have to apply the same scaling factor of 1/3 to both the width and height.  But the resulting height of 67 pixels doesn't work since our target height is 100px. As you can see, our resized image got too small for our targeted window.  The blue area, which was supposed to be filled with the image, is empty.&lt;br /&gt;&lt;br /&gt;&lt;img alt="Scaling an Image" src="http://pics.cssbakery.com/pics/scalingdown.jpg" /&gt;&lt;br /&gt;So lets try scaling the image height to 100px instead.  That's a scaling factor of 1/2, so the width of the image gets reduced to 225px.  This is better since the image is still &lt;a href="http://pics.cssbakery.com/pics/cropwindow.jpg"&gt;large enough&lt;/a&gt; to fill our target rectangle.  Of course it's wider than our target, but we'll fix that by &lt;a href="http://pics.cssbakery.com/pics/cropwindow.jpg"&gt;cropping it&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Mathematically, the way to decide whether to scale the height or the width is to compute aspect ratios for both the target area and the image:&lt;br /&gt;&lt;pre&gt;A_Target = TargetWidth / TargetHeight&lt;br /&gt;A_Image  = ImageWidth / ImageHeight&lt;br /&gt;&lt;/pre&gt;Then compare them to decide whether to scale the image by height or width:&lt;br /&gt;&lt;pre&gt;if (A_Image &amp;gt; A_Target) then&lt;br /&gt;  scale image using height&lt;br /&gt;else&lt;br /&gt;  scale image using width&lt;br /&gt;&lt;/pre&gt;For the example discussed above, the calculations would be:&lt;br /&gt;&lt;pre&gt;A_Target = 150 / 100 = 3:2 = 1.5&lt;br /&gt;A_Image  = 450 / 200 = 9:4 = 2.25&lt;br /&gt;&lt;br /&gt;A_Image is greater than A_Target, so scale using height.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h1&gt;CROPPING&lt;/h1&gt;&lt;br /&gt;To crop the image, we need to have a parent element that we set to the height and width of the target rectangle.  The img tag is a child of this parent element.  To crop, we just set the overflow property of the parent to hidden (overflow: hidden).  If the scaled image is wider than the parent, this will crop off the right portion of the image.  If the scaled image is taller than the parent, it will crop off the lower portion of the image.&lt;br /&gt;&lt;br /&gt;To crop equally from all sides, we need to pull the image to the left (or up) relative to the parent.  We can do this with negative margins.  So let's say the scaled image is 20px wider than the parent.  If we set margin-left of the image to be -10px, it will pull the image 10px to the left without affecting the parent, and the crop will be centered.  If the scaled image is taller then the parent, then use a negative margin-top to achieve the same effect.&lt;br /&gt;&lt;br /&gt;&lt;div class="divider"&gt;&lt;/div&gt;&lt;br /&gt;Given these &lt;a href="http://pics.cssbakery.com/pics/child.jpg"&gt;two images&lt;/a&gt; of varying dimensions - one's vertical and &lt;a href="http://pics.cssbakery.com/pics/childv.jpg"&gt;taller&lt;/a&gt;, the other's got a horizontal layout that's &lt;a href="http://pics.cssbakery.com/pics/childh.jpg"&gt;wider&lt;/a&gt; - let's display them with the same dimensions (height and width the same) in an image grid using CSS:&lt;br /&gt;&lt;br /&gt;&lt;pre class="Blue"&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;.flickrgrid a {&lt;br /&gt;   height:275px;&lt;br /&gt;   width: 275px;&lt;br /&gt;   overflow: hidden;&lt;br /&gt;   float: left;&lt;br /&gt;   display: block;&lt;br /&gt;   margin-bottom: 25px;&lt;br /&gt;   }&lt;br /&gt;#image1 {&lt;br /&gt;   width: 275px;&lt;br /&gt;   }&lt;br /&gt;#image2 {&lt;br /&gt;   height: 275px;   &lt;br /&gt;   }&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div class="flickrgrid"&amp;gt;&lt;br /&gt;&amp;lt;a href="images/drawingv.jpg"&amp;gt;&amp;lt;img id="image1" src="images/drawingv.jpg"&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;a href="images/drawingh.jpg"&amp;gt;&amp;lt;img id="images/drawingh.jpg"&amp;gt;&amp;lt;/a&amp;gt; &lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;style type="text/css"&gt;.flickrgrid a {    height:275px;    width: 275px;    overflow: hidden;    float: left;    display: block;    margin-bottom: 65px;    } #image1 {    width: 275px;    } #image2 {    height: 275px;       } &lt;/style&gt;&lt;br /&gt;&lt;div class="flickrgrid"&gt;&lt;a href="http://pics.cssbakery.com/pics/childv.jpg"&gt;&lt;img id="image1" src="http://pics.cssbakery.com/pics/childv.jpg" /&gt;&lt;/a&gt;&lt;a href="http://pics.cssbakery.com/pics/childh.jpg"&gt;&lt;img id="image2" src="http://pics.cssbakery.com/pics/childh.jpg" /&gt;&lt;/a&gt; &lt;/div&gt;&lt;br /&gt;&lt;h1&gt;SAME EXAMPLE WITH LESS CSS&lt;/h1&gt;&lt;br /&gt;We can make the CSS more compact by using multiple classes.  The width and height will be set in only one place.  .window is made generic so that it can be used for a window of any dimension.  We are going to reduce the size of each image in the grid to 220 pixels down from 275 pixels that I used in the example above.  That'll give us extra room for right margin to separate the thumbnail images.&lt;br /&gt;&lt;br /&gt;&lt;pre class="Blue"&gt;.window1, .window1 .taller { width: 220px; }&lt;br /&gt;.window1, .window1 .wider  { height: 220px; }&lt;br /&gt;&lt;br /&gt;.window {&lt;br /&gt;   overflow: hidden;&lt;br /&gt;   display: block;&lt;br /&gt;   float: left;&lt;br /&gt;   margin-right:20px;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&amp;lt;a class="window window1" href="images/drawingh.jpg"&amp;gt;&lt;br /&gt;&amp;lt;img class="wider" src="images/drawingh.jpg"&amp;gt;&lt;br /&gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;a class="window window1" href="images/drawingv.jpg"&amp;gt;&lt;br /&gt;&amp;lt;img class="taller" src="images/drawingv.jpg"&amp;gt;&lt;br /&gt;&amp;lt;/a&amp;gt;&lt;/pre&gt;&lt;style type="text/css"&gt;.window1, .window1 .taller { width: 220px; } .window1, .window1 .wider  { height: 220px; } .window {    overflow: hidden;    display: block;    float: left;    margin-right:20px;    }   .mock { margin-bottom: 30px;     /*this says your children are floated but you will grow big enough to       contain them */    overflow: auto;} &lt;/style&gt;&lt;br /&gt;&lt;div class="mock"&gt;&lt;a class="window window1" href="http://pics.cssbakery.com/pics/childh.jpg"&gt;&lt;img class="wider" src="http://pics.cssbakery.com/pics/childh.jpg" /&gt;&lt;/a&gt;&lt;a class="window window1" href="http://pics.cssbakery.com/pics/childv.jpg"&gt;&lt;img class="taller" src="http://pics.cssbakery.com/pics/childv.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h1&gt;THREE IMAGE GRID&lt;/h1&gt;&lt;br /&gt;&lt;pre class="Blue"&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;.flickrgrid2 a {&lt;br /&gt;   height:150px;&lt;br /&gt;   width: 150px;&lt;br /&gt;   overflow: hidden;&lt;br /&gt;   float: left;&lt;br /&gt;   display: block;&lt;br /&gt;   margin-right: 15px;&lt;br /&gt;   margin-bottom: 25px;&lt;br /&gt;   }&lt;br /&gt;#image12 {&lt;br /&gt;   height: 150px;&lt;br /&gt;   }&lt;br /&gt;#image22 {&lt;br /&gt;   width: 150px;&lt;br /&gt;   }&lt;br /&gt;#image32 {&lt;br /&gt;   height: 150px;&lt;br /&gt;   }&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;div class="flickrgrid2"&amp;gt;&lt;br /&gt;&amp;lt;a href="images/drawingv.jpg"&amp;gt;&amp;lt;img id="image22" src="images/drawingv.jpg"&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;a href="images/pencils550x361.jpg"&amp;gt;&amp;lt;img id="image32" src="images/pencils550x361.jpg"&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;a href="images/drawingh.jpg"&amp;gt;&amp;lt;img id="image12" src="images/drawingh.jpg"&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;  &lt;/pre&gt;&lt;style type="text/css"&gt;.flickrgrid2 a {    height:150px;    width: 150px;    overflow: hidden;    float: left;    display: block;    margin-right: 20px;    margin-bottom: 65px;    } #image12 {    height: 150px;    } #image22 {    width: 150px;    } #image32 {    height: 150px;    } &lt;/style&gt;&lt;br /&gt;&lt;div class="flickrgrid2"&gt;&lt;a href="http://pics.cssbakery.com/pics/childv.jpg"&gt;&lt;img id="image22" src="http://pics.cssbakery.com/pics/childv.jpg" /&gt;&lt;/a&gt;&lt;a href="http://pics.cssbakery.com/pics/pencils550x361.jpg"&gt;&lt;img id="image32" src="http://pics.cssbakery.com/pics/pencils550x361.jpg" /&gt;&lt;/a&gt;&lt;a href="http://pics.cssbakery.com/pics/childh.jpg"&gt;&lt;img id="image12" src="http://pics.cssbakery.com/pics/childh.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h1&gt;USING WIDER CROPS&lt;/h1&gt;&lt;br /&gt;Next we change the example above to make the cropping window wider than it is tall.  So it will no longer be a square of 150px on each side.  Instead it will be 150px tall and 180px wide.  To do this we need to set the width of the a tags to be 180px, and then any images that need to be scaled by width, we will also set to be 180px wide.&lt;br /&gt;&lt;br /&gt;The only tricky part of this is that since we are changing the width of the cropping window, it could mean that some images that we were previously scaling by height, now need to be scaled by width.  This happens if the aspect ratio of the scaling window is now larger than the aspect ratio of the image.  &lt;br /&gt;&lt;br /&gt;In our example the aspect ratio of the cropping window is changing from 1 (150/150) to 1.2 (180/150).  If we had images with an aspect ratio of say 1.1, then we would have been scaling them by width and cropping a little off the bottom, and now we need to scale them by height and crop a little off the right.&lt;br /&gt;&lt;br /&gt;&lt;pre class="Blue"&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;.flickrgrid3 a {&lt;br /&gt;   height:150px;&lt;br /&gt;   width: 180px;&lt;br /&gt;   overflow: hidden;&lt;br /&gt;   float: left;&lt;br /&gt;   display: block;&lt;br /&gt;   margin-right: 3px;&lt;br /&gt;   margin-bottom: 25px;&lt;br /&gt;   }&lt;br /&gt;#image12c {&lt;br /&gt;   height: 150px;&lt;br /&gt;   }&lt;br /&gt;#image22c {&lt;br /&gt;   width: 180px;&lt;br /&gt;   }&lt;br /&gt;#image32c {&lt;br /&gt;   height: 150px;&lt;br /&gt;   }&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div class="flickrgrid3"&amp;gt;&lt;br /&gt;&amp;lt;a href="images/drawingv.jpg"&amp;gt;&amp;lt;img id="image22c" src="images/drawingv.jpg"&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;a href="images/pencils550x361.jpg"&amp;gt;&amp;lt;img id="image32c" src="images/pencils550x361.jpg"&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;a href="images/drawingh.jpg"&amp;gt;&amp;lt;img id="image12c" src="images/drawingh.jpg"&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;style type="text/css"&gt;.flickrgrid3 a {    height:150px;    width: 180px;    overflow: hidden;    float: left;    display: block;    margin-right: 3px;    margin-bottom: 25px;    } #image12c {    height: 150px;    } #image22c {    width: 180px;    } #image32c {    height: 150px;    } &lt;/style&gt;&lt;br /&gt;&lt;div class="flickrgrid3"&gt;&lt;a href="http://pics.cssbakery.com/pics/childv.jpg"&gt;&lt;img id="image22c" src="http://pics.cssbakery.com/pics/childv.jpg" /&gt;&lt;/a&gt;&lt;a href="http://pics.cssbakery.com/pics/pencils550x361.jpg"&gt;&lt;img id="image32c" src="http://pics.cssbakery.com/pics/pencils550x361.jpg" /&gt;&lt;/a&gt;&lt;a href="http://pics.cssbakery.com/pics/childh.jpg"&gt;&lt;img id="image12c" src="http://pics.cssbakery.com/pics/childh.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="divider"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="related_thumbnail" style="clear: both;"&gt;&lt;img alt="" src="http://pics.cssbakery.com/pics/gridrelatedicon.jpg" title="" /&gt;&lt;h4&gt;CSS Image Grids&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2011/05/css-image-grid-using-sprites_30.html"&gt;Grid Using  Sprites&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2010/07/image-grid-using-css-floats_6950.html"&gt;Grid Using CSS Floats&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2011/11/size-and-crop-image-using-css.html"&gt;Building Grids: Size and Crop an Image Using CSS&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-5791852962184539114?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/cTRbxD9eiig" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/5791852962184539114/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2011/11/size-and-crop-image-using-css.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/5791852962184539114" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/5791852962184539114" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/cTRbxD9eiig/size-and-crop-image-using-css.html" title="Building Image Grids: Size and Crop an Image Using CSS" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2011/11/size-and-crop-image-using-css.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-5324671256398794797</id><published>2011-07-04T20:32:00.000-07:00</published><updated>2011-09-04T19:48:32.113-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Life" /><title type="text">Happy 4th</title><content type="html">&lt;script type='text/javascript'&gt;
 $(window).load(function(){ $('#july4gif').cssBakeryCaption({'opacity':'0.5','center':true,'centerCaption':true,'round':true,'top':true,'hide':true,'color':'white','bgcolor':'#15157d'});
 });
 &lt;/script&gt;&lt;br /&gt;&lt;img id='july4gif' style='display:none;' src='http://pics.cssbakery.com/pics/july4.gif' alt='[Catalina 38]&amp;lt;br&amp;gt;&amp;copy; 2011 Copyright www.cssbakery.com All Rights Reserved'&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-5324671256398794797?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/ByWhj8dyaGY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/5324671256398794797/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2011/07/happy-july-4th.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/5324671256398794797" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/5324671256398794797" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/ByWhj8dyaGY/happy-july-4th.html" title="Happy 4th" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.cssbakery.com/2011/07/happy-july-4th.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-4843224028361594470.post-5049487614551867972</id><published>2011-05-30T14:27:00.000-07:00</published><updated>2011-11-11T21:57:36.647-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Background Property" /><category scheme="http://www.blogger.com/atom/ns#" term="GraublauWeb" /><category scheme="http://www.blogger.com/atom/ns#" term="Image Grid" /><category scheme="http://www.blogger.com/atom/ns#" term="Floating LI element" /><category scheme="http://www.blogger.com/atom/ns#" term="Sprite" /><category scheme="http://www.blogger.com/atom/ns#" term="Floating" /><category scheme="http://www.blogger.com/atom/ns#" term="Float" /><category scheme="http://www.blogger.com/atom/ns#" term="Background Positioning" /><category scheme="http://www.blogger.com/atom/ns#" term="Art" /><title type="text">CSS Image Grid Using Sprites</title><content type="html">&lt;div class="imggrid_display"&gt;&lt;ul class="imggrid"&gt;&lt;li&gt;&lt;a id="col1" href="#"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a id="col2" href="#"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a id="col3" href="#"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a id="col4" href="#"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a id="col5" href="#"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a id="col6" href="#"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a id="col7" href="#"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a id="col8" href="#"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a id="col9" href="#"&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Still Life&lt;/h2&gt;&lt;p&gt;© Copyright 2011 | www.cssbakery.com | All Rights Reserved&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;When we worked on a &lt;a href="http://www.cssbakery.com/2010/07/image-grid-using-css-floats_6950.html"&gt;CSS image grid&lt;/a&gt; last summer, I thought later I'd complete a second version using sprites to show you how that approach can improve performance.  I should make notes to myself about loose ends like that because somewhere along the way, I forgot about it.   Last week, an email about the original grid reminded me.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.cssbakery.com/2010/07/image-grid-using-css-floats_6950.html"&gt;grid post&lt;/a&gt; is popular, the sprite change is easy enough, so let's implement it.  By the way, the grid above is a real-time working example generated through HTML included within this post and styles that come from a style sheet. Each thumbnail is clickable but needs a URL assigned to its &lt;i&gt;a&lt;/i&gt; element before it'll take you somewhere.&lt;br /&gt;&lt;br /&gt;The thumbnail images are still life on black, which is a hobby of mine.  I had to crop some of them quite a bit in order to fit them here.  Images were saved in low resolution to speed up things for the web.&lt;br /&gt;&lt;br /&gt;I made a new copy of the old CSS styles just to keep things from tangling with each other.  Most of the code is recycled so for detailed explanations, see this previous &lt;a href="http://www.cssbakery.com/2010/07/image-grid-using-css-floats_6950.html"&gt;post&lt;/a&gt;.  I posted several times on &lt;a href="http://www.cssbakery.com/2009/06/shifting-background-image.html"&gt;sprites &lt;/a&gt;before if you need help to figure out what those are about.  &lt;br /&gt;&lt;br /&gt;Keep in mind that my space on the blog is limited to 550 pixels, you can adjust the width to fit your requirements and increase the number of columns of your grid as you wish.  You'll find the markup at the end of the CSS.  &lt;br /&gt;&lt;br /&gt;&lt;pre class='Blue'&gt;ul.imggrid {&lt;br /&gt;  padding: 0;&lt;br /&gt;  list-style: none;&lt;br /&gt;  margin: 0 auto;&lt;br /&gt;  width: 495px;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;.imggrid li {&lt;br /&gt;    float: left;&lt;br /&gt;    padding: 1px;&lt;br /&gt;    border: 1px solid #cbcad0;&lt;br /&gt;    margin: 0 5px 10px 5px;&lt;br /&gt;    } &lt;br /&gt;&lt;br /&gt;.imggrid_display {&lt;br /&gt;   padding: 20px;&lt;br /&gt;   margin: 0 auto;&lt;br /&gt;   width: 513px; &lt;br /&gt;   /*these two properties will be inherited by .portfolio h2 and .portfolio p */&lt;br /&gt;   font-family: 'GraublauWeb', arial, serif; &lt;br /&gt;   text-align: center;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  /* .post-body is only for those who are on Blogger, or all others please skip &lt;br /&gt;     it and write your selector as "div.imggrid_display h2" without the quotes&lt;br /&gt;  */&lt;br /&gt;  .post-body div.imggrid_display h2 {&lt;br /&gt;     padding: 0; margin: 0;&lt;br /&gt;     clear: both;&lt;br /&gt;     font-size: 35px;&lt;br /&gt;     font-weight: normal;&lt;br /&gt;     color: #58595b;&lt;br /&gt;     background: none;&lt;br /&gt;     font-family: 'GraublauWeb', arial, serif;  &lt;br /&gt;     /* reset for cascade effects that are trickling down to me &lt;br /&gt;       from other h2's &lt;br /&gt;    */&lt;br /&gt;     text-transform: none;&lt;br /&gt;     letter-spacing: normal;&lt;br /&gt;     }&lt;br /&gt;  &lt;br /&gt;  .imggrid_display p {&lt;br /&gt;      margin:0; padding: 0;&lt;br /&gt;      font-size: 15px;&lt;br /&gt;      color: #58595b;&lt;br /&gt;      }&lt;br /&gt;  &lt;br /&gt;/* sprites for imggrid */&lt;br /&gt;.imggrid a {&lt;br /&gt;    background: url('images/spritebitmaps.jpg') no-repeat;&lt;br /&gt;    height: 150px;&lt;br /&gt;    width: 150px;&lt;br /&gt;    display: block;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;/*sprites*/&lt;br /&gt;.imggrid a#col1 {background-position: 0 0;}&lt;br /&gt;.imggrid a#col2 {background-position:  -150px 0;}&lt;br /&gt;.imggrid a#col3 {background-position: -300px 0;}&lt;br /&gt;.imggrid a#col4 {background-position:  -450px 0;}&lt;br /&gt;.imggrid a#col5 {background-position:  -600px 0;}&lt;br /&gt;.imggrid a#col6 {background-position:  -750px 0;}&lt;br /&gt;.imggrid a#col7 {background-position:  -900px 0;}&lt;br /&gt;.imggrid a#col8 {background-position:  -1050px 0;}&lt;br /&gt;.imggrid a#col9 {background-position:  -1200px 0;}&lt;br /&gt;/* end sprites for imggrid */&lt;br /&gt;/* end imggrid block */      &lt;/pre&gt;&lt;br /&gt;Important note for the CSS: .post-body is only for those who are on Blogger, All others please skip it and write your selector as &lt;i&gt;div.imggrid_display h2 &lt;br /&gt;&lt;/i&gt;&lt;br /&gt;Fill in your own URLs for the a href's. The markup:&lt;br /&gt;&lt;br /&gt;&lt;pre class='Blue'&gt;&amp;lt;div class="imggrid_display"&amp;gt;&lt;br /&gt;&amp;lt;ul class="imggrid"&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a id="col1" href="#"&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a id="col2" href="#"&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a id="col3" href="#"&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a id="col4" href="#"&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a id="col5" href="#"&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a id="col6" href="#"&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a id="col7" href="#"&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a id="col8" href="#"&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;li&amp;gt;&amp;lt;a id="col9" href="#"&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;&amp;lt;h2&amp;gt;Still Life&amp;lt;/h2&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;© Copyright 2011 | www.cssbakery.com | All Rights Reserved&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;h1&gt;THE "SPRITE" FILE&lt;/h1&gt;&lt;br /&gt;All the images used in forming the grid reside in the same file avoiding multiple GETs which saves time and loads the page smoother. I did not leave any space between my images but for clarity and ease of edit, you might want to include at least a single line as a separator between yours.  &lt;br /&gt;&lt;br /&gt;&lt;img src="http://pics.cssbakery.com/pics/spritecapture.jpg"&gt;&lt;br /&gt;&lt;br /&gt;Since my images are each 150 pixels wide and stacked next to each other with no separator space, I shift the sprite file by a factor of 150 times the order of each image in the file to get to that image.  &lt;br /&gt;&lt;br /&gt;To give you an example, the red tulip is fifth in line so I multiply 150 by (5-1). I  subtracted 1 since we start counting from zero.  In other words, I have to shift the background image by 600 pixels to get to the tulip.   &lt;br /&gt;&lt;br /&gt;The background position x value is negative at -600 pixels because we want to pull the image to the left.  If it helps any, think of the negative x axis from school.  You are pulling the parts of the image that you don't want into that quadrant and showing only a portion of the remaining in the positive quadrant.  &lt;br /&gt;&lt;br /&gt;&lt;img src="http://pics.cssbakery.com/pics/spriteillustration.jpg" alt="Explaining Sprite Shifting in Background Image" title="Explaining Sprite Shifting in Background Image"&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;NTH CHILD OF CSS3&lt;/h1&gt;&lt;br /&gt;We can improve the CSS by including the nth-child construct from CSS3.  It will simplify both the CSS and the markup.  Off the top of my head, I couldn't tell you how widespread it's implemented in browsers, except that Firefox 3.5 and greater supports it and IE8 and below doesn't.  The fact that IE8 does not support it is a dealbreaker and the reason why we cannot use in official code yet.  There are still a lot of users running Windows XP, which does not support IE9. Anyway, I will show you how the nth child works in a separate post. &lt;br /&gt;&lt;br /&gt;&lt;div class="divider"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="related_thumbnail" style="clear: both;"&gt;&lt;img src="http://pics.cssbakery.com/pics/gridrelatedicon.jpg" alt="" title="" /&gt;&lt;h4&gt;CSS Image Grids&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2011/05/css-image-grid-using-sprites_30.html"&gt;Grid Using  Sprites&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2010/07/image-grid-using-css-floats_6950.html"&gt;Grid Using CSS Floats&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cssbakery.com/2011/11/size-and-crop-image-using-css.html"&gt;Building Grids: Size and Crop an Image Using CSS&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;br /&gt;&lt;h1&gt;AN IMAGE GRID FOR YOUR WALL&lt;/h1&gt;&lt;br /&gt;This has nothing to do with software but the idea is very similar to the grid that we just talked about with the only difference being where the images go - on a computer screen or  a wall. If you have a collection of pictures - with the proliferation of digital cameras who doesn't these days - you can print them on canvas with a wide format &lt;a href="http://www.amazon.com/Canon-Pro9000-Professional-Printer-9995A001/dp/B000J1HPK8/ref=sr_1_1?ie=UTF8&amp;qid=1306712457&amp;sr=8-1"&gt;printer&lt;/a&gt;. Once the prints are made, stretch them on ready-made canvas frames.  Arrange the finished pictures in a grid on a bare wall and surround the arrangement with a hollow but complete frame. No need for glass, matting, or mounting.  Finish it off with a picture light. &lt;br /&gt;&lt;br /&gt;&lt;img src="http://pics.cssbakery.com/pics/frameg.jpg" alt="Grid on a Wall"&gt;&lt;br /&gt;&lt;div class="credits"&gt;Images and Text © Copyright 2011 &lt;a href="www.cssbakery.com"&gt;cssbakery.com&lt;/a&gt;&lt;br /&gt;Brass Picture Light Image © Copyright &lt;a href="http://www.gracioushome.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&amp;storeId=10001&amp;catalogId=10051&amp;productId=12647&amp;sideBarCatId=10007"&gt;Gracious Home&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4843224028361594470-5049487614551867972?l=www.cssbakery.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CssBakery/~4/EGcAeZwwV8c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.cssbakery.com/feeds/5049487614551867972/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.cssbakery.com/2011/05/css-image-grid-using-sprites_30.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/5049487614551867972" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4843224028361594470/posts/default/5049487614551867972" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CssBakery/~3/EGcAeZwwV8c/css-image-grid-using-sprites_30.html" title="CSS Image Grid Using Sprites" /><author><name>CSSBakery</name><uri>http://www.blogger.com/profile/08756544695899161347</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="25" src="http://3.bp.blogspot.com/_qQrgdfPSZXY/TOUrojlptOI/AAAAAAAAAGQ/_upyBlenIrM/s1600-R/ilovemyboat.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.cssbakery.com/2011/05/css-image-grid-using-sprites_30.html</feedburner:origLink></entry></feed>

