I'm currently facing issues with aligning items within a two-column grid. When looking at this image, you'll notice that the alignment is off. Specifically, 'Example 3' does not align properly with 'Example 4'. This seems to be caused by the lack of a description for 'Example 2', resulting in 'Example 3' filling in that empty space.
The desired behavior is for 'Example 1' to align with 'Example 2' (row 1) regardless of whether there's a description present. Similarly, 'Example 3' should align with 'Example 4' (row 2). You can see how it should look like in this image.
Uncertain about the reason behind this misalignment, I question if my use of Bootstrap is incorrect. Currently, I am employing Col-sm-6 Col-md-6
. Below is the code snippet:
<div class="myTree">
<div class="col-sm-6 col-md-6">
@if(link !=null) // if link is present, apply it to the image and title.
{
<a href="@link.URL" title="@link.LinkName" target="@link.TargetWindow">
<div class="content">
<div class="treeimagewithLink">
<img class="treeimage" alt="@image.GetAttributeValue("AlternateText")" title="@image.GetAttributeValue("AlternateText")" src="images/@image.Value" />
</div>
<div class="treeTitle">
<h3>@title</h3>
</div>
</div>
</a>
<div class="treeexcerpt">
<p>@Html.Raw(Model.GetElementValue("description"))</p>
</div>
}
else{ // if no link is provided
<div class="imagewithnoLink">
<img class="treeimage" alt="@image.GetAttributeValue("AlternateText")" title="@image.GetAttributeValue("AlternateText")" src="images/@image.Value" />
</div>
<div class="treeTitle">
<h3>@title</h3>
</div>
<div class="treeexcerpt">
<p>@Html.Raw(Model.GetElementValue("description"))</p>
</div>
}
</div>
</div>