Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在ASP.net中将边框添加到所选菜单项_Asp.net_Css - Fatal编程技术网

如何在ASP.net中将边框添加到所选菜单项

如何在ASP.net中将边框添加到所选菜单项,asp.net,css,Asp.net,Css,在my.aspx文件中,分别有5个菜单项和5个视图。我想在下面解释的是: 页面加载视图1将被启用,并且菜单项1上将有一个底部边框。 如果单击MenuItem2,则会显示View2,MenuItem2上会有一个底部边框。同样的事情也会发生在其他菜单项和视图上 这是我的.aspx文件: <div class="courseoptions"> <asp:Menu ID="Menu1" Orientation="Horizontal" StaticMenuIt

在my.aspx文件中,分别有5个菜单项和5个视图。我想在下面解释的是: 页面加载视图1将被启用,并且菜单项1上将有一个底部边框。 如果单击MenuItem2,则会显示View2,MenuItem2上会有一个底部边框。同样的事情也会发生在其他菜单项和视图上

这是我的.aspx文件:

<div class="courseoptions">

            <asp:Menu ID="Menu1" Orientation="Horizontal" StaticMenuItemStyle-HorizontalPadding="30px"  runat="server" OnMenuItemClick="Menu1_MenuItemClick" CssClass="menucolor" ForeColor="Black">
                <StaticSelectedStyle ForeColor="#15904D" BorderStyle="Outset" BorderWidth="2px" BorderColor="#11A15D" />
               <Items>
                   <asp:MenuItem Text="OVERVIEW" Value="0" Selected="true" ></asp:MenuItem>
                   <asp:MenuItem Text="SYLLABUS" Value="1"></asp:MenuItem>
                   <asp:MenuItem Text="CERTIFICATE" Value="2"></asp:MenuItem>
                   <asp:MenuItem Text="DISCUSSION" Value="3"></asp:MenuItem>
                   <asp:MenuItem Text="NOTES" Value="4"></asp:MenuItem>
               </Items>
                <StaticMenuItemStyle HorizontalPadding="30px" />
            </asp:Menu>

</div>
<div class="coursedetails">
            <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex ="0">
                    <asp:View ID="View1" runat="server">
                        <div class="view1">
                            <p>
                            Welcome to the Complete front end developer Bootcamp. This is one of the most comprehensive bootcamp available online. so, if you are new to web development, thats great news because starting from the scratch is always easy. 
                            </p>
                            <p> This course gives you a unique experience and focus only on front end web development. First we will get professional and free web development tools, then we will start with HTML. Once we cover this ground, we will take down our very first challenge. Further we will learn HTML5 and start our first project. <br /> Moving further we will take CSS and CSS3. After that we will learn Bootstrap and optimize our sites for mobile view. After that we will learn JavaScript and jQuery and will do some projects in that.</p>
                            <p> Structure of this is designed after research and you will never feel bore in this course. After completion of the course, you will be able to design a web page in the exact same design that is on your mind or you might have seen on some theme website.</p>
                            <p> Creating a web template of your own or edit one, you will be a full skill ninja to do the job.</p>
                        </div>

                    </asp:View>
                    <asp:View ID="View2" runat="server">
                        <h2>
                            Here is the syllabus
                        </h2>
                    </asp:View>
                    <asp:View ID="View3" runat="server">
                        <p>Certificate</p>
                    </asp:View>
                    <asp:View ID="View4" runat="server">
                        <p>discussion</p>
                    </asp:View>
                <asp:View ID="View5" runat="server">
                    <p>Notes</p>
                </asp:View>
                </asp:MultiView>
</div>


欢迎来到完整的前端开发人员训练营。这是网上最全面的训练营之一。因此,如果你是网络开发新手,这是个好消息,因为从头开始总是很容易的。

本课程为您提供了独特的体验,只关注前端web开发。首先,我们将获得专业和免费的web开发工具,然后我们将从HTML开始。一旦我们覆盖了这一领域,我们将完成我们的第一个挑战。进一步,我们将学习HTML5并开始我们的第一个项目
进一步,我们将采用CSS和CSS3。之后,我们将学习引导和优化我们的移动视图网站。之后,我们将学习JavaScript和jQuery,并将在这方面做一些项目

这门课的结构是经过研究设计的,在这门课上你们永远不会感到无聊。完成本课程后,您将能够以您脑海中或您可能在某个主题网站上看到的完全相同的设计来设计网页

创建一个自己的网页模板或编辑一个,你将是一个完整的技能忍者做这项工作

这是教学大纲 证书

讨论

注释


使用css,您可以获得
锚定(文本),但获得包装它的
li将是困难的(或不可能的?)

如果您可以使用jquery,这将起作用:

$("a.selected").closest("li").css("border-bottom", "2px solid blue");
$("a.selected").closest("li").css("border-bottom", "2px solid blue");