Murray Brown
asked on
ASP.net Using style in header
Hi
In the following master page I have a class called "grad1" that I use in the bosy.
How do I use it in the header?
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site1.master.v b" Inherits="OES5.Site1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="UTF-8" />
<title>Microsoft Excel Spreadsheet Consulting | Excel Cloud Accounting | Office 365 Sharepoint</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<!--The classes contained in the style tags are purely for the horizontal navigation bar-->
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
}
li {
float: left;
}
a:link, a:visited {
display: block;
width: 120px;
font-weight: bold;
color: #FFFFFF;
background-color: #98bf21;
text-align: center;
padding: 6px;
text-decoration: none;
text-transform: uppercase;
}
a:hover, a:active {
background-color: #7A991A;
}
#grad1 {
color:blue;
background: linear-gradient(to bottom, lightskyblue,navy);
}
</style>
</head>
<body>
<!--nav element must live inside the 'body' element-->
<nav>
<ul>
<li><a href="Default.aspx" class="myHoverButton">Home </a></li>
<li><a href="Webform1.aspx" class="myHoverButton">Page 1</a></li>
<li><a href="Webform2.aspx" class="myHoverButton">Page 2</a></li>
<li><a href="Webform1.aspx" class="myHoverButton">Page 3</a></li>
<li><a href="Webform2.aspx" class="myHoverButton">Page 4</a></li>
<li><a href="Webform1.aspx" class="myHoverButton">Page 5</a></li>
<li><a href="Webform2.aspx" class="myHoverButton">Page 6</a></li>
<li><a href="Webform1.aspx" class="myHoverButton">Page 7</a></li>
<li><a href="Webform2.aspx" class="myHoverButton">Page 8</a></li>
</ul>
</nav>
<form id="form1" runat="server">
<div id="grad1">
Hello
</div>
<div>
<!--The ContentPlaceHolder area is used by the other pages to merge their content with the master page-->
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
In the following master page I have a class called "grad1" that I use in the bosy.
How do I use it in the header?
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site1.master.v
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="UTF-8" />
<title>Microsoft Excel Spreadsheet Consulting | Excel Cloud Accounting | Office 365 Sharepoint</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<!--The classes contained in the style tags are purely for the horizontal navigation bar-->
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
}
li {
float: left;
}
a:link, a:visited {
display: block;
width: 120px;
font-weight: bold;
color: #FFFFFF;
background-color: #98bf21;
text-align: center;
padding: 6px;
text-decoration: none;
text-transform: uppercase;
}
a:hover, a:active {
background-color: #7A991A;
}
#grad1 {
color:blue;
background: linear-gradient(to bottom, lightskyblue,navy);
}
</style>
</head>
<body>
<!--nav element must live inside the 'body' element-->
<nav>
<ul>
<li><a href="Default.aspx" class="myHoverButton">Home
<li><a href="Webform1.aspx" class="myHoverButton">Page
<li><a href="Webform2.aspx" class="myHoverButton">Page
<li><a href="Webform1.aspx" class="myHoverButton">Page
<li><a href="Webform2.aspx" class="myHoverButton">Page
<li><a href="Webform1.aspx" class="myHoverButton">Page
<li><a href="Webform2.aspx" class="myHoverButton">Page
<li><a href="Webform1.aspx" class="myHoverButton">Page
<li><a href="Webform2.aspx" class="myHoverButton">Page
</ul>
</nav>
<form id="form1" runat="server">
<div id="grad1">
Hello
</div>
<div>
<!--The ContentPlaceHolder area is used by the other pages to merge their content with the master page-->
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome, thanks for the points.
ASKER