快捷导航
发新帖
返回列表
老师,为什么我写的网页按照你讲课操作但是不论如何我插入的图片就是居右对齐,无法居中

本帖子中包含更多资源

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

x
举报 使用道具
| 回复

共3个回复 最后回复于 2017-11-23 17:49

勤币 13901   学币 196  
沙发
发表于 2017-11-17 17:12:28 | 只看该作者
把你的代码全部复制粘贴上来看下,肯定是代码有问题的
举报 使用道具
勤币 99   学币 0  
板凳
发表于 2017-11-21 19:29:31 | 只看该作者
lori棒棒糖 发表于 2017-11-17 17:12
把你的代码全部复制粘贴上来看下,肯定是代码有问题的

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>百度页面练习</title>
<style type="text/css">
body,td,th {
        font-family: "微软雅黑";
        font-size: 14px;
        color: #212020;
        text-align: right;
}
body {
        background-color: #FFFFFF;
        margin-left: 0px;
        margin-top: 0px;
        margin-right: 0px;
        margin-bottom: 0px;
}
a:link {
        color: #4D4B4B;
}
a:hover {
        color: #0424DB;
}
a:visited {
        color: #B30E11;
}
</style>
</head>

<body text="#414141">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td height="50" align="right"><a href="http://nuomi.com"><strong>糯米</strong></a>&nbsp;<a href="http://baidu.com"> <strong>新闻</strong></a>&nbsp; <a href="http://hao123.com" target="_blank"><strong>hao123</strong></a>&nbsp; <a href="http://map.baidu.com"><strong>地图</strong></a>&nbsp; <a href="#"><strong>视频&nbsp;</strong></a>&nbsp; <a href="#"><strong>贴吧</strong></a>&nbsp;&nbsp;<a href="#"><strong> 登录</strong></a>&nbsp;&nbsp; <a href="3"><strong>设置</strong></a></td>
    </tr>
    <tr>
      <td height="120" align="center" valign="bottom"><img src="image/baidu.jpg" width="222" height="85" alt=""/></td>
    </tr>
    <tr>
      <td height="80" align="center" valign="bottom"><img src="image/baidu-so.jpg" width="650" height="44" alt=""/></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>

</body>
</html>
举报 使用道具
勤币 13901   学币 196  
地板
发表于 2017-11-23 17:49:45 | 只看该作者
本帖最后由 lori棒棒糖 于 2017-11-23 17:50 编辑

把text-align: right去掉就可以了
举报 使用道具
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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