快捷导航
发新帖
返回列表
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>使用表格布局百度网及页面属性的设置</title>
<style type="text/css">
body,td,th {
        font-family: "黑体";
        font-size: 14px;
        color: #1F1F1F;
        text-align: right;
}
body {
        margin-left: 0px;
        margin-right: 0px;
        text-align: center;
}
a:hover {
        color: #1203D3;
}
</style>
</head>

<body><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tbody>
    <tr>
      <td height="40" align="center" valign="bottom"><a href="http://news.baidu.com" target="_self"><strong>新闻</strong></a> <strong>&nbsp; <a href="https://www.hao123.com/" target="_self">hao123</a>&nbsp; <a href="http://map.baidu.com/" target="_self">地图</a>&nbsp; <a href="http://v.baidu.com" target="_self">视频</a>&nbsp; <a href="https://tieba.baidu.com" target="_self">贴吧</a>&nbsp; <a href="http://xueshu.baidu.com" target="_self">学术</a>&nbsp; <a href="#" target="_self">登录</a>&nbsp; <a href="#" target="_self">设置</a>&nbsp; <a href="#" target="_self">更多产品</a>&nbsp;</strong></td>
    </tr>
    <tr align="center" valign="middle">
      <td height="258" align="center" valign="bottom" style="text-align: center"><img src="images/computer_pc_f9e71b7cee2d086842457387be642f5e.gif" width="269" alt=""/></td>
    </tr>
    <tr>
      <td height="84" align="center" valign="bottom" style="text-align: center"><img src="images/QQ截图20170726221555.png" width="641" height="84" alt=""/></td>
    </tr>
    <tr align="center" style="text-align: center">
      <td height="418" align="center" valign="bottom"><img src="images/QQ截图20170726221704.png" width="67" height="65" alt=""/><br>
      <strong>手机百度</strong></td>
    </tr>
    <tr>
      <td height="80" align="center" valign="bottom"><a href="https://www.baidu.com" target="_self"><strong>把百度设为主页</strong></a><strong>&nbsp; <a href="https://www.baidu.com" target="_self">关于百度</a>&nbsp; About  Baidu&nbsp; 百度推广&nbsp;</strong></td>
    </tr>
    <tr>
      <td align="center" valign="bottom">&nbsp;</td>
    </tr>
    <tr>
      <td align="center" valign="bottom">&nbsp;</td>
    </tr>
  </tbody>
</table>

</body>
</html>



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
举报 使用道具
| 回复

共6个回复 最后回复于 2017-12-1 23:10

勤币 614   学币 0  
沙发
发表于 2017-7-27 17:35:33 | 只看该作者
同学,你设置了td的全局样式了



把这去掉,然后你td里的独立样式 style="text-align: center" 也没必要写了


这里有个优先级的问题
样式离得越近,优先级越大


为什么设置了align="center",没有用?因为上面设置的td全局样式text-align: right;优先级大于它。
然后为什么你在td里写的独立样式style="text-align: center" 又有用? 因为这里离得最近,他的优先级是最大的。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
举报 使用道具
勤币 7   学币 0  
板凳
发表于 2017-8-13 21:51:43 | 只看该作者
yuanxi52028 发表于 2017-7-27 17:35
同学,你设置了td的全局样式了

有一点不懂。。既然是这样 ,那为什么上面的图片同样设置却能够居中呢? 不是一样的设置吗?怎么只有手机百度那里受全局样式的影响了。
举报 使用道具
勤币 614   学币 0  
地板
发表于 2017-8-16 09:53:45 | 只看该作者
夕小七 发表于 2017-8-13 21:51
有一点不懂。。既然是这样 ,那为什么上面的图片同样设置却能够居中呢? 不是一样的设置吗?怎么只有手机 ...

你上面写的是 style="text-align: center" 下面这个没写
举报 使用道具
勤币 155   学币 0  
5#
发表于 2017-12-1 22:57:57 | 只看该作者
yuanxi52028 发表于 2017-8-16 09:53
你上面写的是 style="text-align: center" 下面这个没写

哈哈哈,我也遇到同样的问题
举报 使用道具
勤币 155   学币 0  
6#
发表于 2017-12-1 23:04:10 | 只看该作者
北辰A 发表于 2017-12-1 22:57
哈哈哈,我也遇到同样的问题

我去掉样式 style="text-align: center"后全都居中了!该如何是好
举报 使用道具
勤币 155   学币 0  
7#
发表于 2017-12-1 23:10:16 | 只看该作者
北辰A 发表于 2017-12-1 23:04
我去掉样式 style="text-align: center"后全都居中了!该如何是好

懂了,去掉以后又点击单元格设置居右对齐哈哈哈
举报 使用道具
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表