Archive for the ‘Uncategorized’ Category

h1

IE Style Tabs in Html

February 13, 2008

Lot of web applications I’ve worked with have some kind of navigation that is implemented as Tabs. When I first started using tabs in Web Apps, I implemented them in tables, with the left hand side image of the tab in one cell, the middle part in another cell and the right hand side of the tab image in another cell.

That was before I discovered the beauty of CSS. The last few years I have been evangelising table-less design to every project/client that I go to and pretty much wherever I go, I take my “Tab” design with me. I cannot claim any originality to it, though. I first read about the Sliding door technique at “A LIST apart” a few years ago and I’ve been using it ever since.

Here is my implementation of it that resembles the IE 7.0 style tabs.

image

To do this, I created 6 images -

Image Description
tab-background tab-background.png: The background on which the tabs are present
tab-left tab-left.png: The left side of an unselected tab
tab-right tab-right.png: The right side of an unselected tab
current-tab-left current-tab-left.png: The left side of the selected tab
current-tab-right current-tab-right.png: The right side of the selected tab
hover-tab hover-tab.png: The image when you hover the mouse over the tab

The html markup used to define the tabs is a very simple unordered list -


<div id="primaryNavigation">
    <li><a href="#">Tab One</a></li>
    <li id="current"><a href="#">Tab Two</a></li>
    <li><a href="#">Tab Three</a></li>

    <li><a href="#">Tab Four</a></li>

</div>

The markup is simple, because all the presentation information is present in the css file:


body
{
    background:#fff;
    margin:0;
    padding:0;
    color:#000;
    font:10pt Tahoma, Helvetica, sans-serif;
}
#primaryNavigation {
  float:left;
  width:100%;
  background: url( 'Images/tab-background.png' )
		repeat-x 100% bottom;

}
#primaryNavigation ul {
    margin: 0;
    padding: 2px 10px 0px 3px;
    list-style: none;
    height: 36px;
}
#primaryNavigation li {
    float: left;
    background: url('Images/tab-left.png' )
		no-repeat left top;
    padding: 0px 0px 0px 3px;
    height: 36px;
}
#primaryNavigation a {
    float: left;
    background: url('Images/tab-right.png' )
                no-repeat right top;
    padding: 6px 15px 0px 6px;
    text-decoration: none;
    color: black;
    white-space: nowrap;
    height: 36px;
}
#primaryNavigation a:hover {
    color: black;
    background: url('Images/hover-tab.png' )
                no-repeat right top;
  }
#primaryNavigation #current {
    background:url('Images/current-tab-left.png' )
		no-repeat left top;
    float: left;
    margin: 0;
    padding: 0px 0px 0px 2px;
    height: 36px;
  }
#primaryNavigation #current a {
    background-image: url('Images/current-tab-right.png' );
    color: black;
    white-space: nowrap;
    height: 36px;
    padding: 6px 15px 0px 6px;
}

Pretty simple, huh? This should work in most browsers, although I’ve tested in only on ID 7.0.

h1

Reporting Services Tips and Tricks

October 14, 2007

Here is the link to the presentation I gave at Wagga Wagga. During the presentation I promised to upload a few relevant links. I’ll be doing the uploads in a couple of days, so watch this space…

h1

Whinges about InfoPath 2007

May 31, 2007

InfoPath 2007 is great. But I have a few gripes about it -

  • When I tried to set a data connection to a WCF service, it only accepts HttpBasicBinding
  • If the web service has complex types as parameters, passing values to it is not trivial
  • Absence of a label control (that renders as a span, maybe)? I could then set properties like conditional formatting to it.
h1

Twitter

May 29, 2007

I signed up to twitter recently. This seems to be far easier to do than blogging. Wonder how successful it is going to get.

h1

Blogger’s block

March 16, 2007

I wonder if any bloggers face the equivalent of a writers block - Not being able to come up with material they consider blog worthy? I seem to have no problem blogging about cricket, but the technical stuff - that is a completely different story…

h1

Office Ultimate 2007 for 75 bucks!

February 28, 2007

It is true. But you have to be a Uni student in Australia.

Here is the link - http://www.itsnotcheating.com.au/

No, it is not a hoax. How can you be sure? Check with Microsoft!

http://www.microsoft.com/australia/education/unistudentoffer/default.mspx

h1

A new beginning!

January 31, 2007

A new year, A new job and a new blog!!! I’ve just joined Readify in the new year and like the rest of the gang there, have decided to blog. I am not new to blogging, just that my last three attempts died without any regular posts :)

I am hoping this one lasts…So, wish me luck!