<div style="position:relative; width: 100%; aspect-ratio:1; display:block; overflow:hidden;">
<img src="blah" style="height: 100%; width:auto; position: absolute; left: 50%; top: 50%; transform:translate(-50%,-50%)"/>
</div>use Magento\Cms\Model\Template\FilterProvider;
use Magento\Framework\App\State;
use Magento\Framework\View\Design\Theme\ThemeProviderInterface;
use Magento\Framework\View\DesignInterface;
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\App\Config\ScopeConfigInterface;// Replace with your actual PayPal API credentials
$api_username = "";
$api_password = "";
$api_signature = "";
// PayPal API endpoint (sandbox or live)
$api_endpoint = "https://api-3t.paypal.com/nvp"; // Live endpoint
// For sandbox testing: $api_endpoint = "https://api-3t.sandbox.paypal.com/nvp";<script>
require(['jquery'], function($) {
$(document).ready( function() {
var checkExist = setInterval(function() {
if ($('.element__class').length) {
// do something
clearInterval(checkExist);
}
}, 500); // check every 500ms