竖排文字如何居中

sfhwmz 2010-09-28 03:31:30
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><table width="40" height="430" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/27.jpg"><DIV class="STYLE3" style="WRITING-MODE:tb-rl; width:39px; height:340px; text-align:center" >
粮食是我们的主食,是人类生存的最基本的物质
</DIV></td>
</tr>
</table>
</td>
</tr>
</table>
...全文
451 22 打赏 收藏 转发到动态 举报
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
sfhwmz 2010-10-08
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 dd0607 的回复:]
firefox 不支持writing-mode
[/Quote]
firefox 是 火狐吧
我用的是360浏览器
木头是猫 2010-10-08
  • 打赏
  • 举报
回复
先上传到可外链图片的空间 然后在这里贴图
sfhwmz 2010-10-08
  • 打赏
  • 举报
回复
谁能告诉我如何才能把本地图片传上来啊
木头是猫 2010-10-08
  • 打赏
  • 举报
回复
firefox 不支持writing-mode
sfhwmz 2010-10-08
  • 打赏
  • 举报
回复
上面各位所说的还是不对
木头是猫 2010-10-08
  • 打赏
  • 举报
回复
[Quote=引用 20 楼 dd0607 的回复:]
引用 19 楼 dd0607 的回复:
大致就是

内容层bb放在顶部(z_index:999),使用了绝对定位(相对层bb在底部)

通过JS计算出层aa的margin-left,然后赋值过去,使层bb相对层aa往左移位

层aa的margin-left等于(层aa宽度-层bb宽度)/2


厄 写错了 应该是

内容层bb放在顶部(z_index:999),使用了绝对定……
[/Quote]

= =! 又错了 ,, 果然表达能力有问题,,,是往右移动
narcyzuo 2010-10-08
  • 打赏
  • 举报
回复
新手学习
木头是猫 2010-10-08
  • 打赏
  • 举报
回复
[Quote=引用 19 楼 dd0607 的回复:]
大致就是

内容层bb放在顶部(z_index:999),使用了绝对定位(相对层bb在底部)

通过JS计算出层aa的margin-left,然后赋值过去,使层bb相对层aa往左移位

层aa的margin-left等于(层aa宽度-层bb宽度)/2
[/Quote]

厄 写错了 应该是

内容层bb放在顶部(z_index:999),使用了绝对定位(相对层aa在底部)

通过JS计算出层bb的margin-left,然后赋值过去,使层bb相对层aa往左移位

层bb的margin-left等于(层aa宽度-层bb宽度)/2
木头是猫 2010-10-08
  • 打赏
  • 举报
回复
大致就是

内容层bb放在顶部(z_index:999),使用了绝对定位(相对层bb在底部)

通过JS计算出层aa的margin-left,然后赋值过去,使层bb相对层aa往左移位

层aa的margin-left等于(层aa宽度-层bb宽度)/2
sfhwmz 2010-10-08
  • 打赏
  • 举报
回复
[Quote=引用 16 楼 dd0607 的回复:]
HTML code
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><table width="40" height="430" border="0" cellspacing="0" cellpadding="0">
<tr>
<td backg……
[/Quote]
这个可以 谢谢了!
能给解释下为什么这么写吗
木头是猫 2010-10-08
  • 打赏
  • 举报
回复
用了一个变通的方法使之水平居中

但writing-mode只支持IE (360调用的是IE内核),火狐和谷歌都不支持

所以这方法在火狐和谷歌下无效

木头是猫 2010-10-08
  • 打赏
  • 举报
回复
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><table width="40" height="430" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/27.jpg"><DIV class="STYLE3" style=" width:39px; height:340px;" id="aa">
<div style="WRITING-MODE:tb-rl; width:auto; height:100%; position:absolute;z_index:999;" id="bb">粮食是我们的主食,是人类生存的最基本的物质</div>
</DIV></td>
</tr>
</table>
</td>
</tr>
</table>
<script language="JavaScript">
document.getElementById("bb").style.marginLeft = (document.getElementById("aa").offsetWidth - document.getElementById("bb").offsetWidth)/2;
</script>
ChinaXtHuLang 2010-09-30
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 admim888 的回复:]

CSS *(定义全局){text-align="center"}
[/Quote]
顶起哥
admim888 2010-09-30
  • 打赏
  • 举报
回复
CSS *(定义全局){text-align="center"}
admim888 2010-09-30
  • 打赏
  • 举报
回复
CSS *(定义全局){text-align="center"}
ChinaXtHuLang 2010-09-29
  • 打赏
  • 举报
回复
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="64" height="430" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="images/27.jpg" align="center">
<div align="center">粮食是我们的主食,是人类生存的最基本的物质
</div></td>
</tr>
</table>
</td>
</tr>
</table>
jianchongs 2010-09-29
  • 打赏
  • 举报
回复
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="64" height="430" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="images/27.jpg">
<div align="center">粮食是我们的主食,是人类生存的最基本的物质
</div></td>
</tr>
</table>
</td>
</tr>
</table>
jianchongs 2010-09-29
  • 打赏
  • 举报
回复
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><table width="40" height="430" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="images/27.jpg"><DIV class="STYLE3" style="WRITING-MODE:tb-rl; width:39px; height:340px; text-align:center" >
粮食是我们的主食,是人类生存的最基本的物质
</DIV>
jz123cn 2010-09-29
  • 打赏
  • 举报
回复
新手学习
sfhwmz 2010-09-28
  • 打赏
  • 举报
回复
这么写还是原来的样子
靠右边
加载更多回复(2)

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧