在中心表旁边放置图像

时间:2015-01-27 00:07:54

标签: html css

这可能是" ReWashed"问题但是我在将图像放在已经居中的桌子旁边时遇到了困难,下面的代码就是我被困住的片段。



<img src="FS.png" class="abcdef" width="124" height="166" style="float:right;position: relative"/>
            <div align="center">
                  
              <table width="576" border="1">
                <tr>
            <td width="348">&nbsp;</td>
            <td width="212">&nbsp;</td>

          </tr>
          <tr>
            
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
           
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </table>
        </div>
        </div>
&#13;
&#13;
&#13;

图像被放置在屏幕的最右侧,桌子居中,我需要将图像放在桌子中央旁边。

1 个答案:

答案 0 :(得分:0)

&#13;
&#13;
div#tab{width:580px; float:left;}
div#pix{width:150px; float:right;}

body{width:730px;
  margin:0 auto;}
&#13;
<body>
<div id="tab">

  <table width="576" border="1">
    <tr>
      <td width="348">&nbsp;</td>
      <td width="212">&nbsp;</td>

    </tr>
    <tr>

      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>

      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>

      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>

      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>

      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>

      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>

      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>

      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
  </div>
<div id="pix">
  <img src="FS.png" class="abcdef" width="124" height="166" float="right" position="relative"/>
</div>
  </body>
&#13;
&#13;
&#13;

相关问题