[英]How to display the text left and right side at the bottom if div is the center of the screen
[英]How do I move a div over to the right side of the screen but have the text align of the left border of the div?
这是我的代码:
<div id="Notify" style="clear:both;">
<div style="text-align:right;">
<div style="text-align:left;">
Send Table to Standards By Email. (everything below is a placeholder)
<br /><br />
Saved at: @DateTime.Now.ToString()
<br />
Saved by: 107
<br /><br />
<input type="submit" value="Send Email" />
</div>
</div>
</div>
<br />
<br />
<div id="PTable">
Products Table Placeholder
</div>
当我尝试这个时,一切都与左边对齐。 如果我使用float:right,那么PTable和Notify是并排的。 而不是PTable低于通知。
我想要的是:在顶部通知并且其内部div中的所有文本在内部div的左边界上对齐。 Notify下的PTable对齐浏览器的安装方式。
你想使用float: right
然后text-align: left
on div#Notify
来实现这个效果。 此外,为确保PTable不会显示在Notify旁边,请使用clear: both
。
#Notify, #PTable {
clear: both;
}
#Notify {
float: right;
text-align: left;
}
JS小提琴: http : //jsfiddle.net/SDDG2/2/
这似乎工作!
<div id="Notify" style="clear:both;">
<div style="float:right;">
<div style="text-align:left;">
Send Table to Standards By Email. (everything below is a placeholder)
<br /><br />
Saved at: @DateTime.Now.ToString()
<br />
Saved by: 107
<br /><br />
<input type="submit" value="Send Email" />
</div>
</div>
</div>
<br />
<br />
<div id="PTable" style="clear:both;">
Products Table Placeholder
</div>
您需要为Notify div指定固定宽度,这将确保PTable不在其旁边。
你可以移动div的div上面为ex: -
$( “#亲本”)前置($( “#外”));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.