nav

Links inside HTML5 footer element (nav and aside?)

对着背影说爱祢 提交于 2019-12-05 06:36:00
I'm currently moving a page from HTML4 to HTML5, and I have kind of an issue. There's a bunch of lists with links inside the footer. Most of them link to information (faq etc.) about the site itself. So I think it's OK to put those inside a nav element (see "Introducing HTML5" and the HTHML5 Doctor). But two lists contain links to external pages like Facebook. Now I could wrap those inside an aside, but this is a bit of an edge case: "It is legitimate to wrap the links to other pages on the site with an aside inside the footer — but ask yourself whether the aside to instead be a sibling of the

dynamically apply active class to nav li

我的梦境 提交于 2019-12-05 06:15:04
问题 I have included a header to my files as in include. In the header is the nav bar. How do I, using jQuery, apply class="active" to the relevant li . The only way I could think of doing it is to set a variable on the actual pages, apply an id that is equal to that variable of the relevant page and if function so if they match apply a class to the li. However, I thought there must be a simpler way of achieving this. <ul class="nav nav-pills right" id="div"> <li id="home" class="active"> <a href=

Internet Explorer 8 won't modify HTML5 tags in print stylesheet

六月ゝ 毕业季﹏ 提交于 2019-12-05 03:46:03
I was working on a print stylesheet earlier and came across a problem with IE8. I am using HTML5 and several layout tags including header, nav and footer. For some reason in my print stylesheet the display:none; declaration on these tags is being ignored in IE8 (and I can only assume subsequent lower versions). I first thought that Developer Tools in IE9 could be causing a false representation, however I have a Windows XP installation in VirtualBox which shows the problem also. My guess its because HTML5 tags aren't seen properly by anything below IE9. The print stylesheet hides the layout

HTML5 nav tag correct usage

半城伤御伤魂 提交于 2019-12-04 23:40:19
<ul class="mainMenu"> <li><a href="#">Home</a></li> <li><a href="#">Forum</a></li> <li><a href="#" class="mainSelected">Construct</a></li> <li><a href="#">Arcade</a></li> <li><a href="#">Manual</a></li> </ul> <ul class="subMenu"> <li><a href="#">Homepage</a></li> <li><a href="#">Construct</a></li> <li><a href="#" class="underSelected">Products</a></li> <li><a href="#">Community Forum</a></li> <li><a href="#">Contact Us</a></li> </ul> Is it more semantically correct to have a <nav> around both these <ul> individually, or should one nav wrap both? Also would it be appropriate to use the nav tag

Adding active class to current page in nav with jQuery

 ̄綄美尐妖づ 提交于 2019-12-04 20:35:01
I'm trying to add the 'active' class to the current page's nav link in the header. I made some progress, but I'm running into a small bug, and would appreciate some help. I know the answer is quite obvious, however, I'm new to jQuery/Javascript and I'm having trouble finding it on my own. Here's my nav HTML structure: <nav class="navbar navbar-expand-lg navbar-dark fixed-top" id="nav"> <ul class="navbar-nav ml-auto"> <li class="nav-item"> <a href="/" class="nav-link">Me</a> </li> <li class="nav-item"> <a class="nav-link" href="/work">Work</a> </li> <li class="nav-item"> <a class="nav-link"

web--响应式导航菜单

不羁岁月 提交于 2019-12-04 17:49:52
响应式导航菜单 代码如下 HTML代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>响应式导航菜单</title> <link rel="stylesheet" href="day01.css"> <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script> </head> <body> <div class="bars"> <span></span> <span></span> <span></span> </div> <div class="nav"> <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> </ul> <

How to add social media buttons to bootstrap nav

喜你入骨 提交于 2019-12-04 17:41:35
I am trying to add Twitter, Google+ and Facebook buttons to a navigation header so that they appear on the right of the top right corner of the header, on a line above the nav menu. I am using Bootstrap. I tred the forllowing: 1) row class 2) table with two rows 3) another ul Non of these worked. Please find below the code without the social button links. HTML: <div class="nav"> <div class="container"> <span class="pull-left"> <a href="home.html"> <img src="images/logo150.png" width="150"> </a> </span> <ul class="pull-right"> <li><a class="active" href="home.html">Get Muse</a></li> <li><a href

I'm trying to use hamburger menu on bulma css, but it doesn't work. What is wrong?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 16:20:10
问题 I'm new on bulma css http://bulma.io/ I'm trying to use hamburger menu for mobile user. I just followed instruction on this page: http://bulma.io/documentation/components/nav/ But it doesn't work. What should I add ? Actually, I can see hamburger menu, but it doesn't work when I am click it. Thank you. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <title>test</title> <link rel="stylesheet" href="css

Centered icons above / over / on top of text in Navbar? (Bootstrap 3)

大城市里の小女人 提交于 2019-12-04 15:59:24
问题 I spent some time searching for a way to do this & tried a couple (close) examples without success. Example here I'm basically trying to put the little android icons centered above the "Sub#" text in the subnav. Any help would be appreciated. The area of the code is: <span class=""> <span>Sub1</span> <i class="fa fa-android fa-lg"></i> </span> 回答1: You should wrap each of icons in col-xs-2 with a col-xs-offset-1 in the first div to make it centered. You can use <br> tags to create a line

JavaScript基础笔记

旧城冷巷雨未停 提交于 2019-12-04 11:08:08
顶级对象:window onload = function(){} getElementById('nav').offsetHieght //获取div=nav元素,距离html顶部元素的距离,同类型的还有offsetLeft,offsetRight.offsetBottom 页面滚动事件: <body><div class="top" id="top"></div><div class="nav" id="nav"></div><div class="main-body" id="menu"> <img src="images/img1.jpg" alt=""></div><div class="footer"></div><script type="text/javascript"> /*页面滚动事件*/ window.onscroll = function () { if(document.documentElement.scrollTop >= document.getElementById('top').offsetHeight ){ document.getElementById('nav').className = 'nav navfix' document.getElementById('menu').style.marginTop="40px" }else{