Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: css designer

  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    css designer

    I have downloaded css designer to make css tabs.

    if i use <li id="current"><a href="Home.asp"><span>Home</span></a></li>
    it means that on home.html the css tab will have a different look.
    Now the easy way to do the same with other links is to put <li id="current"> on each link on different page.

    But i dont want to do that as i use header.inc file to include the navigation. Due to that i had to delete id="current" otherwise the home.asp tab would be in different color all the time.
    my question is, how can i do in css so that if i click home.asp, the tab will be in different color or if i go to products.asp the tab will also stay in differnet color?

    this is the code that css designer makes:
    Code:
       #tabs6 {
          float:left;
          width:100%;
          background:#efefef;
          font-size:93%;
          line-height:normal;
              border-bottom:1px solid #666;
          }
        #tabs6 ul {
              margin:0;
              padding:10px 10px 0 50px;
              list-style:none;
          }
        #tabs6 li {
          display:inline;
          margin:0;
          padding:0;
          }
        #tabs6 a {
          float:left;
          background:url("tableft6.gif") no-repeat left top;
          margin:0;
          padding:0 0 0 4px;
          text-decoration:none;
          }
        #tabs6 a span {
          float:left;
          display:block;
          background:url("tabright6.gif") no-repeat right top;
          padding:5px 15px 4px 6px;
          color:#FFF;
          }
        /* Commented Backslash Hack hides rule from IE5-Mac \*/
        #tabs6 a span {float:none;}
        /* End IE5-Mac hack */
        #tabs6 a:hover span {
          color:#FFF;
          }
        #tabs6 a:hover {
          background-position:0% -42px;
          }
        #tabs6 a:hover span {
          background-position:100% -42px;
          }
    
          #tabs6 #current a {
                  background-position:0% -42px;
          }
          #tabs6 #current a span {
                  background-position:100% -42px;
          }

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    This is how you would do it with php
    http://bonrouge.com/~current2
    Not sure about asp. Maybe this will help
    http://www.coveryourasp.net/DozingDogs/IncludedMenus
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    You could stick with the "id='current'" method you've got going in ASP. On each page, you would start off with something like this:

    Code:
    <% currentPage = "about" %>
    <!--#include virtual="/includes/header.inc" -->
    Then in the header, where your nav lives, you would use something like this to assign the current id to the right list item:

    Code:
    <ul>
       <li <% if currentPage = "home" then response.write("id='current'") %>><a href="home.asp">Home</a></li>
       <li <% if currentPage = "about" then response.write("id='current'") %>><a href="about.asp">About Us</a></li>
       <li <% if currentPage = "contact" then response.write("id='current'") %>><a href="contact.asp">Contact</a></li>
    </ul>
    I don't know much ASP so there might be a fancier way but this should work.

  • #4
    New Coder
    Join Date
    Aug 2005
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i tried that, but then the home.asp tab stays in different color even when i click the about.asp page. Acutally both home and about pages then have same color.

  • #5
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    You're going to need to link to your page or show some HTML; what you've posted above (CSS only) isn't enough.

  • #6
    New Coder
    Join Date
    Aug 2005
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry

    Code:
    <div id="tabs6">
    <ul>
    <li><a href="<%=urlNonSSL%>default.asp"><span><%=LangText("GenHome","")%></span></a></li>
    <li><a href="<%=urlNonSSL%>prodList.asp"><span><%=LangText("GenAllCategories","")%></span></a></li>
    <li><a href="<%=urlNonSSL%>contactUs.asp"><span><%=LangText("GenContactUsHdr","")%></span></a></li>
    </ul></div>
    Thing is that this page is named INC_Template.asp. This file is a page from Candypress asp store that im using.
    this page is actually a template that is used on complete store and it's the only page that needs to be fixed if i want to change the look of my site ( design, banners, etc.)....beside css of course .

    file is also included on all pages such as prodlist.asp, prodview.asp etc so that the site runs properly.

    So maybe this could be the reason why above code is not running??

  • #7
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    I don't understand. Where's the part that adds "id='current'"? Did you try the code or suggestions out?

  • #8
    Regular Coder
    Join Date
    Apr 2007
    Location
    U.S.A
    Posts
    129
    Thanks
    1
    Thanked 0 Times in 0 Posts
    k I don't know asp, but I guess your using something like the include file. I had the same problem once. All I did was make a variable on the pages
    pagevar=home
    then in the header with the css included I made a switch so that it would include the curent id in the div only if the page var was true. I'm not a good coder as I do it on and off for fun, so I'm sure if you use some links you will find a better solution.


    Joe


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •