简体   繁体   English

HTML TD和其中的Div对齐

[英]Alignment in HTML TD and Div inside it

I have TD tag align = "right" 我有TD标签align = "right"

and one div inside it with align="left" Basically what i want to achieve is 和里面的一个divalign="left"基本上我想要实现的是

  • Align TD contents to right . Align TD内容right Align TD (in this case DIV) (在这种情况下为DIV)
  • But align all content s inside div to left 但是将div所有content s left对齐

but that is not happening here all contents inside div are aligning to right as specified in TD tag. 但这并没有发生,这里div中的所有内容都按照TD标签中的指定向右对齐。

Any body have any idea why?? 有谁知道为什么?

Thank you in advance 先感谢您

Regards, Mona 蒙娜娜

<td align="right">
    <div style="text-align:left;"></div>
</td>

Or using CSS: 或使用CSS:

td[align=right] > div{
   text-align:left;
}

DEMO DEMO

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM