为什么我的焦点图那块的图片显示不正常?????

来源:3-8 企业网站制作之焦点图制作

飞翔的兔斯基

2016-11-22 20:52

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>企业网站</title>
    <link href="css/main.css" rel="Stylesheet" type="text/css" />
    <script src="js/setHomeSetFav.js" charset="gb2312" type="text/javascript" ></script>
    <script src="js/myfocus-2.0.1.min.js" charset="gb2312" type="text/javascript" ></script>
    <script src="js/mf-pattern/mF_YSlider.js" charset="gb2312" type="text/javascript" ></script>
    <link href="js/mf-pattern/mF_YSlider.css" charset="gb2312" type="text/css" />
</head>
<body>
<div class="top">
    <div class="top_content">
        <ul>
            <li><a href="#">联系我们</a></li>
            <li><a href="#" onclick="AddFavorite(window.location,document.title)">加入收藏</a></li>
            <li><a href="#" onclick="SetHome(window.location)">设为首页</a></li>
        </ul>
    </div>
</div><!--top结束-->
<div class="wrap">
    <div class="log">
        <div class="log_left">
        <img src="images/logo.jpg" alt="慕课网" />
        </div>
        <div class="log_right">
        <img src="images/tel.jpg" alt="免费热线" />24小时免费热线:<span class="tel">820-820-8820</span>
        </div>
    </div><!--log结束-->
    <div class="nav">
        <div class="nav_left"></div>
        <div class="nav_mid">
            <div class="nav_mid_left">
                <ul>
                    <li><a href="#">首页</a></li>
                    <li><a href="#">关于陈聪</a></li>
                    <li><a href="#">新闻动态</a></li>
                    <li><a href="#">课程中心</a></li>
                    <li><a href="#">在线课程</a></li>
                    <li><a href="#">人才招聘</a></li>
                </ul>
            </div>
            <div class="nav_mid_right">
                <form action="" method="post"><!-- form:表单标签 action:规定当提交表单时向何处发送表单数据 method:规定用于发送 form-data 的 HTTP 方法。-->
                    <input type="text"  class="search_text" />
                </form>
            </div>
        </div><!--nav_mid结束-->
        <div class="nav_right">
        </div>
    </div><!--nav结束-->
    <div class="ad">
        <ul>
            <li><img src="images/ad2.jpg" alt="ad2" /></li>
            <li><img src="images/ad3.jpg" alt="ad3" /></li>
            <li><img src="images/ad4.jpg" alt="ad4" /></li>
        </ul>
    </div>
</div><!--wrap结束-->
</body>
</html>


--------------------------------------------css-------------------------------------------------------

*
{
    margin:0px;
    padding:opx;
    font-size:12px;
}
body
{
    background-color:#f5f5f5;
}
.top
{
  width:100%;
  height:27px;
  background:url(../images/top_bg.jpg) repeat-x;  
}
.top_content
{
    width:1000px;
    margin:0px auto;/*设置内容居中*/
    line-height:27px;
}
.top_content li
{
    /*设置列表横排显示,需要注意排序*/
    list-style:url(../images/li_bg.gif);
    float:right;
    width:70px;
    line-height:27px;
}
.top_content a:link,.top_content a:visited /* .top__content样式下的 a 标签的初始状态和.top_content样式下的 a 标签的访问之后的状态 */
{
    color:#8e8e8e;
    text-decoration:none;
}
.top_content a;hover,.top_content a:active /* .top__content样式下的 a 标签的鼠标放上去和.top_content样式下的 a 标签的活动状态 */
{
    color:#900;
    text-decoration:none;
}
.wrap
{
    width:1000px;
    margin:0px auto;
}
.log
{
    height:80px;
    background-color:#fff;
}
.log_left
{
    width:300px;
    float:left;
}
.log_right
{
    height:28px;
    width:300px;
    float:right;
    margin-top:28px;
    color:#8e8e8e;
}
.log_right img
{
    vertical-align:middle;
    margin-right:5px;
}
.tel
{
    font-family:微软雅黑;
    font-size:14px;
    color:#C00;
}
.nav,.nav_left,.nav_mid,.nav_right
{
    height:40px;
}
.nav_left,.nav_mid,.nav_right
{
    float:left;
}
.nav_left
{
    width:10px;
    background:url(../images/nav_left.jpg) no-repeat;
}
.nav_mid
{
    width:980px;
    background:url(../images/nav_bg.jpg) repeat-x;
    }
.nav_right
{
    width:10px;
    background:url(../images/nav_right.jpg) no-repeat;
}
.nav_mid_left,.nav_mid_right
{
    float:left;
}
.nav_mid_left
{
    width:680px;
}
.nav_mid_right
{
    width:300px;
}
.nav_mid_left li
{
    width:100px;
    float:left;
    list-style:none;
    line-height:40px;
    text-align:center;
}
.nav_mid_left a:link,.nav_mid_left a:visited
{
    text-decoration:none;
    font-size:16px;
    color:#fff;
    font-family:微软雅黑;
}
.nav_mid_left a:hover
{
    text-decoration:none;
    font-size:16px;
    color:#ff0;
    font-family:微软雅黑;
}
.search_text
{
    width:190px;
    height:25px;
    margin-top:5px;
    background:url(../images/search.jpg) no-repeat right center;
    background-color:#fff;
    padding-right:25px;
    border:1px solid #fff;
}
.ad
{
    height:310px;
    overflow:hidden;
}
.ad li
{
    list-style:none;
}

写回答 关注

2回答

  • 慕容8510444
    2016-12-09 10:36:20

    ul 外面加 div class=“pic”还得加初始化  <script>myFoucs.set({id:"boxId" })</script> boxId 放在 .class="ad" 后面即可

  • 慕标7107277
    2016-11-23 14:55:43

    内容盒子最外层有一个div class为pic的盒子,然后在使用js代码调用myFocus

企业网站综合布局实战

本课程重点介绍HTML/CSS实现常见企业网站布局的方法

157038 学习 · 2134 问题

查看课程

相似问题