我在这里与朋友讨论,可以看到一个例子。容器的宽度是否在500px580px上?所谓内容,是指横幅图片的侧面,以及贯穿文本的直线。

我们在检查窗口中查看,但是找不到宽度应该在哪里。

该网站是在表格中建立的,因为该设置是针对电子邮件新闻稿的。

设置宽度的示例在html中:

<!-- Top Picture Start -->
<table class="row background-color__blue">
    <tr>
        <td class="center img-position" align="center">
            <center>
                <table class="container">
                    <tr>
                        <td class="wrapper last">
                            <table class="twelve columns">
                                <tr>
                                    <td>
                                        <a class="remove-banner-space" href="http://google.dk"><img width="580" height="300" src="http://d21vu35cjx7sd4.cloudfront.net/dims3/MMAH/crop/586x293%2B0%2B95/resize/580x290%5E/quality/90/?url=http%3A%2F%2Fs3.amazonaws.com%2Fassets.prod.vetstreet.com%2F4a%2Ff0%2Fc29d3f434ae6abd19f5433140124%2Fborder-collie-AP-XO4EXW-590sm52314.jpg" alt="Test" /></a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </center>
        </td>
    </tr>
</table>
<!-- Top Picture End -->


在CSS中,还应将其设置为580px

table.container {
            background: #fefefe;
            width: 580px;
            margin: 0 auto;
            Margin: 0 auto;
            text-align: inherit;
        }

最佳答案

在浏览器工具/检查器中(至少在Firefox中)(除其他外)有一个名为“计算”的选项卡(不确定确切的英语术语,因为我使用的是其他语言)。这会向您显示计算出的(即实际的)宽度,并加上所有内容:边距,边框,填充,内部宽度-CSS盒子模型的良好表示。

关于html - 找到容器的宽度,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42401461/

10-12 00:21
查看更多