04 May 2007

Really easy CSS Menu


When you start creating your website your first thought when it comes to the menu is to use a table.

Well, you can create a table for the menu, there's nothing wrong with that, but using tables isn't always the best choise.

So, this is an example where I'm using an unordered list (ul), to create my menu:


 <div id="MenuListContainer">
<ul>
<li><a href="#">Home Page</a></li>
<li>|</li>
<li><a href="#">Resources</a></li>
<li>|</li>
<li><a href="#">Webmasters</a></li>
<li>|</li>
<li><a href="#">Terms</a></li>
<li>|</li>
<li><a href="#">About</a></li>
<li>|</li>
<li><a href="#">Contact</a></li>
</ul>
</div>



As you can see, using the unordered list become more easily to deploy and configure your menu.


The CSS styles to use are the following:

<style type="text/css" media="screen">
div#MenuListContainer {
width: auto;
height: auto;
text-align: left;
vertical-align: top;
margin: 0px 0px 0px 0px; /* T R B L */
padding: 0px 0px 0px 0px; /* T R B L */
}

div#MenuListContainer ul {
display: inline;
list-style-type: none;
margin: 0px 0px 0px 0px; /* T R B L */
padding: 5px 5px 5px 5px; /* T R B L */
background-color: #eeeeee;
}

ul li {
display: inline;
margin: 0px 0px 0px 0px; /* T R B L */
padding: 5px 5px 5px 5px; /* T R B L */
font-family: Georgia, Serif;
font-size: 10pt;
color: #000000;
text-align: center;
line-height: 1.6em;
}

li a:link {
color: #000000;
text-decoration: none;
}
li a:visited {
color: #696969;
text-decoration: none;
}

li a:hover {
color: #8b0000;
text-decoration: none;
}
</style>


And this is how it looks in IE7:


02 May 2007

Light Up the Web




Last night I watched Scott Guthrie (General Manager @ Microsoft) and Ray Ozzie (Chief Software Architect @ Microsoft) presenting Silverlight.
That was a 2 & 1/5 hours of interesting material about this new technology that Microsoft just released.

"In an address from Las Vegas at the MIX07 Web conference, Chief Software Architect Ray Ozzie and Developer division General Manager Scott Guthrie will discuss the full breadth of Microsoft’s developer vision and roadmap for Silverlight, Microsoft’s cross-platform application for delivering the next generation of media experiences."

"Microsoft® Silverlight™ is a cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web. Silverlight offers a flexible programming model that supports AJAX, VB, C#, Python, and Ruby, and integrates with existing Web applications. Silverlight supports fast, cost-effective delivery of high-quality video to all major browsers running on the Mac OS or Windows."

If you are interested in watching that movie too, this is the link to it. Enjoy!
And there is more:
- Silverlight home page
- Silverlight Community Site
- Get started with Silverlight
- Microsoft's executives webcasts

01 May 2007

Transforming a Div into a Table


I've seen a lot of people debating about tables and divs. Some of them are saying to use tables and not divs and vice-versa.
Now, I'm showing you an example of how you can transform a div into a table.

Note that this example doesn't work in IE7 (IE7 is messing it badly), but it works in Firefox just great.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Transforming a Div into a Table</title>

<style type="text/css" media="screen">

div.table { display: table;}
div.row { display: table-row; }
div.cell { display: table-cell; width: 100px; }
div.caption { display: table-caption; caption-side: top; text-align: right; }

div.c1 { text-align: right; background-color: #eeeeee; }
div.c2 { text-align: center; }

div.TableHeaderGroup { display: table-header-group; color: Red; }
div.TableRowGroup { display: table-row-group; font-style: italic; }
div.TableFooterGroup { display: table-footer-group; color: Blue; }

</style>
</head>

<body>

<div class="table">

<div class="caption">Table caption</div>

<div class="TableHeaderGroup">
<div class="row">
<div class="cell c1">Cell 1</div>
<div class="cell c2">Cell 2</div>
</div>
</div>

<div class="TableRowGroup ">
<div class="row">
<div class="cell c1">Cell 1</div>
<div class="cell c2">Cell 2</div>
</div>
</div>

<div class="TableFooterGroup">
<div class="row">
<div class="cell c1">Cell 1</div>
<div class="cell c2">Cell 2</div>
</div>
</div>

</div>


</body>
</html>