1

I have a table (dim: 100px * 500px) with background image - 1px*10px. I write the background code in css:

background:  white url(../Images/line.png) repeat-x scroll top center;

But I want to convert it to html code in the table tag not css code, like:

<table bgcolor="#FFF" background=".....">

How can I convert this code to HTML?

4

2 に答える 2

0

これは良くない。

だが :

<table background="http://yoursite/images/bg.png" width="500" height="500">
  <tr>
   <td>This is a test ...</td>
  </tr>
</table>
于 2012-06-10T08:13:58.133 に答える
0
<table style="background: white url(../Images/line.png) repeat-x scroll top center;">

要素をインラインでスタイルしたい場合は、style 属性と CSS プロパティを (この例のように) 書き込むだけです。

CSS ファイルが HTML ドキュメントと同じ場所に配置されていない場合は、パスを調整する必要がある場合があります。これは、要素をインラインでスタイル設定するときに最初に発生する問題です。
HTML マークアップがきれいになり、レイアウトを変更する費用がかからないため、CSS ファイルを介してこれを行うことをお勧めします。

于 2012-06-10T08:09:00.943 に答える