0

我是 html5 的新手,并开发了一些独立的 html5 页面以及它们各自的样式 css。接下来的问题可能是一个非常基本的问题,但不知何故,经过大量寻找解决方案后,我决定在这里发布我的问题,希望得到一些提示/建议。

这是我的问题。我有一个带有 css 的独立 html 页面。当我在我的机器上本地打开网页时,所有 css 设置都已完美应用。然后我将它上传到我的dreamhost服务器上,上传后当我尝试打开页面时,我丢失了我在页面中使用的表格上所做的所有格式,而所有其他格式看起来都不错。格式在浏览器和 android webviews 上都会消失。我不确定当我在服务器上上传文件时没有应用规则的问题是什么。

以下是我在 html 页面中使用表格的方式:

<!-- Article 1 start -->

            <div class="line"></div>  <!-- Dividing line -->

            <article id="article1"> <!-- The new article tag. The id is supplied so it can be scrolled into view. -->
                <h3>Comparison Symbols</h3>

                <div class="line"></div>

                <div class="articleBody clear">

                <p> If you’re writing programs in C, you need to use comparison symbols. The symbols C uses, their meanings, and examples are shown in the following table: </p>
                <p>
                    <table>
                              <tr>
                                <th>Symbol</th> 
                                <th>Meaning</th>
                                <th>Examples</th>
                              </tr>

                              <tr>
                                <td></td>
                                <td></td>
                              </tr>

                              <tr>
                                <td> < </td>
                                <td>Less than</td>
                                <td>2 < 6</td>
                              </tr>

                              <tr>
                                <td>==</td>
                                <td>Equal to</td>
                                <td>5 == 5</td>
                              </tr>

                              <tr>
                                <td>></td>
                                <td>Greater than</td>
                                <td>8 > 5</td>
                              </tr>

                              <tr>
                                <td><=</td>
                                <td>Less than or equal to</td>
                                <td>4 <= 5</td>
                              </tr>

                              <tr>
                                <td>>=</td>
                                <td>Greater than or equal to</td>
                                <td>9 >= 5</td>
                              </tr>

                              <tr>
                                <td>!=</td>
                                <td>Not equal to</td>
                                <td>1 != 0</td>
                              </tr>
                    </table>            
                </p>
                </div>
            </article>

以下是我在 css 中用于表格格式的代码行:

/* table properties */

th {width:150px;
    text-align:left;
    font-weight:bold;
    text-decoration: underline;}
td {text-align:left}

如果有人可以提供一些建议,那将是一个很大的帮助。

4

1 回答 1

1

服务器上的 css 文件正在恢复到旧版本。当恢复解决并且css保留以下配置时,问题就解决了:

th {width:150px;
text-align:left;
font-weight:bold;
text-decoration: underline;}
td {text-align:left}
于 2012-11-01T05:13:20.410 回答