Style Sheets
  Home arrow Style Sheets arrow Page 5 - 3D Tabs with CSS2
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE SHEETS

3D Tabs with CSS2
By: Justin Cook
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 9
    2004-08-17

    Table of Contents:
  • 3D Tabs with CSS2
  • The Images
  • The Code
  • The Style
  • Conclusion and All the Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    3D Tabs with CSS2 - Conclusion and All the Code


    (Page 5 of 5 )

    The Conclusion

    Now there are two important things I feel I must mention. The first is that this has only been tested in Internet Explorer (I know, slap my wrists). It may need a little tweaking of the CSS to get it to display perfectly in Mozilla or Opera. Feel free to post any findings you make in this regard.

    You've also probably noted that by doing things this way -- creating one image for the bottom, middle, and top –- we are limiting ourselves to the width of the image. This doesn't work well if you have more tabs than can fit in that width, or just lot's of lateral content. For these situations, you'd want to slice it up even more, and created an expandable center area, and image slices for all corners and edges that can adjust accordingly.

    Other than that, you should be able to make great use of (and extend) this structure in your web application. Feel free to suggest any improvements that you've made!

    All the code:

    <style>

    #everything {
      padding: 0px;
      margin: 4px;
      height: 100%;
      min-height: 800px;
      width: 900px;
    }

    #navTabs {
      padding: 0px 0px 0px 15px;
      margin: 0px;
      width: 100%;
      background: url("top.png") no-repeat top;
      height: 45px;
      vertical-align: top;
    }

    .tabon, .taboff {
      height: 45px;
      cursor: pointer;
      cursor: hand;
      display: inline;
      overflow: hidden;
      vertical-align: top;
    }

    .tabOn {
      background-image: url("on_m.png");
      font-weight: bold;
    }

    .taboff {
      background-image: url("off_m.png");
      color: #666666;
    }

    .tabItem {
      vertical-align:top;
      height: 45px;
      display:inline;
      font-size: 11px;
      margin: 10px 0px 0px 0px;
    }

    #actionPanel {
      width: 100%;
      height: 70%;
      padding: 10px;
      background: url("mid.png");
    }

    #btm {
      height: 16px;
      background: url("bottom.png");
    }
    </style>

    <%
    dim arTabs( 5 )
    arTabs( 0 ) = "home"
    arTabs( 1 ) = "events"
    arTabs( 2 ) = "news"
    arTabs( 3 ) = "photos"
    arTabs( 4 ) = "users"
    arTabs( 5 ) = "admin"
    %>

    <div id="everything">
    <div id="navTabs">

    <%
    dim theClass, thisPage

    thisPage = Request.ServerVariables("SCRIPT_NAME")
    thisPage = replace( right( thisPage, len( thisPage ) - inStrRev( thisPage, "/" ) ), ".asp", "" )

    for i = 0 to uBound( arTabs)
    if thisPage = arTabs(i) or left( thisPage, len( arTabs(i) ) ) = arTabs(i)
      then
        theClass = "on"
      else
        theClass = "off"
    end if

    response.Write("<div class=""tab" & theClass & """ onclick=""javascript:window.location='" & arTabs(i) & ".asp'"">")

    Response.Write("<img src=""" & theClass & "_l.png"" />")

    Response.Write("<div class=""tabItem""><img src=""" & arTabs(i) & ".gif"" align=""absmiddle"" />&nbsp;")

    Response.Write( replace( arTabs(i), "_", " " ) & "</div>" )

    Response.Write("<img src=""" & theClass & "_r.png"" /></div>" & vbCrLf)

    next
    %>

    </div>


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · I don't mean to be too critical, but what on Earth do you mean that it has been...
       · Is there a working example of this?On page 1 of the article (at...
       · completely agree! If you are going to write such articles (especially on css), then...
       · not testing in non-ie browsers? shame on you. you shouldnt call it an article if you...
       · Hi all,Thanks to a very knowledgable person from another forum (i won't name...
       · As for doing this without javascript, you can remove the onClick for the div and put...
       · This asp code doesn't work if your on a page that is not included in the array. This...
       · i should of read the whole article...sorry
       · First of all, stop calling the author "lazy". The guy has written 12 articles for...
       · The real funny thing is this.... These people are all calling the author lazy, but...
     

    STYLE SHEETS ARTICLES

    - Creating Hybrid Web Page Layouts with Negati...
    - Creating Three-Column Web Page Layous with N...
    - Swapping Column Positions in Web Page Layout...
    - Creating Web Page Layouts with Negative Marg...
    - Creating Gradients for Individual Containers...
    - Creating Gradients for Web Page Headers with...
    - SEO Scrolling Frames Problem Solved
    - Building Cross-Browser Background Effects wi...
    - CSS: Pseudo
    - Using PNG Images to Build Background Effects
    - CSS: Continuing the Clarification of CSS Cla...
    - CSS: Top Secret Classification
    - CSS: Dimensions
    - CSS: Margins and Padding
    - CSS: Crossing the Border






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT