css – Microsoft Edge html style attribute ignored-ThrowExceptions

Exception or error:

I want a div to have a dynamic background defined by PHP. So I use the style attribute of the div to define background, background-size, background-position and background-repeat. In Chrome and Firefox everything is displayed correctly but Edge does not show the image.

Here the resulting html:

<div class="series-info-container" style="background: linear-gradient(to right, #1B2431E5, #1B2431E5), url('....png'); background-repeat: no-repeat; background-size: cover; background-position: center;">
    <div class="series-info-inner">
        <img alt="" src="....png">
        <div class="series-info">
            <h1>...</h1>
            <p>...</p>
        </div>
    </div>
</div>

The meant div is series-info-conatiner

Here the css for this snippet:

main .series-info-container {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 500px;
}

main .series-info-container .series-info-inner {
    margin: 0 auto;
    padding: 50px 0;
    width: 1300px;
    height: 100%;
    display: flex;
    align-items: flex-start;
}

main .series-info-container .series-info-inner img {
    margin: 0;
    padding: 0;
    width: auto;
    height: 400px;
    border-radius: 5px;
    display: inline-block;
}

main .series-info-container .series-info-inner .series-info {
    margin: 0 0 0 40px;
    padding: 0;
    width: 100%;
    height: calc(100% - 50px);
    display: inline-block;
}

main .series-info-container .series-info-inner .series-info h1 {
    margin: 20px 0 0 0;
    padding: 0;
    font-family: 'Open Sans','Helvetica Neue', helvetica, arial, sans-serif;
    font-size: 22px;
    font-style: normal;
    font-variant: normal;
    font-weight: 600;
    color: #ffffff;
    display: inline-block;
}

main .series-info-container .series-info-inner .series-info p {
    margin: 20px 0 0 0;
    padding: 0;
    max-height: 325px;
    overflow: hidden;
    font-family: 'Open Sans','Helvetica Neue', helvetica, arial, sans-serif;
    font-size: 1rem;
    font-style: normal;
    font-variant: normal;
    font-weight: 400;
    line-height: 25px;
    color: #97a7c0;
    display: inline-block;
}

Any ideas?

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *