html 之 td valign 和 align

本文介绍了HTML中的align和valign属性,分别用于实现水平和垂直方向上的内容对齐。align属性支持left、right和center值,而valign属性支持top、bottom、middle和baseline值。文章还提到了这些属性在不同HTML标准中的兼容性和替代方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、align属性趋向于左右对齐,其值包含:left、right、center

2、valign属性趋向于垂直对齐,其值包含:top、bottom、middle、baseline

兼容性

在 HTML 4.01 中,不赞成使用 body 元素的 align 属性;在 XHTML 1.0 Strict DTD 中,不支持 body
元素的 align 属性。请使用CSS中的float属性代替。

所有浏览器都支持 valign 属性。

转载于:https://www.cnblogs.com/zmztya/p/8151468.html

下面这段是PHP5.6,如何改成PHP8.4? <?php require_once("include/global.php"); ?> <html> <head> <?php echo getMeta('gb') ?> <title><?php echo $_GLOBAL_CONF['SITE_NAME'] ?></title> </head> <link rel="stylesheet" href="/common.css" type="text/css"> <style> a {color:#616651} .img1 {border:solid 0 black} </style> <BODY link=#cc0000 leftMargin=0 topMargin=0 marginwidth="0" marginheight="0"> <?php require_once("include/header.php"); ?> <?php /* <div id=ad_dl01 style="z-index:1; visibility:visible; width:100px; position:absolute; top:115px; right:5px;"> <table border=0 cellspacing=0 cellpadding=0 width=300 style="table-layout:fixed; word-break:break-all" bgcolor=#d3e9FF> <tr> <td><iframe width="300" height="200" style="border: solid 1px black; width: 600px; height: 30px;" frameborder="0"></iframe></td> </tr> </table> </div> <script type=text/javascript> var step_ratio = 0.1; objs = new Array(); objs_x = new Array(); objs_y = new Array(); function addfollowmark(name, x, y) { i = objs.length; objs[i] = document.getElementById(name); objs_x[i] = x; objs_y[i] = y; } function followmark() { for(var i=0; i<objs.length; i++) { var fm = objs[i]; var fm_x = typeof(objs_x[i]) == 'string' ? eval(objs_x[i]) : objs_x[i]; var fm_y = typeof(objs_y[i]) == 'string' ? eval(objs_y[i]) : objs_y[i]; if (fm.offsetLeft != document.body.scrollLeft + fm_x) { var dx = (document.body.scrollLeft + fm_x - fm.offsetLeft) * step_ratio; dx = (dx > 0 ? 1 : -1) * Math.ceil(Math.abs(dx)); fm.style.left = fm.offsetLeft + dx; } if (fm.offsetTop != document.body.scrollTop + fm_y) { var dy = (document.body.scrollTop + fm_y - fm.offsetTop) * step_ratio; dy = (dy > 0 ? 1 : -1) * Math.ceil(Math.abs(dy)); fm.style.top = fm.offsetTop + dy; } fm.style.display = ''; } } addfollowmark("ad_dl01", "document.body.clientWidth-305", 115); setInterval('followmark()',20); </script> */ ?> <center> <table width=95% border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="2"><img src="images/tb_left.jpg" width="2" height="28" /></td> <td background="images/tb_bg.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php if($_SESSION['ss_admin']>0) echo " <form name=loginform method=post action=/login.php> <input type=hidden name=username value='$ss_name'> <input type=hidden name=password value='$ss_password'> "; ?> <tr> <td width="9"> </td> <td width=111><table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="2"><img src="images/tb_sel_left.jpg" width="2" height="28" /></td> <td width="124" align="center" background="images/tb_sel_bg.jpg" class="selmenu">首页 Home</td> <td width="4"><img src="images/tb_sel_right.jpg" width="4" height="28" /></td> </tr> </table></td> <td align="center"><a href=/search.php class="menu">产品 Products</a></td> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/newest class="menu">新产品 New Products</a></td> <td align="center"><span class="bai">|</span></td> <?php /* <td align="center"><a href=/cart.php class="menu">Order</a></td> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/guestbook class="menu">Guestbook</a></td> <td align="center"><span class="bai">|</span></td>*/ ?> <td align="center"><a href=/help/about.php class="menu">联系我们 Contact us</a></td> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/register class="menu">注册 Register</a></td> <?php if($_SESSION['ss_admin']>0){ ?> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/admin class="menu" target=_blank>Admin</a> <input type=submit value=ReLogin style=cursor:hand></td> <?php } ?> <?php if($_SESSION['ss_userid']>0){ ?> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/bill class="menu">Bills</a></td> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/logout.php class="menu">退出 Logout</a></td> <?php }else{ ?> <td align="center"><span class="bai">|</span></td> <td align="center"><a href=/login.php class="menu">登录 Login</a></td> <?php } ?> </tr> <?php if($_SESSION['ss_admin']>0) echo " </form> "; ?> </table></td> <td width="2"><img src="images/tb_right.jpg" width="2" height="28" /></td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <form name=searchform action=search.php method=post> <tr> <td width="6"><img src="images/tb_bt_left.jpg" width="6" height="62" /></td> <td background="images/tb_bt_bg.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="266" align="center" valign="top" class="vd" style="font-size:11px;color:#333333"></td> <td height="58" align="center"><select name=key> <option value=model_no <? if($key == "model_no") echo "selected"; ?>>型号 Model No.</option> <option value=name <? if($key == "name") echo "selected"; ?>>名称 Name</option> <option value=features <? if($key == "features") echo "selected"; ?>>规格 Features</option> <option value=description <? if($key == "description") echo "selected"; ?>>说明 Descriptions</option> <option value=fob_port <? if($key == "fob_port") echo "selected"; ?>>港口 Fob Port</option> <option value=color <? if($key == "color") echo "selected"; ?>>颜色 Color</option> <option value=matial <? if($key == "matial") echo "selected"; ?>>材料 Matial</option> </select> 关键词 Keyword:<input type=text size=5 name=value value="<?php echo $value?>"> 产品号 ProductID:<input type=text size=5 name=productid value="<?php echo $productid?>"> <input type=hidden name=typeid value="<?php echo $typeid?>"> <input type=submit name=sub6 value="查找 Search"></td> </tr> </table></td> <td width="7"><img src="images/tb_bt_right.jpg" width="7" height="62" /></td> </tr> </form> </table></td> </tr> </table> <table width=95% border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td valign="top" width=350><table width="100%" height="160" border="0" cellpadding="1" cellspacing="1" bgcolor="#F3F1E7"> <tr> <td valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding=5> <tr> <td height="22" align="left" bgcolor="#E7E4D2"></td> </tr> <tr> <td height="350" align="left" class="vd"><FONT style=font-size:14px;color:#000000;line-height:22px><?php include "include/html/notice1.html";?><FONT></td> </tr> <tr> <td height="1" bgcolor="#f5f5f5"></td></tr> <tr> <td height="20" align="right"><a href=/help/about.php class="blue" target=_blank>联系我们 Contact Us</a>   |   <a href=/help/about.php class="blue" target=_blank>更多 More</a>   </td> </tr> </table></td> </tr> </table></td> <td width="5"> </td> <td> <table cellspacing=0 cellpadding=0 align="center" bgcolor=#ffffff> <tr><td align=center> <?php /* <font style=font-size:5px><br></font><table border=0 cellspacing=0 cellpadding=0> <tr> <td align=center width=311><img src=images/100001.jpg class=img1><font style=font-size:5px><br><br></font></td> <td bgcolor=#c1c69d width=1></td> <td align=center width=311><table cellspacing=0 cellpadding=0 align="center"> <tr align=center> <td colspan=2 height=5></td> </tr> <tr align=center> <td><a href=search.php?typeid=1001000><img src=images/200001.jpg alt="Molding Case" class=img1></a></td> <td><a href=search.php?typeid=1002000><img src=images/200002.jpg alt="Assembled Case" class=img1></a></td> </tr> <tr align=center> <td><a href=search.php?typeid=1003000><img src=images/200003.jpg alt="Instrument Box" class=img1></a></td> <td><a href=search.php?typeid=1004000><img src=images/200004.jpg alt="Aluminum Box" class=img1></a></td> </tr> </table><font style=font-size:2px><br><br></font></td> </tr> <tr> <td bgcolor=#c1c69d colspan=3></td> </tr> <tr> <td align=center><font style=font-size:5px><br></font><table cellspacing=0 cellpadding=0 align="center"> <tr align=center> <td><a href=search.php?typeid=2001000><img src=images/300001.jpg alt="Premium Bag" class=img1></a></td> <td><a href=search.php?typeid=2002000><img src=images/300002.jpg alt="Casual Bags" class=img1></a></td> </tr> </table></td> <td bgcolor=#c1c69d width=1></td> <td align=center><font style=font-size:5px><br></font><table cellspacing=0 cellpadding=0 align="center"> <tr align=center> <td><a href=search.php?typeid=3001000><img src=images/400001.jpg alt="Solid Wood Item" class=img1></a></td> <td><a href=search.php?typeid=3002000><img src=images/400002.jpg alt="Gift Item" class=img1></a></td> </tr> </table></td> </tr> </table><font style=font-size:5px><br></font>*/?> <a href=search.php><img src=images/01.jpg alt="Enter Please" class=img1 width=600></a> </td></tr> </table> </td> </tr> </table> <table border=0 cellpadding=0 cellspacing=0><form method=POST action=n2e.php target=frame1> <tr><td valign=middle>数字 Num<input type=text SIZE=16 name=id><INPUT TYPE=submit VALUE="英语 EN" NAME=s></td> <td><IFRAME name=frame1 frameBorder=1 width=780 scrolling=no height=26></IFRAME></td></tr></form> </table> <table border=0 cellpadding=0 cellspacing=0><form method=POST action=n2c.php target=frame2> <tr><td valign=middle>数字 Num<input type=text SIZE=16 name=id><INPUT TYPE=submit VALUE="中文 CN" NAME=s></td> <td><IFRAME name=frame2 frameBorder=1 width=780 scrolling=no height=26></IFRAME></td></tr></form> </table> <?php require_once("include/foot.php"); ?> </center> </body> </html>
最新发布
06-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值