Showing posts with label Code Shot. Show all posts
Showing posts with label Code Shot. Show all posts

Wednesday, October 6, 2010

Code Shot - hCard Template


In this Code Shot post, I'll provide a sample template that I've used in the past for marking up and styling address information in the hCard microformat.

Html Template

<div class="vcard">
<a class="fn org url" href="http://randomactsofcoding.blogspot.com">Random Acts of Coding</a>
<div class="adr">
<div class="street-address">123 Any Street</div>
<span class="locality">Some Town</span>
<abbr class="region" title="Missouri">MO</abbr>
<span class="postal-code">12345</span>
<div class="country-name">USA</div>
</div>
<div class="tel">
<span class="type">Work</span> <a rel="nofollow" href="tel:1234567890">123-456-7890</a>
</div>
<div class="tel">
<span class="type">Mobile</span> <a rel="nofollow" href="tel:0987654321">098-765-4321</a>
</div>
<div>Email:
<span class="email">name@domain.com</span>
</div>
</div>


CSS Template for the Html

div.vcard
{
margin:5px;
font-size:0.6em;
}

div.vcard .url
{

}

div.vcard .org
{

}

div.vcard .fn
{

}

div.vcard .adr
{

}

div.vcard .adr .street-address
{

}

div.vcard .adr .locality
{

}

div.vcard .adr .region
{

}

div.vcard .adr .postal-code
{

}

div.vcard .adr .country-name
{

}

div.vcard .tel
{

}

div.vcard .tel a
{
text-decoration:none;
color:Black;
cursor:default;
}

div.vcard .email
{

}


Example
Random Acts of Coding
123 Any Street
Some Town MO 12345 USA
Mobile: 098-765-4321
Email:

Additional Resources




Thursday, September 30, 2010

Code Shot – Doctypes


First Quick Code Shot…less talk; more code.

Xhtml 1.0 Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Xhtml 1.0 Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Html 4.01 Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Html 4.01 Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Html 5
<!DOCTYPE html >
There are others; however, these are the primary ones that I either use or have seen a decent amount in the wild.

-J

Wednesday, September 29, 2010

A New Format Coming

I'll admit, I've been pretty lax on my blogging as of late.  This has been due to a number of reasons / excuses that I won't bore you with.  Regardless, it's a part of my life that I'm working on getting back into the habit with.

One issue that I always had with blogging was the time aspect.  A commentary post would take me 2-4hrs to write and post while a code one could take me 8-24hrs depending on the size and depth of the material.

Starting this week, a new format of code-related posts will begin to trickle onto this blog.  I'm dubbing these Code Shots since they are going to be terse and more focused on the code them the blocks of text surrounding them.  This format makes a lot more sense when you 1) the samples are simple and short and 2) most of the people who read this blog can read code.

Expect some Code Shots on topics ranging from Html5 to JavaScript and even inter-language interop.

Stay Tuned!

- J