我有一个页面,其中必须显示动态消息框而不会影响实际页面。此消息框必须出现在与现有内容重叠的页面的右上角。如何在绝对位置右侧放置div
我试过使用position: absolute
但后来我无法将它放在右上角。此外,我无法使用left
,因为我必须支持Bootstrap的响应式设计。
下面是一个示例标记
<html>
<body>
<div class="container">
<!-- Need to place this div at the top right of the page-->
<div class="ajax-message">
<div class="row">
<div class="span9">
<div class="alert">
<a class="close icon icon-remove"></a>
<div class="message-content">
Some message goes here
</div>
</div>
</div>
</div>
</div>
<!-- Page contents starts here. These are dynamic-->
<div class="row">
<div class="span12 inner-col">
<h2>Documents</h2>
</div>
</div>
</div>
</body>
</html>
该消息框应具有50%
的宽度相对于所述.container
和消息框的左侧不应当由它重叠。即我们应该能够点击/选择左侧的内容。
请找到样品here。
请帮我解决这个问题。
http://stackoverflow.com/questions/11333624/css-float-right-and-position-absolute-doesnt-work-together – Nick 2016-01-08 18:57:51