简体   繁体   English

我的网站在 Firefox 中不起作用 - 文本超出边距

[英]my website doesn't work in firefox - text going beyond margin

I have designed a website to be dynamic so that the width of the browser allows for the content to adjust.我设计了一个动态网站,以便浏览器的宽度可以调整内容。 However on this specific page, the size of the browser in firefox ONLY is giving me problems:但是,在这个特定页面上,仅 Firefox 中浏览器的大小给我带来了问题:

The text goes beyond it's margins and clashes into the image on firefox when adjusting the screen size.调整屏幕大小时,文本超出了它的边距并与 Firefox 上的图像发生冲突。 Try it out and let me know.试试看,让我知道。 The css is very simple as well. css也很简单。

.nav-phone>a:nth-child(3) {
    background-color: #fbc076;
}

.nav>a:nth-child(3) {
    background-color: #fbc076;
}

.newbox {
    background-color: white;
    display: block;
    margin: auto;
}

.readiblecolumns {
    background-color: white;
}

.readiblecolumns>p {
    line-height: 1;
}

/* Desktop */
@media screen and (min-width: 960px) {

    .newbox {
        height: auto;
        width: 80vw;
    }

    /* Reads Like Newspaper */
    .readiblecolumns {
        width: 80vw;
        padding: 20px;
        -webkit-column-count: 3;
        -moz-column-count: 3;
        column-count: 3;
    }

    .readiblecolumns>p {
        font-size: 100%;
    }

    .profile {
        height: 480px;
        margin-bottom: 20px;
    }

    .profile img {
        height: 100%;
        width: auto;
        margin-bottom: 20px;
    }

}

/* Tablet */
@media screen and (min-width: 520px) and (max-width: 959px) {

    .newbox {
        height: auto;
        width: 80vw;
    }

    .readiblecolumns {
        width: 80vw;
        padding: 20px;
        -webkit-column-count: 2;
        -moz-column-count: 2;
        column-count: 2;
    }

    .readiblecolumns>p {
        font-size: 100%;
    }

    .profile {
        height: 320px;
        margin-bottom: 20px;
    }

    .profile img {
        height: 100%;
        width: auto;
        margin-bottom: 20px;
    }

}

/* Phone */
@media screen and (max-width: 519px) {

    .newbox {
        height: auto;
        width: 90vw;
    }

    .readiblecolumns {
        width: 90vw;
        padding: 15px;
    }
}

The html is as follows: html如下:

<div class="newbox">
    <div class="readiblecolumns">
        <div class="profile">
            <img src="Pictures/MyLife/mypicture.jpg" alt="">
        </div>
        <p>Miusov, as a man man of breeding and deilcacy, could not but feel some inwrd qualms, when he reached the Father Superior's with Ivan: he felt ashamed of havin lost his temper. He felt that he ought to have disdaimed that despicable wretch, Fyodor Pavlovitch, too much to have been upset by him in Father Zossima's cell, and so to have forgotten himself. "Teh monks were not to blame, in any case," he reflceted, on the steps. "And if they're decent people here (and the Father Superior, I understand, is a nobleman) why not be friendly and courteous withthem? I won't argue, I'll fall in with everything, I'll win them by politness, and show them that I've nothing to do with that Aesop, thta buffoon, that Pierrot, and have merely been takken in over this affair, just as they have."</p>
    </div>
</div>

It has to do with .profile{width:480px;} , then making the .profile img{height:100%; width:auto;}它与.profile{width:480px;} ,然后使.profile img{height:100%; width:auto;} .profile img{height:100%; width:auto;} . .profile img{height:100%; width:auto;} When the Browser size changes width, the image is still base on the 100% height of .profile (which may not have changed at all), therefore it's not scaling the way you desire.当浏览器大小更改宽度时,图像仍基于.profile的 100% 高度(可能根本没有更改),因此它不会按您希望的方式缩放。 Your image should really fit the original page load design for vector scaling, anyways.无论如何,您的图像应该真正适合用于矢量缩放的原始页面加载设计。 Give .profile the proper height and width, then you can set .profile img{height:100%; width:100%;}.profile适当的高度和宽度,然后你可以设置.profile img{height:100%; width:100%;} .profile img{height:100%; width:100%;} . .profile img{height:100%; width:100%;}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM