I'm really diving into HTML lately, but I'm struggling to grasp how elements are laid out. Coming from a background in WPF, I understand code like this:
<Grid>
<Button HorizontalAlignment="Left" Width="200" Content="A"/>
<Grid HorizontalAlignment="Stretch" Margin="200,0,0,0">
<Button Content="B" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="150"/>
<Button Content="C" HorizontalAlignment="Left" Margin="0,150,0,0" Width="200"/>
<Button Content="D" Margin="200,150,0,0"/>
</Grid>
</Grid>
This will create a UI that looks something like: https://i.sstatic.net/HlYV0.png
My struggle is replicating this layout in HTML, where A's width stays at 200 (pixels or dp) and sticks to the left side while B is always 150 pixels from the top. Both B and D need to resize when the browser window changes size because of their stretch horizontal alignment.
Everything online says HTML is structured similar to a stack panel, so I can't wrap my head around achieving that stretching behavior horizontally.