Solution for responsive images covering entire container and keeping aspect ratio

This solution is probably already out there somewhere on the interwebs, but I write it down for now.

I’ve been working with a Bootstrap 4 based website a lot lately.
Today I got the requirement to make an background image adjust to the height of its sibling column but at the same cover the entire background of its container.

I want the entire container box to be covered by the background image and still keeping its aspect ratio in various screen sizes, it’s ok with clipping and stretching (if image is to small). Here is a solution:

html:

<div class="row">
	<div class="col-6">
		<div class="teaser-container" id="teaser1">
			...column 1 html content...
		</div>
	</div>		
	<div class="col-6">
		<div class="teaser-container" id="teaser2">
			...column 2 other various height html content...
		</div>
	</div>			
</div>

css:

#teaser1
{ 
	height: 100%; 
	background-image: url('/globalassets/top-image.jpg');
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
}

 

 

Blazor: a technical introduction

What is Blazor? It’s a framework for browser-based (client-side) applications written in .NET, running under WebAssembly. It gives you all the benefits of a rich, modern single-page application (SPA) platform while letting you use .NET end-to-end, including sharing code across server and client. The announcement post covers more about the intended use cases, timescales, and so on.

Source: Blazor: a technical introduction

Azure VMs – Start/Stop during off-hours solution

Follow this link to setup daily start and stop of your Azure VMs (saves money for dev or test environments that only needs to be active during workhours for instance).

Start/Stop VMs during off-hours solution (preview) | Microsoft Docs
(Goto Marketplace and select Start/Stop VMs during off-hours [Preview] from the search results.)

When done, the above steps have created daily start and stops, to set monday-friday 07:00-19:00 (and off during holiday) go to Resource group -> Automation account -> Schedules.
Deactivate “Scheduled-StartVM” and “Scheduled-StopVM”. Edit “Sequenced-StartVM” and “SequencedStopVM” and set weekdays schedule using these.

 

Two Lesser Known Tools for Local Azure Development | .NET Web Development and Tools Blog

If you’re developing applications that target Azure services (e.g. Web Apps, Functions, Storage), you’ll want to know about two powerful tools that come with Visual Studio 2017 and the Azure development workload:
Cloud Explorer is a tool window inside Visual Studio that lets you browse your Azure resources and perform specific tasks – like stop and start app service, view streaming logs, create storage items. Storage Emulator is a separate application to Visual Studio that provides a local simulation of the Azure storage services. It’s really handy for testing Functions that trigger from queues, blobs or tables. In this blog I’ll show you how you can develop development/Azure applications entirely locally – including the ability to interact with Azure storage – without ever needing an Azure subscription.
From:
blogs.msdn.microsoft.com/webdev/2018/02/08/two-lesser-known-tools-for-local-azure-