我想像这里一样对齐此文本,但如果我运行此代码,我的较长文本在一行中,文本“我的信息在两行中。如何与宽度有限的更多行对齐?
<html>
<head>
<style>
.div_name p{
position: fixed;
display:inline;
}
.div_city p{
display:inline;
}
.div_info p{
display:inline;
}
div.all_info {
position: absolute;
right: 30%;
width: 200px;
height: 100px;
//border: 3px solid blue;
}
</style>
</head>
<body>
<div class="all_info" align = "right">
<table>
<tr><td align="right" width150px><div class="div_name:">Your name: </td> <td align="left" width=200px><p id="myname">David</p></td></div></tr>
<tr><td align="right" width=150px><div class="div_city:">Your city: </td> <td align="left" width=200px><p id="mycity">Prageu</p></td></div></tr>
<tr><td align="right" width=250px><div class="div_info:">Your Informations: </td> <td align="left" width=200px><p id="myinfo">myinfomyinfomyinfomyinfomyinfomyinfomyinfomyinfomyinfomyinfomyinfomyinfomyinfomyinfo</p></td></div></tr>
</table>
</div>
</body>
</html>
叮当猫咪
浮云间
相关分类