【发布时间】:2016-02-23 11:39:48
【问题描述】:
我正在建立一个个人网站,并且对 html 很陌生。我的导航栏看起来像
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bob Mandal | Projects</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="MyWebsiteScript.js"></script>
<link rel="stylesheet" href="MyStyleSheet.css" />
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<!---logo-->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#mainNavBar">
<span class="icon-bar"> </span>
<span class="icon-bar"> </span>
<span class="icon-bar"> </span>
</button>
<a class="navbar-brand" style="font-weight: bold">Bob Mandal</a>
</div>
<!--menu Item here-->
<div class="collapse navbar-collapse" id="mainNavBar">
<ul class="nav navbar-nav">
<li>
<a href="#" style="font-weight: bold">About Me</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" style="font-weight: bold">Curriculum Vitae<span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
<a href="#" target="_blank" style="font-weight: bold">CV</a>
</li>
<li>
<a href="#" target="_blank" style="font-weight: bold">Resume</a>
</li>
</ul>
</li>
<li class="active dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" style="font-weight: bold">Projects<span class="caret"></span></a>
<ul class="dropdown-menu project-menu">
<li style="text-align: center">
<a href="#Pilot" style="font-weight: bold" class="sidebarlink">Research</a>
</li>
<li style="text-align: center">
<a href="#PIRAT" style="font-weight: bold">Arrrgh</a>
</li>
<li style="text-align: center">
<a href="#SAMPLE" style="font-weight: bold">This is a very long sentence which I need to divide into two line.Is it possible?</a>
</li>
<li style="text-align: center">
<a href="#Quad" style="font-weight: bold">Quad</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" style="font-weight: bold">Contact</a>
</li>
<li id="linkedIn">
<a href="#" width="22px" />Linked in</a>
</li>
</ul>
</div>
</div>
</nav>
</body>
我向所有专家提出的第一个问题是,如何将下拉菜单中的长句包装成多个句子?我不担心大屏幕,但在标准的安卓手机上它看起来很可怕。
当导航栏是类似菜单的下拉菜单时,我的第二个问题是在移动设备上。如何确保导航栏在用户单击菜单项后缩回或关闭或折叠。现在我必须切换屏幕右上角的图标来收回或折叠下拉菜单。
我将不胜感激。
【问题讨论】:
标签: html css twitter-bootstrap