2016-08-14 26 views
0

私は正しい場所にすべてを持っているようです。スマートフォンでブートストラップNavbarが崩壊しない

頭にあります。ビューポートのメタタグません(私が試していないが、運)右終了タグ上記

<title>My Title for Webpage</title> 

<link href="css/bootstrap.min.css" rel="stylesheet" /> 

ここ

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> 
    <script src="js/bootstrap.min.js"></script> 
</body> 

は、ナビゲーションバーのHTMLここ

<div class="navbar navbar-default navbar-fixed-top" style="border: 1px solid red; 
    padding-left: 20px; padding-right: 30px;"> 
    <div class="navbar-header"> 
     <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> 
      <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span><span 
       class="icon-bar"></span><span class="icon-bar"></span> 
     </button> 
     <a class="navbar-brand" href="#"><span class="title">Portland Dancing</span></a> 
    </div> 
    <div class="navbar-collapse collapse" style="max-height: 100%;"> 
     <ul class="nav navbar-nav navbar-left"> 
      <li> 
       <asp:DropDownList ID="ddlChoose" runat="server" AutoPostBack="true" CssClass="form-control" 
        EnableViewState="false" DataTextField="DanceStyle" DataValueField="DanceStyle"> 
       </asp:DropDownList> 
      </li> 
      <li> 
       <asp:DropDownList ID="ddlChooseDateRanges" runat="Server" AutoPostBack="true" CssClass="form-control" 
        OnSelectedIndexChanged="DateRangePullDownHandler" EnableViewState="false"> 
        <asp:ListItem Value="All Days">All Days</asp:ListItem> 
        <asp:ListItem Value="Christmas">Christmas</asp:ListItem> 
        <asp:ListItem Value="New Years Eve">New Year's Eve</asp:ListItem> 
        <asp:ListItem Value="Today">Today</asp:ListItem> 
        <asp:ListItem Value="Tomorrow">Tomorrow</asp:ListItem> 
        <asp:ListItem Value="Today Tomorrow">Today Tomorrow</asp:ListItem> 
        <asp:ListItem Value="This Weekend">This Weekend</asp:ListItem> 
        <asp:ListItem Value="Next Weekend">Next Weekend</asp:ListItem> 
        <asp:ListItem Value="This Week">This Week</asp:ListItem> 
        <asp:ListItem Value="Fridays">Fridays</asp:ListItem> 
        <asp:ListItem Value="Saturdays">Saturdays</asp:ListItem> 
        <asp:ListItem Value="Sundays">Sundays</asp:ListItem> 
        <asp:ListItem Value="Mondays">Mondays</asp:ListItem> 
        <asp:ListItem Value="Tuesdays">Tuesdays</asp:ListItem> 
        <asp:ListItem Value="Wednesdays">Wednesdays</asp:ListItem> 
        <asp:ListItem Value="Thursdays">Thursdays</asp:ListItem> 
        <asp:ListItem Value="Before 1pm">Before 1pm</asp:ListItem> 
        <asp:ListItem Value="Before 3pm">Before 3pm</asp:ListItem> 
        <asp:ListItem Value="Before 6pm">Before 6pm</asp:ListItem> 
        <asp:ListItem Value="Before 9pm">Before 9pm</asp:ListItem> 
       </asp:DropDownList> 
      </li> 
     </ul> 
     <ul class="nav navbar-nav navbar-right"> 
      <li> 
       <asp:LinkButton ID="lnkPrint" Style="margin-bottom: 5px; padding: 6px 0px;" CssClass="form-control" 
        CausesValidation="False" BackColor="#f6f2dc" ForeColor="Black" runat="server" 
        EnableViewState="false" title="Make your choices with the checkboxes and then Print them">Print</asp:LinkButton> 
      </li> 
      <li> 
       <asp:LinkButton ID="lnkEmail" Style="margin-bottom: 5px; padding: 6px 0px;" CssClass="form-control" 
        runat="server" CausesValidation="False" BackColor="#f6f2dc" ForeColor="Black" 
        EnableViewState="false" title="Make your choices with the checkboxes and then Email them"> 
      Email 
       </asp:LinkButton></li> 
      <li> 
       <asp:DropDownList ID="ddlAgesPrice" runat="Server" AutoPostBack="true" OnSelectedIndexChanged="AgesPricePulldownHandler" 
        CssClass="form-control" EnableViewState="false" Style="text-align: center;"> 
        <asp:ListItem Value="Ages, Price" Enabled="false">(Ages, Price)</asp:ListItem> 
        <asp:ListItem Value="All, All">All, All</asp:ListItem> 
        <asp:ListItem Value="All, Free">All, Free</asp:ListItem> 
        <asp:ListItem Value="Under 21, All">Under 21, All</asp:ListItem> 
        <asp:ListItem Value="Under 21, Free">Under 21, Free</asp:ListItem> 
        <asp:ListItem Value="Over 50, All">Over 50, All</asp:ListItem> 
        <asp:ListItem Value="Over 50, Free">Over 50, Free</asp:ListItem> 
       </asp:DropDownList> 
      </li> 
      <li> 
       <asp:CheckBox ID="chkInflate" CssClass="form-control" EnableViewState="True" AutoPostBack="True" 
        BackColor="#f6f2dc" ForeColor="Black" Style="margin-bottom: 5px;" runat="Server" 
        ToolTip="Check/Uncheck the box to have all the names expand with more info on this web page. Or go over and click on an event name to pop up a whole bunch of information."> 
       </asp:CheckBox></li> 
      <li> 
      <a href="emailus.aspx" class="form-control" style="color: black; background-color: #f6f2dc; margin-bottom: 7px; font-size: 14px; padding: 6px 0px;" target="_blank" title="Do you have a dance to list? Problem with a listing? Advice for us? Click here to email us. Classes and workshops are in a different area: Learn Stuff"> 
       Contact</a> 
      </li> 
      <li> 
      <a href="learn.aspx" target="_blank" class="form-control" style="font-weight: bold; 
       margin-bottom: 7px; color: Red; background-color: #f6f2dc; font-size: 14px; padding: 6px 0px;" 
       title="You must click here to see the Lessons, Worksops, and Gatherings, Private Lessons."> 
       Lessons</a> 
      </li> 
     </ul> 
    </div> 
</div> 

ありませChromeデベロッパーツールを使用してiphone 5で表示されるものです。これは私のiphone6plusでも同じです。それは崩壊し、右にトグルボタンを表示する必要があります。ここでは

Navbar collapsed to iphone5 size

は、Chromeデベロッパーツールを使用して、通常のブラウザのサイズ(ノートPC)です。設計されたよう:何面白いです、私は混乱しているが現れると作品私は窓やトグルボタンの右側にドラッグして、私のChromeブラウザウィンドウを縮小することができるということです

Regular/Laptop browser size

。私はかなり正しいことをしていることをちょっと示しています。 。 。私は私のiPhone6plus

Window shrink navbar

に試してみて、私も自分のliタグを崩壊し、より良いものを参照するために努力してスクリーン印刷をしたまで:

enter image description here

+0

ビューポートを設定してみてくださいと設計されていていること: '<メタ名=「ビューポート」コンテンツ="幅=デバイス幅、初期スケール= 1.0 "/>'。 – Karin

+0

あなたが提供したスニペットとともに、完全なソースコードを投稿してください。問題を見つけるのがかなり難しいでしょう。 – Derek

+0

@カリンあなたは正しいです!ねえ、私はviewoportで前に問題がありました。この質問を編集しているうちに、あなたはそれに答えました。速かった人。もしそれがヘビだったら、それは私にちょっとしたものだ。しかしながら。 。 。それをアップロードしてスマートフォンの電話で開く必要があります。これは私の電話で動作する場合、私はそれを受け入れることができるように答えてください。ありがとうございます – JustJohn

答えて

0

私はあなたを推測しますこれを見逃します<meta name="viewport" content="width=device-width, initial-scale=1">


 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
 
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 
 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> 
 
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
 

 
<div class="navbar navbar-default navbar-fixed-top" style="border: 1px solid red; 
 
    padding-left: 20px; padding-right: 30px;"> 
 
    <div class="navbar-header"> 
 
     <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> 
 
      <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span><span 
 
       class="icon-bar"></span><span class="icon-bar"></span> 
 
     </button> 
 
     <a class="navbar-brand" href="#"><span class="title">Portland Dancing</span></a> 
 
    </div> 
 
    <div class="navbar-collapse collapse" style="max-height: 100%;"> 
 
     <ul class="nav navbar-nav navbar-left"> 
 
      <li> 
 
       <asp:DropDownList ID="ddlChoose" runat="server" AutoPostBack="true" CssClass="form-control" 
 
        EnableViewState="false" DataTextField="DanceStyle" DataValueField="DanceStyle"> 
 
       </asp:DropDownList> 
 
      </li> 
 
      <li> 
 
       <asp:DropDownList ID="ddlChooseDateRanges" runat="Server" AutoPostBack="true" CssClass="form-control" 
 
        OnSelectedIndexChanged="DateRangePullDownHandler" EnableViewState="false"> 
 
        <asp:ListItem Value="All Days">All Days</asp:ListItem> 
 
        <asp:ListItem Value="Christmas">Christmas</asp:ListItem> 
 
        <asp:ListItem Value="New Years Eve">New Year's Eve</asp:ListItem> 
 
        <asp:ListItem Value="Today">Today</asp:ListItem> 
 
        <asp:ListItem Value="Tomorrow">Tomorrow</asp:ListItem> 
 
        <asp:ListItem Value="Today Tomorrow">Today Tomorrow</asp:ListItem> 
 
        <asp:ListItem Value="This Weekend">This Weekend</asp:ListItem> 
 
        <asp:ListItem Value="Next Weekend">Next Weekend</asp:ListItem> 
 
        <asp:ListItem Value="This Week">This Week</asp:ListItem> 
 
        <asp:ListItem Value="Fridays">Fridays</asp:ListItem> 
 
        <asp:ListItem Value="Saturdays">Saturdays</asp:ListItem> 
 
        <asp:ListItem Value="Sundays">Sundays</asp:ListItem> 
 
        <asp:ListItem Value="Mondays">Mondays</asp:ListItem> 
 
        <asp:ListItem Value="Tuesdays">Tuesdays</asp:ListItem> 
 
        <asp:ListItem Value="Wednesdays">Wednesdays</asp:ListItem> 
 
        <asp:ListItem Value="Thursdays">Thursdays</asp:ListItem> 
 
        <asp:ListItem Value="Before 1pm">Before 1pm</asp:ListItem> 
 
        <asp:ListItem Value="Before 3pm">Before 3pm</asp:ListItem> 
 
        <asp:ListItem Value="Before 6pm">Before 6pm</asp:ListItem> 
 
        <asp:ListItem Value="Before 9pm">Before 9pm</asp:ListItem> 
 
       </asp:DropDownList> 
 
      </li> 
 
     </ul> 
 
     <ul class="nav navbar-nav navbar-right"> 
 
      <li> 
 
       <asp:LinkButton ID="lnkPrint" Style="margin-bottom: 5px; padding: 6px 0px;" CssClass="form-control" 
 
        CausesValidation="False" BackColor="#f6f2dc" ForeColor="Black" runat="server" 
 
        EnableViewState="false" title="Make your choices with the checkboxes and then Print them">Print</asp:LinkButton> 
 
      </li> 
 
      <li> 
 
       <asp:LinkButton ID="lnkEmail" Style="margin-bottom: 5px; padding: 6px 0px;" CssClass="form-control" 
 
        runat="server" CausesValidation="False" BackColor="#f6f2dc" ForeColor="Black" 
 
        EnableViewState="false" title="Make your choices with the checkboxes and then Email them"> 
 
      Email 
 
       </asp:LinkButton></li> 
 
      <li> 
 
       <asp:DropDownList ID="ddlAgesPrice" runat="Server" AutoPostBack="true" OnSelectedIndexChanged="AgesPricePulldownHandler" 
 
        CssClass="form-control" EnableViewState="false" Style="text-align: center;"> 
 
        <asp:ListItem Value="Ages, Price" Enabled="false">(Ages, Price)</asp:ListItem> 
 
        <asp:ListItem Value="All, All">All, All</asp:ListItem> 
 
        <asp:ListItem Value="All, Free">All, Free</asp:ListItem> 
 
        <asp:ListItem Value="Under 21, All">Under 21, All</asp:ListItem> 
 
        <asp:ListItem Value="Under 21, Free">Under 21, Free</asp:ListItem> 
 
        <asp:ListItem Value="Over 50, All">Over 50, All</asp:ListItem> 
 
        <asp:ListItem Value="Over 50, Free">Over 50, Free</asp:ListItem> 
 
       </asp:DropDownList> 
 
      </li> 
 
      <li> 
 
       <asp:CheckBox ID="chkInflate" CssClass="form-control" EnableViewState="True" AutoPostBack="True" 
 
        BackColor="#f6f2dc" ForeColor="Black" Style="margin-bottom: 5px;" runat="Server" 
 
        ToolTip="Check/Uncheck the box to have all the names expand with more info on this web page. Or go over and click on an event name to pop up a whole bunch of information."> 
 
       </asp:CheckBox></li> 
 
      <li> 
 
      <a href="emailus.aspx" class="form-control" style="color: black; background-color: #f6f2dc; margin-bottom: 7px; font-size: 14px; padding: 6px 0px;" target="_blank" title="Do you have a dance to list? Problem with a listing? Advice for us? Click here to email us. Classes and workshops are in a different area: Learn Stuff"> 
 
       Contact</a> 
 
      </li> 
 
      <li> 
 
      <a href="learn.aspx" target="_blank" class="form-control" style="font-weight: bold; 
 
       margin-bottom: 7px; color: Red; background-color: #f6f2dc; font-size: 14px; padding: 6px 0px;" 
 
       title="You must click here to see the Lessons, Worksops, and Gatherings, Private Lessons."> 
 
       Lessons</a> 
 
      </li> 
 
     </ul> 
 
    </div> 
 
</div>
012私のコメントで述べたように

+0

オリジナルの投稿から*「頭の中でビューポートのメタタグはありませんでした。(運が良かったのですが」)* – Derek

+0

@Head Cloudで、私はビューポートについてのコメントを追加する質問を編集していたので、私。このような迅速な対応に感謝し、私をあきらめないでください。 – JustJohn

2

headセクションに<meta name="viewport" content="width=device-width, initial-scale=1.0">を追加すると、あなたの問題を解決する必要があります。あなたは、ビューポートhereについての詳細を読むことができますが、お持ち帰りは次のとおりです。

幅=装置幅部分は、デバイスによって異なりますデバイスの 画面幅を(フォローするページの幅を設定します)。

が最初にブラウザによって読み込まれたとき、初期スケール= 1.0の部分が初期ズームレベルを設定します。

だから、これは携帯電話は、あなたのWebページを押しつぶしていないために知ることができますし、それは心のモバイルスケーリング:)

+0

私はこの長い2日間、物事を働かせようとしている間に、それらの説明にすべて遭遇しました。ありがとうGoogleとスタックオーバーフロー。私はそれが私の収縮した画面のボディ部分を台無しにしていたと思うし、それは別のベッド時間の別の話です。一度に1つの小さなステップ。ありがとう@カリン。 。 .. man、古いasp.net webformsウェブサイトを反応させるのは難しいです。悪魔は詳細です。私は、定型的なブートストラップ・テンプレートの「スキニー・アンダーフィード」の外観に行くことができると思います。 Boot Strapの略語は次のとおりです。 。 。 。 。 。 – JustJohn

関連する問題