2017-06-09 5 views
0

私のナビゲーションメニューの裏付けが必要です。現在は垂直を表示していますが、右上に水平に表示します。私はより伝統的なナビゲーションを水平にする方法を知っていますが、これはツールに3つのセクションがあるブロックを持っています。 Image of pageナビゲーションメニューをインライン化できません

私はツールセクションに変更を加えています。そのドロップダウンにはたくさんのリンクがありますので、私はツールをドロップダウンするようにしようとしていたので、まっすぐドロップダウンとして醜いように見えます。

私が紛失している単純なものではない場合、私はちょうどテンプレートを見つけてそれを使って再構築するかもしれません。ありがとうございました!

<style> 
li { 
list-style-type: none; 
display-inline; 
} 

a { 
font-size: 14pt; 
color: ; 
} 

#tools-title { 
color: #fff; 
} 

#container{ 
width: 45%; 
border: 1px solid #000; 
padding: 15px; 
background-color: #333; 
} 

#left{ 
float:left; 
width:250px; 
border-right: 1px solid #000; 
} 

#left a{ 
display: block; 
} 

#right{ 
float: right; 
width: 250px; 
} 

#right a{ 
display: block; 
} 

#center{ 
margin:0 auto; 
width:250px; 
border-right: 1px solid #000; 
} 

#center a{ 
display: block; 
} 
</style> 

<body> 

<ul class="nav"> 
<li class="nav-list"> 

<ul class="nav-resources"> 
<li class="button-dropdown"> 
    <a href="javascript:void(0)" class="dropdown-toggle"><img src="resources.png" title="Resources"><span>&#9662;</span></a> 
    <ul class="dropdown-menu"> 
     <li> 
     <a href="#" target="_blank">Test Task</a> 
     <a href="#" target="_blank">QA Training</a> 
     <a href="#" target="_blank">App Contact List</a> 
     </li> 
    </ul> 
    </li> 
</ul> 

<ul class="nav-guides"> 
<li class="button-dropdown"> 
    <a href="javascript:void(0)" class="dropdown-toggle"> 
     <img src="info.png" title="Guides"><span>&#9662;</span> 
    </a> 
    <ul class="dropdown-menu"> 
     <li> 
     <a href="Index/howto.html" target="_blank">Edit Links</a> 
     </li> 
    </ul> 
    </li> 
</ul> 

<ul class="nav-tools"> 
<li class="button-dropdown"> 
    <a href="javascript:void(0)" class="dropdown-toggle"><img src="tools.png" title="Tools"><span>&#9662;</span></a> 
     <ul class="dropdown-menu"> 
      <div id="container"> 
      <h3 id="tools-title">Tools Menu</h3> 
       <div id="left"> 
        <li> 
         <a href="#" target="_blank">Application Logger</a> 
         <a href="#" target="_blank">Application Logger Dev</a> 
         <a href="#" target="_blank">Contract Search</a> 
         <a href="#" target="_blank">New Payment Lookup Tool</a> 
         <a href="#" target="_blank">New Payment Lookup Tool Dev</a> 
        </li> 
       </div> 
       <div id="right"> 
        <li> 
         <a href="#" target="_blank">U-Haul Exception Viewer Dev 2</a> 
         <a href="#" target="_blank">Uhaul.net Exception Viewer</a> 
         <a href="#" target="_blank">WB Management</a> 
         <a href="#" target="_blank">WB Management Dev</a> 
        </li> 
       </div> 
       <div id="center"> 
        <li> 
         <a href="#" target="_blank">QA Tool</a> 
         <a href="#" target="_blank">QA Tool Dev</a> 
         <a href="#" target="_blank">U-Haul Exception Viewer</a> 
         <a href="#">U-Haul Exception Viewer Dev</a> 
         <a href="#" target="_blank">U-Haul Exception Viewer 2</a> 
        </li> 
       </div> 
      </div> 
     </ul> 
    </li> 
</ul> 

<ul class="nav-about"> 
<li> 
<a href="#" id="myBtn"><img src="about.png" title="About"></a> 
<!-- The Modal --> 
<div id="myModal" class="modal"> 
<!-- Modal content --> 
    <div class="modal-content"> 
    <div class="modal-header"> 
     <span class="close">&times;</span> 
     <h2>QA Application Hub</h2> 
    </div> 
    <div class="modal-body"> 
     <p>Version: 1.0.0</p> 
     <p>Last updated: 6/7/17</p> 
     <p>Created by: Mark White</p> 
    </div> 
    </div> 
</li> 
</ul> 




<script> 
// Get the modal 
var modal = document.getElementById('myModal'); 

// Get the button that opens the modal 
var btn = document.getElementById("myBtn"); 

// Get the <span> element that closes the modal 
var span = document.getElementsByClassName("close")[0]; 

// When the user clicks the button, open the modal 
btn.onclick = function() { 
    modal.style.display = "block"; 
} 

// When the user clicks on <span> (x), close the modal 
span.onclick = function() { 
    modal.style.display = "none"; 
} 

// When the user clicks anywhere outside of the modal, close it 
window.onclick = function(event) { 
    if (event.target == modal) { 
     modal.style.display = "none"; 
    } 
} 
</script> 

<ul class="nav-mail"> 
<li> 
    <a href="mailto:[email protected]"><img src="mailicon.png" style="width: 32px; height: 40px;" title="Send Mail"></a> 
</li> 
</ul> 

</li> 
</ul> 
</body> 

答えて

1

あなたのHTMLは少しばかりですが、私はそれを訂正しました。

柔軟ボックスは、画面サイズに応じてレンダリングされるように、uldispaly:flex CSSプロパティを追加する必要があり、水平レイアウトであなたのナビゲーションバーを作ること。それは、水平作るん

var modal = document.getElementById('myModal'); 
 

 
// Get the button that opens the modal 
 
var btn = document.getElementById("myBtn"); 
 

 
// Get the <span> element that closes the modal 
 
var span = document.getElementsByClassName("close")[0]; 
 

 
// When the user clicks the button, open the modal 
 
btn.onclick = function() { 
 
    modal.style.display = "block"; 
 
} 
 

 
// When the user clicks on <span> (x), close the modal 
 
span.onclick = function() { 
 
    modal.style.display = "none"; 
 
} 
 

 
// When the user clicks anywhere outside of the modal, close it 
 
window.onclick = function(event) { 
 
    if (event.target == modal) { 
 
     modal.style.display = "none"; 
 
    } 
 
}
.horizontal-nav{ 
 
    display:flex; 
 
    /*float:right;*/ /*If you want all the items on right side */ 
 
} 
 

 
li { 
 
list-style-type: none; 
 
display-inline; 
 
} 
 

 
a { 
 
font-size: 14pt; 
 
color: ; 
 
} 
 

 
#tools-title { 
 
color: #fff; 
 
} 
 

 
#container{ 
 
width: 45%; 
 
border: 1px solid #000; 
 
padding: 15px; 
 
background-color: #333; 
 
} 
 

 
#left{ 
 
float:left; 
 
width:250px; 
 
border-right: 1px solid #000; 
 
} 
 

 
#left a{ 
 
display: block; 
 
} 
 

 
#right{ 
 
float: right; 
 
width: 250px; 
 
} 
 

 
#right a{ 
 
display: block; 
 
} 
 

 
#center{ 
 
margin:0 auto; 
 
width:250px; 
 
border-right: 1px solid #000; 
 
} 
 

 
#center a{ 
 
display: block; 
 
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 
 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
 

 
<ul class="nav horizontal-nav"> 
 
\t 
 
\t <li class="button-dropdown nav-resources"> 
 
\t \t <a href="javascript:void(0)" class="dropdown-toggle"><img src="resources.png" title="Resources"><span>&#9662;</span></a> 
 
\t \t <ul class="dropdown-menu"> 
 
\t \t <li> 
 
\t \t \t <a href="#" target="_blank">Test Task</a> 
 
\t \t <a href="#" target="_blank">QA Training</a> 
 
\t \t <a href="#" target="_blank">App Contact List</a> 
 
\t \t </li> 
 
\t \t </ul> 
 
\t </li> 
 

 
\t <li class="button-dropdown nav-guides"> 
 
\t \t <a href="javascript:void(0)" class="dropdown-toggle"> 
 
\t \t <img src="info.png" title="Guides"><span>&#9662;</span> 
 
\t \t </a> 
 
\t \t <ul class="dropdown-menu"> 
 
\t \t <li> 
 
\t \t \t <a href="Index/howto.html" target="_blank">Edit Links</a> 
 
\t \t </li> 
 
\t \t </ul> 
 
\t </li> 
 

 
\t <li class="button-dropdown nav-tools"> 
 
\t \t <a href="javascript:void(0)" class="dropdown-toggle"><img src="tools.png" title="Tools"><span>&#9662;</span></a> 
 
\t \t <ul class="dropdown-menu"> 
 
\t \t \t <div id="container"> 
 
\t \t \t \t <h3 id="tools-title">Tools Menu</h3> 
 
\t \t \t \t <div id="left"> 
 
\t \t \t \t \t <li> 
 
\t \t \t \t \t \t <a href="#" target="_blank">Application Logger</a> 
 
\t \t \t \t \t \t <a href="#" target="_blank">Application Logger Dev</a> 
 
\t \t \t \t \t \t <a href="#" target="_blank">Contract Search</a> 
 
\t \t \t \t \t \t <a href="#" target="_blank">New Payment Lookup Tool</a> 
 
\t \t \t \t \t \t <a href="#" target="_blank">New Payment Lookup Tool Dev</a> 
 
\t \t \t \t \t </li> 
 
\t \t \t \t </div> 
 
\t \t \t \t <div id="right"> 
 
\t \t \t \t \t <li> 
 
\t \t \t \t \t \t <a href="#" target="_blank">U-Haul Exception Viewer Dev 2</a> 
 
\t \t \t \t \t \t <a href="#" target="_blank">Uhaul.net Exception Viewer</a> 
 
\t \t \t \t \t \t <a href="#" target="_blank">WB Management</a> 
 
\t \t \t \t \t \t <a href="#" target="_blank">WB Management Dev</a> 
 
\t \t \t \t \t </li> 
 
\t \t \t \t </div> 
 
\t \t \t \t <div id="center"> 
 
\t \t \t \t \t <li> 
 
\t \t \t \t \t \t <a href="#" target="_blank">QA Tool</a> 
 
\t \t \t \t \t \t <a href="#" target="_blank">QA Tool Dev</a> 
 
\t \t \t \t \t \t <a href="#" target="_blank">U-Haul Exception Viewer</a> 
 
\t \t \t \t \t \t <a href="#">U-Haul Exception Viewer Dev</a> 
 
\t \t \t \t \t \t <a href="#" target="_blank">U-Haul Exception Viewer 2</a> 
 
\t \t \t \t \t </li> 
 
\t \t \t \t </div> 
 
\t \t \t </div> 
 
\t \t </ul> 
 
\t </li> 
 

 
\t <li class="nav-about"> 
 
\t \t <a href="#" id="myBtn"><img src="about.png" title="About"></a> 
 
\t \t <!-- The Modal --> 
 
\t \t <div id="myModal" class="modal"> 
 
\t \t <!-- Modal content --> 
 
\t \t <div class="modal-content"> 
 
\t \t 
 
\t \t \t <div class="modal-header"> 
 
\t \t \t <span class="close">&times;</span> 
 
\t \t \t <h2>QA Application Hub</h2> 
 
\t \t \t </div> 
 
\t \t \t <div class="modal-body"> 
 
\t \t \t <p>Version: 1.0.0</p> 
 
\t \t \t <p>Last updated: 6/7/17</p> 
 
\t \t \t <p>Created by: Mark White</p> 
 
\t \t \t </div> 
 
\t \t </div> 
 
\t \t </div> 
 
\t </li> 
 

 
\t <li class="nav-mail"> 
 

 
\t \t <a href="mailto:[email protected]"><img src="mailicon.png" style="width: 32px; height: 40px;" title="Send Mail"></a> 
 
\t </li> 
 

 

 
</ul>

+0

それの問題は、それがツールメニューのドロップダウンのレイアウトを変更しています。 最終目標は水平メニューで、元の質問に追加した画像と同じメニューがドロップダウンメニューに表示されます。 –

+0

'tools'ドロップダウンで試したことが間違っているので、CSSの変更を加えてみてください。 –

関連する問題