Div背景未显示 [英] Div background is not showing

查看:56
本文介绍了Div背景未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的菜单背景颜色(#main-nav)未在Google Chrome和Firefox中显示。但它与Internet Explorer一起工作正常。我的CSS是:

#main-nav {
background:#7dad16;
背景:-moz-linear-gradient(顶部,#7dad16 0%,#547b00 100%);
背景:-webkit-gradient(线性,左上,左下,颜色停止(0%,#7dad16),颜色停止(100%,#547b00));
背景:-webkit-linear-gradient(顶部,#7dad16 0%,#547b00 100%);
背景:-o-linear-gradient(顶部,#7dad16 0%,#547b00 100%);
背景:-ms-linear-gradient(顶部,#7dad16 0%,#547b00 100%);
背景:线性渐变(顶部,#7dad16 0%,#547b00 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr = ' #7dad16',endColorstr = ' #547b00',GradientType = 0 );
float :none;
宽度:100%;
z-index: 1000 ;
}



和aspx页面是:

 <   div     id   =  main-nav >  
< ul >
< li > < a > 主页< / a > < span class =code-keyword>< / li >
< li > < a > 关于< / a >

< / li >
< li > ; < a > 活动< / a >

< / li >
< span class =code-keyword>< li > < a > 与我们联系< / a >
< / li >
< span class =code-keyword>< li > < a > 新闻< / a > < / li >
< / ul >
< / div >



请帮我解决这个问题

谢谢

解决方案

 <  < span class =code-leadattribute> style  >  
#main-nav {
background:#7dad16;
背景:-moz-linear-gradient(顶部,#7dad16 0%,#547b00 100%);
背景:-webkit-gradient(线性,左上,左下,颜色停止(0%,#7dad16),颜色停止(100%,#547b00));
背景:-webkit-linear-gradient(顶部,#7dad16 0%,#547b00 100%);
背景:-o-linear-gradient(顶部,#7dad16 0%,#547b00 100%);
背景:-ms-linear-gradient(顶部,#7dad16 0%,#547b00 100%);
背景:线性渐变(顶部,#7dad16 0%,#547b00 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr ='#7dad16',endColorstr ='#547b00',GradientType = 0);
float:none;
宽度:100%;
z-index:1000;
}
< / style >







 <   div     id   =  main-nav  >  
< ul >
< li > < a > ; 主页< / a > < / li >
< li > < a > 关于< span class =code-keyword>< / a >

< / li >
< li > < a > 活动< / a >

< / li >
< li > < a > 与我们联系< < span class =code-leadattribute> / a >
< / li >
< li > < a > 新闻< / a > < / li >
< / ul >
< / div >





工作正常。重新检查。



这是预览 http:// img692.imageshack.us/img692/346/v8no.jpg [ ^ ]


My menu background color(#main-nav) is not showing in Google chrome and Firefox. But it is working fine with Internet Explorer. My CSS is:

#main-nav {
  background: #7dad16;
  background: -moz-linear-gradient(top, #7dad16 0%, #547b00 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7dad16), color-stop(100%,#547b00));
  background: -webkit-linear-gradient(top, #7dad16 0%,#547b00 100%);
  background: -o-linear-gradient(top, #7dad16 0%,#547b00 100%);
  background: -ms-linear-gradient(top, #7dad16 0%,#547b00 100%);
  background: linear-gradient(top, #7dad16 0%,#547b00 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7dad16', endColorstr='#547b00',GradientType=0 );
  float:none;
  width: 100%;
  z-index: 1000;
}


And aspx page is:

<div id="main-nav">
                        <ul>
                            <li><a>Home</a></li>
                            <li><a>About</a>

                            </li>
                            <li><a>Activities</a>

                            </li>
                            <li><a>Contact Us</a>
                               </li>
                            <li><a>News</a></li>
                        </ul>
                    </div>


Please help me to solve this problem
Thanks

解决方案

<style>
        #main-nav {
  background: #7dad16;
  background: -moz-linear-gradient(top, #7dad16 0%, #547b00 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7dad16), color-stop(100%,#547b00));
  background: -webkit-linear-gradient(top, #7dad16 0%,#547b00 100%);
  background: -o-linear-gradient(top, #7dad16 0%,#547b00 100%);
  background: -ms-linear-gradient(top, #7dad16 0%,#547b00 100%);
  background: linear-gradient(top, #7dad16 0%,#547b00 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7dad16', endColorstr='#547b00',GradientType=0 );
  float:none;
  width: 100%;
  z-index: 1000;
}
    </style>




<div id="main-nav">
                      <ul>
                          <li><a>Home</a></li>
                          <li><a>About</a>

                          </li>
                          <li><a>Activities</a>

                          </li>
                          <li><a>Contact Us</a>
                             </li>
                          <li><a>News</a></li>
                      </ul>
                  </div>



Its working fine. Recheck.

Here is the preview http://img692.imageshack.us/img692/346/v8no.jpg[^]


这篇关于Div背景未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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