我无法通过菜单栏更改字体。我是在Dreamweaver中制作的,因此菜单栏中有很多额外的CSS代码,但是我尝试了所有我能想到的选项,但仍然无法访问菜单栏中的文本来更改字体,颜色或任何其他内容。 。

这是html:

<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Australian Design Architects</title>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link href="ADA.css" rel="stylesheet" type="text/css" />

<!--[if lt IE 9]><script src="javascript/html5.js"></head>script><![endif] -->
</head>
<body>
<div id="main">
<header>
<h1 id="hheading">Australian Design Architects</h1>
<img src="logo2.gif" alt="ADA LOGO" width="130" height="130" id="himg" />
<nav>
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><code><a href="#"> <!--id="home"-->Home</a></code></li>
<li><code><a href="#" class="MenuBarItemSubmenu">Portfolio</a>
    <ul>
      <li><a href="#">Commercial</a></li>
      <li><a href="#">Residential</a></li>
      <li><a href="#">Heritage</a></li>
      <li><a href="#">Rennovations/Additions</a></li>
    </ul>
</code></li>
<li><code><a href="#">Services</a> </code>      </li>
<li><a href="#"><code>About Us</code></a></li>
<li><a href="#"><code>Contact us</code></a></li>
</ul>
</nav>
</header>
<p>&nbsp; </p>
<p>&nbsp; </p>
<div id="maincontent">
<article id="inner"></article>
<img src="3drender.png" alt="3d render" name="mimg" width="640" height="480" id="mimg"></div>
<footer>
<div id="fbtw">Content for  id "fbtw" Goes Here</div>
<ul>
<li><p><a href="#">Privacy Statement</a></p></li>
<li><p><a href="#">Accessability Statement</a></p></li>
<li><p><a href="#">Site Map</a></p></li></ul>
<p>&copy; Samuel Martin 2014. All Rights Reserved.</p>
</footer>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1",       {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</div>



   

这是CSS:

@charset "utf-8";
/* CSS Document */

@font-face {
font-family: 'flux_architect_regular';
src: url('flux_architect_regular-webfont.eot');
src: url('flux_architect_regular-webfont.eot?#iefix') format('embedded-opentype'),
     url('flux_architect_regular-webfont.woff') format('woff'),
     url('flux_architect_regular-webfont.ttf') format('truetype'),
     url('flux_architect_regular-webfont.svg#flux_architectregular') format('svg');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'monospacetypewriterregular';
src: url('monospacetypewriter-webfont.eot');
src: url('monospacetypewriter-webfont.eot?#iefix') format('embedded-opentype'),
     url('monospacetypewriter-webfont.woff') format('woff'),
     url('monospacetypewriter-webfont.ttf') format('truetype'),
     url('monospacetypewriter-webfont.svg#monospacetypewriterregular') format('svg');
font-weight: normal;
font-style: normal;
}

*{
margin:0;
padding:0;
}

article, aside, figure, footer, header, nav, section{
display:block;
}

body {
font-family:'monospacetypewriterregular', sans-serif;
color: #999;
width: 1024px;
margin-top: 20px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
border: 3px dotted #6a8c3f; /*1764fc 323aea*/
background-color:#666;
}

#main{
background-color:#fff;
/*box-shadow: 0 0 25px 5px #1764fc; 00aae4 */
}

#himg {
float: left;
padding-top: 10px;
padding-left: 10px;
}


nav {
font-size: 18px;
position: absolute;
padding-top: 50px;
padding-left: 140px;
padding-bottom:50px;
}

footer {
font-size: 12px;
line-height: 1.5em;
color: #999;
clear: both;
padding-top: 10px;
padding-bottom: 10px;
text-align: center;
}

footer li {
display: inline-block;
position:relative;
margin-left:10px;
margin-right:10px;

}

footer p {
margin-bottom: 5px;
}

footer a {
color: #999;
}

#hheading {
position: absolute;
top: -500px;
}

#maicontent {
float: left;
width: 700px;
border: 1px solid #999;
padding-top:50px;
margin-top:106px;
}


我需要更改字体。请帮忙。

最佳答案

将此添加到您的CSS

// This removes the unordered list circle
nav ul{
    list-style-type:none;
}
// this floats the element inline
nav ul li
{
    float:left;
    display:inline-block;
}
// This is used to remove the underline and give effects to the text
nav li a
{
    font-family:'monospacetypewriterregular', sans-serif;
    text-decoration:none;
}


Fiddle Demo here..!!

关于css - 找不到菜单栏CSS来更改文本,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22573116/

10-13 01:30