在导航中显示活动页面 [英] Display active page in Navigation

查看:79
本文介绍了在导航中显示活动页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Expressions Web2的新手,我正在尝试在导航栏中显示活动页面。我从Expressions web2开始使用一个模板,并做了很多修改。我已经研究了几个小时并尝试了几件事,但似乎无法使其发挥作用。

我曾尝试过上一篇文章,但它对我的页面不起作用。它读作:
"你不需要使用身体标签。将ID分配给DWT菜单中的链接本身,然后在每个页面中将一个部分放在< head>中。设置链接ID的方式与默认值不同。拥有一个样式表并不方便,但你基本上是将一个简短的样式部分复制并粘贴到每个新页面,并编辑链接ID,这不是太糟糕。

I am new to Expressions Web2 and am trying to display the active page in the Navigation bar as highlighted.  I started with a templete from the Expressions web2 and made many modification.  I've reseached for hours and tried several things but can't seem to make it work. 

There was a previous post that I tried but it didn't work for my page.  It read:
"You don't need to use the body tag.  Assign ids to the links themselves in the menu in the DWT, then, in each page, put a section in the <head> to style that link id differently from the default. not as convenient has having one stylesheet, but you'd be basically copying and pasting a short style section to each new page, and editing the link id, which isn't too bad.

例如:在DWT中,假设您有一个导航部分,如:

As an example: In the DWT, say you have a navigation section like:

< div class =" navline">
< UL>
< li>< a id =" home" HREF =" ../的index.htm">家庭和LT; / A>< /锂>
< li>< a id =" about" href =" about.htm">关于我们< / a>< / li>
< li>< a id =" calendar" HREF =" ../ section_calendar / calendar.htm">日历< / A>< /锂>
< li>< a id =" news" HREF =" ../ section_news / news.htm">通讯及LT; / A>< /锂>
< / UL>
< / DIV>

<div class="navline">  
<ul> 
    <li><a id="home" href="../index.htm">Home</a></li>  
    <li><a id="about" href="about.htm">About Us</a></li>  
    <li><a id="calendar" href="../section_calendar/calendar.htm">Calendar</a></li>  
    <li><a id="news" href="../section_news/news.htm">Newsletters</a></li>             
</ul> 
</div> 

在< head>中的可编辑部分页面区域,例如,"about.htm",您必须:

In an editable section in the <head> area of page, say, "about.htm", you'd have:

< style type =" text / css">
a#about {
background-color:#DCE78D;
}< / style>

当您在页面上"about.htm"时,链接< a> id =" about"将具有突出显示的背景颜色。

我的DWT具有以下导航:

<! - 开始侧边栏 - >
< div ID = QUOT;侧边栏" style =" left:-1px;顶部:0px">
< ul>
< li>< a href =" index.html">主页< / a>< / li>
< ; li>< a href =" custom_reports / custom_reports.htm">自定义报告< / a>< / li>
< li>< a href =" consulting / consulting.htm" >咨询< / a>< / li>
< li>< a href =" services_reminders / services_reminders.htm">服务提醒< / a>< / li>

< li>< a href =" about / about.htm">关于我们< / a>< / li>
< li>< a href =" contact / contact.htm" ;>联系我们< / a>< / li>
< / ul>
< / div>
<! - 结束侧边栏 - >

这个明确的建议是否有效,因为我使用的是" div id"而不是"dic类"而不是"dic类"。如建议的代码?

我也通过 http://阅读www.hicksdesign.co.uk/else/cssnav/products.html 用于为身体标签添加唯一ID .....对我来说很困惑。

有没有更简单的方法在不编写代码的情况下执行此操作?

感谢

<style type="text/css">  
a#about {  
    background-color: #DCE78D;  
}  
</style>  

Whenever you were on page "about.htm", the link <a> with id="about" would have the highlighting background color.

My DWT has the following for the navigation:

<!-- Begin Sidebar -->
  <div id="sidebar" style="left: -1px; top: 0px">
   <ul>
    <li><a href="index.html">Home</a></li>
    <li><a href="custom_reports/custom_reports.htm">Custom Reports</a></li>
    <li><a href="consulting/consulting.htm">Consulting</a></li>
    <li><a href="services_reminders/services_reminders.htm">Service Reminders</a></li>
    <li><a href="about/about.htm">About Us</a></li>
    <li><a href="contact/contact.htm">Contact Us</a></li>
   </ul>
  </div>
  <!-- End Sidebar -->

Is the prvious suggestion not working because my I am using an " div id" instead of a "dic class" as in the suggested code?

I've also read through http://www.hicksdesign.co.uk/else/cssnav/products.html for adding unique IDs to the body tags.....confusing to me.

Is there an easier way to do this without writing code?

Thanks

推荐答案

如果您的代码与上面显示的相同,则无效。你没有按照指令在每个链接中输入一个id。如果您没有要引用的ID,则特定于页面的样式不代表任何内容。

您创建的特定样式还取决于链接的样式。背景颜色变化只是一种效果的一个例子。
It's not working if your code is as you have it shown above.  You did not follow the instruction to put an id in each link.  If you don't have an id to reference, the page-specific style means nothing.

The specific style you would create would also depend on how your links are styled.  Background color change is just an example of one effect.


这篇关于在导航中显示活动页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆