2016-02-23 25 views
0

我正在構建一個個人網站,對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>

我對所有的專家第一個問題,我怎麼包長句在我的下拉在多個句子菜單?我不擔心大屏幕,但在標準的Android手機上它看起來很可怕。

我的第二個問題是在移動設備上當導航欄是菜單下拉菜單。如何確保導航欄在用戶單擊菜單項後縮回或關閉或摺疊。現在我必須切換屏幕右上角的圖標以縮小或摺疊下拉菜單。

我將不勝感激任何幫助。

回答

0

通過在段落標籤之間添加第二行,您可以非常輕鬆地做到這一點。 像這樣:http://jsfiddle.net/ycUB6/10706/

<a href="#SAMPLE" style="font-weight: bold">This is a very long sentence which 
    <p>I need to divide into two line.Is it possible</p></a> 
相關問題