Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Highlight Current Page's Tab

Posted on 2009-04-07
8
Medium Priority
?
1,162 Views
Last Modified: 2012-05-06
Hi experts,

I am developing a project in ASP.NET using Visual Web Developer 2008 Express Edition. I have a tab menu which works perfect. I would like for a tab to stay orange while on the page that the tab links to. For example, when on Default.aspx, I would like Home tab to be highlighted. Is there any way to do that? I am using Master page. It would be easy if I didn't.

Please use IE to look at this page. It doesn't display quite right in FF.

http://www.titanmusicstore.com

Thank you.
0
Comment
Question by:Yury Merezhkov
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 4

Accepted Solution

by:
iDeej earned 2000 total points
ID: 24092190
in the home page you could give the body tag an id="home" and then give all your tabs id's as well E.G. id="tabHome"

The write this CSS

#home #tabhome {
  background: /*set to orange background*/;
}

because the home page is the only page that has id = home in the body tag it is the only page that this style will effect.

You can then go and do it with all other pages <body id="catalog"> for the catalog page etc.

0
 
LVL 9

Expert Comment

by:Ramanhp
ID: 24092257
<style>
span.col2 {
        margin-left: 10em;
 width:100px;
}
 
span.col3 {
        margin-left: 10em; width:100px;
 
}
 
span.col4 {
        margin-left: 10em; width:100px;
 
}
 
 
div.row {
overflow: auto;
font-weight: bold;
width: 100%;
float: left;
padding-top: 5px;
padding-left: 0px;
padding-bottom: 5px;
padding-right: 0px
}
</style>
 
<div class="row">                      
Item One                        
<span class="col2">
Item Two
</span>
<span class="col3">
Item Three
</span>
<span class="col4">                            
Item Four
</span>
</div>
                       
<div class="row">
Item Five                      
<span class="col2">                    
Item Six                                                
</span>
<span class="col3">
Item Seven
</span>
<span  class="col4">                    
Item Eight
</span>
</div>
0
 
LVL 9

Expert Comment

by:Ramanhp
ID: 24092267
oh sorry, please ignore my reply, got pasted in the wrong window

Thanks
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 7

Author Comment

by:Yury Merezhkov
ID: 24092303
Thank you! But I have a master page. I don't have body tags on each page. Just on the master page.
0
 
LVL 4

Expert Comment

by:iDeej
ID: 24092532
I've not used ASP but is there a way you can dynamically set an id to a containing element or set class="tabOn" in a li of you navigation?
0
 
LVL 7

Author Comment

by:Yury Merezhkov
ID: 24093666
This is my first website in ASP .NET. I don't know :) I'll continue researching.
0
 
LVL 7

Author Comment

by:Yury Merezhkov
ID: 24119153
iDeej, thanks man! I figured out how to assign id's dynamically and used CSS that you provided. It works. Check it out :)
0
 
LVL 7

Author Closing Comment

by:Yury Merezhkov
ID: 31567778
Great solution!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question