2016-03-16 14 views
-1

我有一个简单的引导弹出模式。现在当弹出窗口出现时,关闭x按钮位于中心,我想将关闭按钮x对齐到弹出窗口的右侧角落。我怎样才能做到这一点?*解决*如何对齐自举弹出模式中的关闭按钮

<div class="modal fade" id="checkNameSurvey-modal" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;"> 
    <div class="modal-dialog"> 
     <div class="loginmodal-container" id="checkNameSurveymodal-container"> 
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 
      <h4 style="text-align:center"></h4><br> 
      <div> 
       <input type="text" class="form-control login-input" id="newSurveyName" onkeyup="if(event.keyCode==13)document.getElementById('checkName-button').click()"> 

       <button type="button" class="btn btn-primary" id="checkName-button"></button> 

      </div> 
     </div> 
    </div> 
</div> 
+1

不知道你的意思是关闭x按钮是“放置在中心”。它似乎在我的右上角:http://www.bootply.com/G1dhDkQyYU –

+1

应用'display:inline-block; text-align-right;'它应该工作,但如果这是放在一个jsfiddle我可以测试其他东西:) – lucasnadalutti

+0

我无法复制你的问题。 [我用这个小提琴来测试它。](https://jsfiddle.net/4castle/jmocnfus/2/)关闭按钮看起来像它已经在右上角。 – 4castle

回答

0

尝试使用'模态头','模态内容'类。通过UI DIALOGS

这里检查模态中的元素。

给予好评,如果有帮助

+0

在答案中包含示例标记,这比链接到主题演示网站更有帮助。 – ZimSystem

0

您可以使用float:right。这可能会将十字按钮移到右侧。

分享模态框的屏幕截图会更有帮助。

0

对不起,我发现了一个错误,关闭X按钮位于中心对齐,因为我把它放在我的班“loginmodal容器”,我有中心的样式表内。所以我解决了这个问题。谢谢

相关问题