2014-03-26 42 views
0

我有以下HTML。我想修復「查看全部」錨標籤在特定位置的位置。相反,錨點標記會隨着下拉列表中的值的變化而變化(即根據下拉中更改的值的長度)。在特定點修復了html定位標記

<div class="row " style="margin-left:75pt;"> 
      <div class="dropdown" style="width:300px;display:inline;"> 
       <label class="text-center" id ="categories" style="margin-top:10pt;font-size:14pt;"> Deals on</label>&nbsp; 
       <button data-toggle="dropdown" class=" btn dropdown-toggle dropdown-menu-hover-color text-center" style="padding:0px 0px;background-color:white;" href="#"><label style="font-size:14pt; color: #191970;" >{{currentCategory}}</label>&nbsp;<b class="caret"></b></button> 
       <ul class="dropdown-menu submenu-hover-color dropdown-menu-scroll" style="margin:0;"> 
        <li> 
         <a href="#" id="{{page.category_id}}" ng-click="changeCategory(page.category_id);" ng-repeat="page in dropdownCategoryList" ng-model="category_id">{{page.category_name}}</a> 
        </li> 
       </ul> 
      </div> 
      <div style="display:inline;" ng-show="deals"><a href="#" class="view-all-category"> View All</a></div> 
      <div style="display:inline;" ng-hide="deals">&nbsp;&nbsp;<label class="text-center" style="margin-top:10pt;font-size:12pt;color: #909090;;">No deals found, please select a different category. </label></div>  
     </div> 

任何關於如何實現這一點的指針。 在此先感謝。

+0

你是否試過讓你的'ul.dropdown-menu'有'position:absolute'? – David

+0

@David ul.dropdown-menu有位置:絕對。因此它不起作用。 – tushR

回答

0

嘗試使用下面的HTML:

<div style="display:inline; position: fixed; top: 100px;" ng-show="deals"><a href="#" class="view-all-category"> View All</a></div> 

設置 '頂' 值根據自己的需要。我認爲它應該可以幫助你。

+0

我不希望錨標籤隨頁面滾動而移動。我只想將錨標籤放在頁面上的特定位置,而不考慮頁面上的其他元素。 – tushR