0

I'm trying to make an <object> full screen, with the object-fit: cover; property, but unfortunately in Chrome the result is contain, instead of cover. In Firefox I get the result what I'm looking for. I tried it with <img> tag, and it works, but I can't use an animated svg without <object>.

body {
  padding: 0;
  margin: 0;
}

.container {
  height: calc(80vh - 100px);
  position: relative;
  overflow: hidden;
}

object {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
<div class="container">
    <object type="image/svg+xml" data="https://svgur.com/i/asr.svg" />
</div>

How can I get the same result in Chrome?


You could define a fixture that is automatically supplied to each test case:

import pytest

@pytest.fixture(autouse=True)
def record_index(record_xml_attribute):
    record_xml_attribute('index', '15')

Note record_xml_attribute is not supported for xunit2, the default junit_family for pytest v6. To use record_xml_attribute with pytest v6, in pytest.ini set

[pytest]
junit_family = xunit1
4

0 回答 0