css / html在一个href中左右对齐

时间:2016-02-21 23:05:57

标签: html css

有没有办法让文本的一部分左对齐,另一条右对齐并保持一行?我在类似的问题上尝试了几个类似的答案,但结果并非如此。接近我希望的 示例:TANYA RUMPFF在440px内离开并且在BIRD RIGHT之内 HTML:

div

CSS:

</head>

<div class="dean">
<ul>
  <li><a href="#">TANYA RUMPFF <p align="right">Songs of a bird</p></a></li>
  <li><a href="#">STANCE OONK Bolwerk</a></li>
  <li><a href="#">HARALD VLUGT Voor en na het meesterwerk</a></li>
  <li><a href="#">CORINNE BONSMA Secret garden</a></li>
  <li><a href="#">STEFAN KASPER Glitterkikkerlikker</a></li>
</ul>
</div>

<body>
</body>

2 个答案:

答案 0 :(得分:2)

您可以var startTime = '2016-02-21 18:00'; var endTime = '2016-02-21 19:30'; var hours = moment .duration(moment(endTime, 'YYYY/MM/DD HH:mm') .diff(moment(startTime, 'YYYY/MM/DD HH:mm')) ).asHours(); console.log(hours); // 1.5 第一个元素并使用float

text-align:right;
li a{
  display:block;
  text-align: right;
}
li b {
  float: left;
}

答案 1 :(得分:0)

<强> HTML

var
  LIntent: JIntent;
begin
  LIntent := TJIntent.Create;
  LIntent.setClassName(TAndroidHelper.Context.getPackageName(), TAndroidHelper.StringToJString('com.embarcadero.services.LocationService'));
  TAndroidHelper.Activity.stopService(LIntent);
end;

<强> CSS

<ul>
<div id="textbox">
   <li class="alignleft"><a href="#">TANYA RUMPFF</a></li>
   <li class="alignright"><a href="#">Songs of a bird</a></li>
</div>
<div style="clear: both;"></div>
<div id="textbox">
   <li class="alignleft"><a href="#">STANCE OONK</a></li>
   <li class="alignright"><a href="#">Bolwerk</a></li>
</div>
<div style="clear: both;"></div>
<div id="textbox">
   <li class="alignleft"><a href="#">HARALD VLUGT </a></li>
   <li class="alignright"><a href="#">Voor en na het meesterwerk</a></li>
</div>
<div style="clear: both;"></div>
<div id="textbox">
   <li class="alignleft"><a href="#">CORINNE BONSMA</a></li>
   <li class="alignright"><a href="#">Secret garden</a></li>
</div>
<div style="clear: both;"></div>
</ul>

试试这个。它可能会起作用