我在让 Chrome 在我从头开始构建的下拉导航栏上显示圆 Angular 时遇到问题。圆 Angular 在 Firefox 中显示得很好,但 Chrome 和 IE9 似乎不想渲染我的 Angular 。我已将圆 Angular 调用更改为最后一个 <li>我的下拉列表中的元素以及最后一个 <a>我已将其显示为具有宽度和高度属性的 block ,但似乎没有任何作用!
所以我想我会在这里发帖,看看是否有人可以在正确的方向上插入我。
该站点仍处于早期开发阶段,所以不要担心多余的 anchor 链接。
我的 HTML:
<nav>
<ul id="mainNav">
<li>
<a href="highlevel.html" class="autos"></a>
<ul>
<li><a href="subcategory.html">News</a></li>
<li><a href="subcategory.html">Reviews</a></li>
<li><a href="subcategory.html">Car Tech</a></li>
<li><a href="subcategory.html">Fuel Economy & Safety</a></li>
<li><a href="subcategory.html">Buying & Selling</a></li>
<li><a href="subcategory.html">Everything Else</a></li>
</ul>
</li>
<li>
<a href="highlevel.html" class="lifestyles"></a>
<ul>
<li><a href="subcategory.html">Music</a></li>
<li><a href="subcategory.html">Food</a></li>
<li><a href="subcategory.html">Travel</a></li>
<li><a href="subcategory.html">Shopping</a></li>
<li><a href="subcategory.html">Everything Else</a></li>
</ul>
</li>
<li>
<a href="highlevel.html" class="people"></a>
<ul>
<li><a href="subcategory.html">Who You Know</a></li>
<li><a href="subcategory.html">Who You Should Know</a></li>
<li><a href="subcategory.html">Everyone Else</a></li>
</ul>
</li>
<li>
<a href="highlevel.html" class="tech"></a>
<ul>
<li><a href="subcategory.html">Business</a></li>
<li><a href="subcategory.html">Pleasure</a></li>
<li><a href="subcategory.html">Everything Else</a></li>
</ul>
</li>
<li>
<a href="highlevel.html" class="trends"></a>
<ul>
<li><a href="subcategory.html">Online</a></li>
<li><a href="subcategory.html">Offline</a></li>
<li><a href="subcategory.html">Everything Else</a></li>
</ul>
</li>
</ul>
</nav><!-- /Main Nav -->
我的 CSS:
nav {
display:block;
position:relative;
width:980px;
height:41px;
background:url(../../images/nav_bg.png) center top no-repeat;
margin:0 auto;
border-bottom:2px solid #777;
z-index:9998;
}
#mainNav {
display:block;
position:relative;
background:#fff;
}
#mainNav li {
float:left;
}
#mainNav li a {
display:block;
position:relative;
width:125px;
height:41px;
overflow:hidden;
}
#mainNav li a.autos {
display:block;
position:relative;
width:125px;
height:41px;
background:url(../../images/nav1.png) center top no-repeat;
}
#mainNav li a.autos:hover {
background:url(../../images/nav1.png) center -41px no-repeat;
}
#mainNav li a.lifestyles {
display:block;
position:relative;
width:125px;
height:41px;
background:url(../../images/nav2.jpg) center top no-repeat;
}
#mainNav li a.lifestyles:hover {
background:url(../../images/nav2.jpg) center -41px no-repeat;
}
#mainNav li a.people {
display:block;
position:relative;
width:125px;
height:41px;
background:url(../../images/nav3.jpg) center top no-repeat;
}
#mainNav li a.people:hover {
background:url(../../images/nav3.jpg) center -41px no-repeat;
}
#mainNav li a.tech {
display:block;
position:relative;
width:125px;
height:41px;
background:url(../../images/nav4.jpg) center top no-repeat;
}
#mainNav li a.tech:hover {
background:url(../../images/nav4.jpg) center -41px no-repeat;
}
#mainNav li a.trends {
display:block;
position:relative;
width:125px;
height:41px;
background:url(../../images/nav5.jpg) center top no-repeat;
}
#mainNav li a.trends:hover {
background:url(../../images/nav5.jpg) center -41px no-repeat;
}
/* === Dropdown Menu Styles === */
#mainNav ul {
display:none;
position:absolute;
z-index:9998;
}
#mainNav li:hover ul {
display:block;
position:absolute;
width:160px;
height:auto;
border-right:1px solid #999;
border-left:1px solid #999;
overflow:hidden;
-moz-border-radius-topleft: 0px;
-moz-border-radius-topright: 0px;
-moz-border-radius-bottomright: 7px;
-moz-border-radius-bottomleft: 7px;
-webkit-border-radius: 0px 0px 7px 7px;
border-radius: 0px 0px 7px 7px;
-webkit-box-shadow: 0px 5px 3px 0px rgba(0, 0, 0, .25);
-moz-box-shadow: 0px 5px 3px 0px rgba(0, 0, 0, .25);
box-shadow: 0px 5px 3px 0px rgba(0, 0, 0, .25);
}
#mainNav li:hover ul li a {
display:block;
width:160px;
height:auto;
background:#fff;
padding:5px 0;
border-bottom:1px solid #999;
font-family: 'Swiss721Light', Verdana, Arial;
text-indent:10px;
text-decoration:none;
font-size:14px;
line-height:16px;
color:#555;
}
#mainNav li:hover ul li a:hover {
background:#eaeaea;
}
最佳答案
你可以这样做:
#mainNav li:hover ul li:last-child a{
border-radius: 0px 0px 7px 7px;
}
您还需要去掉包含 ul 的 40px padding-left
在底部添加填充很好,但会使它看起来有点乱,尤其是当您在各个链接周围使用边框时
关于html - Chrome 没有收到 CSS 圆 Angular 边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8617787/
我想将html转换为纯文本。不过,我不想只删除标签,我想智能地保留尽可能多的格式。为插入换行符标签,检测段落并格式化它们等。输入非常简单,通常是格式良好的html(不是整个文档,只是一堆内容,通常没有anchor或图像)。我可以将几个正则表达式放在一起,让我达到80%,但我认为可能有一些现有的解决方案更智能。 最佳答案 首先,不要尝试为此使用正则表达式。很有可能你会想出一个脆弱/脆弱的解决方案,它会随着HTML的变化而崩溃,或者很难管理和维护。您可以使用Nokogiri快速解析HTML并提取文本:require'nokogiri'h
我好像记得Lua有类似Ruby的method_missing的东西。还是我记错了? 最佳答案 表的metatable的__index和__newindex可以用于与Ruby的method_missing相同的效果。 关于ruby-难道Lua没有和Ruby的method_missing相媲美的东西吗?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/7732154/
我在MiniTest::Spec和Capybara中使用以下规范:find_field('Email').must_have_css('[autofocus]')检查名为“电子邮件”的字段是否具有autofocus属性。doc说如下:has_css?(path,options={})ChecksifagivenCSSselectorisonthepageorcurrentnode.据我了解,字段“Email”是一个节点,因此调用must_have_css绝对有效!我做错了什么? 最佳答案 通过JonasNicklas得到了答案:No
我有一个奇怪的问题:我在rvm上安装了rubyonrails。一切正常,我可以创建项目。但是在我输入“railsnew”时重新启动后,我有“程序'rails'当前未安装。”。SystemUbuntu12.04ruby-v"1.9.3p194"gemlistactionmailer(3.2.5)actionpack(3.2.5)activemodel(3.2.5)activerecord(3.2.5)activeresource(3.2.5)activesupport(3.2.5)arel(3.0.2)builder(3.0.0)bundler(1.1.4)coffee-rails(
在我的Controller中,我通过以下方式在我的index方法中支持HTML和JSON:respond_todo|format|format.htmlformat.json{renderjson:@user}end在浏览器中拉起它时,它会自然地以HTML呈现。但是,当我对/user资源进行内容类型为application/json的curl调用时(因为它是索引方法),我仍然将HTML作为响应。如何获取JSON作为响应?我还需要说明什么? 最佳答案 您应该将.json附加到请求的url,提供的格式在routes.rb的路径中定义。这
我想在一个没有Sass引擎的类中使用Sass颜色函数。我已经在项目中使用了sassgem,所以我认为搭载会像以下一样简单:classRectangleincludeSass::Script::FunctionsdefcolorSass::Script::Color.new([0x82,0x39,0x06])enddefrender#hamlengineexecutedwithcontextofself#sothatwithintemlateicouldcall#%stop{offset:'0%',stop:{color:lighten(color)}}endend更新:参见上面的#re
所以我在关注Railscast,我注意到在html.erb文件中,ruby代码有一个微弱的背景高亮效果,以区别于其他代码HTML文档。我知道Ryan使用TextMate。我正在使用SublimeText3。我怎样才能达到同样的效果?谢谢! 最佳答案 为SublimeText安装ERB包。假设您安装了SublimeText包管理器*,只需点击cmd+shift+P即可获得命令菜单,然后键入installpackage并选择PackageControl:InstallPackage获取包管理器菜单。在该菜单中,键入ERB并在看到包时选择
我正在使用Rails构建一个简单的聊天应用程序。当用户输入url时,我希望将其输出为html链接(即“url”)。我想知道在Ruby中是否有任何库或众所周知的方法可以做到这一点。如果没有,我有一些不错的正则表达式示例代码可以使用... 最佳答案 查看auto_linkRails提供的辅助方法。这会将所有URL和电子邮件地址变成可点击的链接(htmlanchor标记)。这是文档中的代码示例。auto_link("Gotohttp://www.rubyonrails.organdsayhellotodavid@loudthinking.
大家好!我想知道Ruby中未使用语法ClassName.method_name调用的方法是如何工作的。我头脑中的一些是puts、print、gets、chomp。可以在不使用点运算符的情况下调用这些方法。为什么是这样?他们来自哪里?我怎样才能看到这些方法的完整列表? 最佳答案 Kernel中的所有方法都可用于Object类的所有对象或从Object派生的任何类。您可以使用Kernel.instance_methods列出它们。 关于没有类的Ruby方法?,我们在StackOverflow
简而言之错误:NOTE:Gem::SourceIndex#add_specisdeprecated,useSpecification.add_spec.Itwillberemovedonorafter2011-11-01.Gem::SourceIndex#add_speccalledfrom/opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91./opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:275:in`==':und