Style Sheets
  Home arrow Style Sheets arrow Page 3 - 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 
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 - The Code


    (Page 3 of 5 )

    The Code

    For the most part, I'm going to use the same code I did for the CSS tabs. I will only make note of where the changes are. If you need an explanation of anything not noted, it's most likely in the previous article.

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

    <div id="everything">

    So this time I'm wrapping everything in one div, appropriately named 'everything'. This is so that I can set it to the same width as the image we created, and all the child nodes to inherit the width, without having to set them individually.

    <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
    %>

    This time you'll notice a couple extra items. I inserted the images into each tab, on the left and right. I also added in two divs below. One is for the bottom corners, and the actionPanel is the main panel, where we'll tile the center slice, and where you'll put all the elements and functional pieces of the page.

    </div>
    <div id="actionPanel">stuff to do</div>
    <div id="btm"></div>
    </div>

    More Style Sheets Articles
    More By Justin Cook


       · 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

    - Building Clean Drop-Down Menus with CSS
    - 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






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