单击栏图标时显示选项卡(响应导航栏)(Make tabs appear when bars icon is clicked(responsive navbar))
我创建了一个导航栏,所有标签都是内联的。 当窗口大小减小时,会出现一个条形图标,并且标签垂直显示而不是水平显示。 我想要输出,这样当窗口大小减小时,会出现条形图标,但是标签会消失,只能在垂直方向看到并且在单击条形图标时看不见。 我试过jquery,但它没有用。 我不知道怎么做,你能帮助我吗?
body { margin: 0; padding: 0; font-family: Sans-Serif; } nav { margin-left: 45px; ; width: 90%; background: #D1D0D3; } ul { list-style-type: none; width: 80%; margin: 0 auto; color: black; padding: 0; } ul a { color: black; text-decoration: none; } ul li { display: inline-block; padding: 20px; } ul li:hover { background-color: yellow; } .toggle { width: 100%; padding: 10px 20px 0px 20px; background-color: #C2ABF1; text-align: right; box-sizing: border-box; color: white; font-size: 30px; display: none; } @media (max-width: 800px) { .toggle { display: block; } .block { display: block; } }
<div class="toggle"> <i class="fa fa-bars menu" id="menu"></i> </div> <nav> <ul class="ul"> <li class="block"><a href="#">Home</a></li> <li class="block"><a href="#">About</a></li> <li class="block"><a href="#">Makeup</a></li> <li class="block"><a href="#">Hairstyle</a></li> <li class="block"><a href="#">Contact</a></li> </ul> </nav>
I created a navbar and all the tabs are inline. When the window size is reduced, a bars icon appears and the tabs display vertically instead of horizontally. I want the output so that when the window size is reduced, the bars icon appears but the tabs disappear and can only be seen (vertically) and unseen when the bars icon is clicked. I tried jquery, but it didn't work. I'm not sure how to do this, can you help me?
body { margin: 0; padding: 0; font-family: Sans-Serif; } nav { margin-left: 45px; ; width: 90%; background: #D1D0D3; } ul { list-style-type: none; width: 80%; margin: 0 auto; color: black; padding: 0; } ul a { color: black; text-decoration: none; } ul li { display: inline-block; padding: 20px; } ul li:hover { background-color: yellow; } .toggle { width: 100%; padding: 10px 20px 0px 20px; background-color: #C2ABF1; text-align: right; box-sizing: border-box; color: white; font-size: 30px; display: none; } @media (max-width: 800px) { .toggle { display: block; } .block { display: block; } }
<div class="toggle"> <i class="fa fa-bars menu" id="menu"></i> </div> <nav> <ul class="ul"> <li class="block"><a href="#">Home</a></li> <li class="block"><a href="#">About</a></li> <li class="block"><a href="#">Makeup</a></li> <li class="block"><a href="#">Hairstyle</a></li> <li class="block"><a href="#">Contact</a></li> </ul> </nav>
原文:https://stackoverflow.com/questions/51154981
最满意答案
使用
@XmlTransient
注释父类,它将帮助您包括父类的属性在ListUserType类的顶部添加这个
@XmlType(propOrder={"Id", "Name", "Namespace"})
。Annotate the parent class with
@XmlTransient
, it will help you to include the properties from parent class thenadd this
@XmlType(propOrder={"Id", "Name", "Namespace"})
on top of ListUserType class.
相关问答
更多-
注意:我是EclipseLink JAXB(MOXy)领导和JAXB(JSR-222)专家组的成员。 MOXy已经是WebLogic 12.1.1中的默认JAXB实现: http://blog.bdoughan.com/2011/12/eclipselink-moxy-is-jaxb-provider-in.html 在其他环境中,您还可以利用META-INF/services机制将MOXy指定为默认JAXB提供程序: 在目录META-INF/services创建一个包含名为javax.xml.bind.J ...
-
您是否尝试使用@XmlTransient在User类中注释getAuthorities()? 我已经完成了几乎相同的实现生成JSON的Rest服务: @Override @JsonIgnore //Tell Jackson to ignore this metod, you can use @XMLTransient public Collection extends GrantedAuthority> getAuthorities() { Set使用@XmlTransient注释父类,它将帮助您包括父类的属性 在ListUserType类的顶部添加这个@XmlType(propOrder={"Id", "Name", "Namespace"}) 。 Annotate the parent class with @XmlTransient, it will help you to include the properties from parent class then add this @XmlType(propOrder={"Id", "Name ...您在类中指定字段和属性的顺序并不重要。 这意味着当JAXB(JSR-222)实现内省类时,它可能不会按照您指定的顺序查看字段/属性。字母顺序是提供一致排序的最简单方式。 如果你想指定一个订单,你需要在propOrder上使用@XmlType 。 The order that you specify the fields and properties in your class is not significant. This means that when the JAXB (JSR-222) implem ...属性在XML中出现的顺序并不重要,而元素出现的顺序是。 像大多数XML技术一样,JAXB不保证属性的显示顺序。 您的单元测试需要考虑到这一点。 注意 使用Unmarshaller和Marshaller ,输出XML基于映射元数据而不是输入XML的顺序。 元数据允许您指定元素的排序,但不指定属性。 您可以使用JAXB的Binder编组到现有文档(DOM)中。 The order in which attributes appear in XML is not significant while the ord ...几天后我找了解决方案,最后我使用了Freemarker I looked for the solution for few days later I ended up using Freemarker
JAXB命名空间顺序(JAXB Namespace Order)[2022-09-17]
JAXB并不直接支持它,但您可以将对象封送到ContentHandler,XMLStreamWriter或XMLEventWriter,并在那里处理命名空间和属性排序。 JAXB does not directly supports that, but you can marshal your object to ContentHandler, XMLStreamWriter or XMLEventWriter and take care of the namespace and attribute ord ...是的, JAXB(JSR-222)元数据需要匹配XML才能使解组成功。 在您的使用案例中,您可能会看到几种可能的行为。 您正在查看的源可能与运行应用程序时使用的类不对应。 您可能想要仔细检查您的类路径。 可以使用XmlAdapter映射有问题的类。 XmlAdapter是一种可以转换域对象的机制,转换的结果是映射到XML的内容。 这意味着不会使用域对象上的注释。 检查字段,属性,类型或包级别上的@XmlJavaTypeAdapter注释: http : //blog.bdoughan.com/search/ ...您可以通过将字段更改为对象类型来执行以下操作(默认情况下,空值不会出现在XML表示中)并在getter中添加一些逻辑: @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement(name = "FIELD") public class TestLayoutNode { @XmlAttribute(name = "num") private Integer number; @XmlAttribute private Strin ...List将根据元素在unmarshal上出现在XML中的顺序进行填充。 当编组XML中元素的顺序时,将基于List相应对象的顺序。 The List will be populated based on the order the elements appear in the XML on an unmarshal. When marshalling the order of the elements in the XML will be based on the order of the correspo ...相关文章
更多- 应用多个icon的对比
- 【原创】小白学jquery Mobile《构建跨平台APP:jQuery Mobile移动应用实战》连载五(给按钮加图标)
- 微信公众平台开发(91) 右上角按钮/底部导航栏/用户网络状态
- tabPanel 选项卡位置问题
- 微信点击超链接第一次不会有“微信中网页底部导航栏”,进入之后再点击链接就会有了,自己会新建窗口
- Ext grid 出现checkbox和图标移位的问题(在IE)
- 左则导航鼠标滑过时显示详情的实现
- SolrCloud分布式检索时显示每个shard的响应速度
- iphone上自定义状态栏效果的实现
- iphone上自定义状态栏效果的实现
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)