I'm trying to make a webpage with two columns, one side with main content and the other with additional content. But because I'm using the float property to align the extra column to the left, it stacks horizontally, but I want it to stack vertically.
My current code:
.topicheader { padding: 2% 2%; float: left display: block; background-image: linear-gradient(to top, rgb(40, 40, 40), rgb(50, 50, 50)); font-size: 125%; border-radius: 3px; box-shadow: 0px 0px 15px 0px black; } .column.side { z-index: 1; width: 25%; float: right; }
<div> <div class="def column side " ;> <strong class="topicheader">About</strong> <p style="color:white;"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec in euismod est. Curabitur euismod ultrices pellentesque. Morbi condimentum venenatis nibh sed feugiat. </p> </div> <div class="def column side " ;> <strong class="topicheader">About</strong> <p style="color:white;"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec in euismod est. Curabitur euismod ultrices pellentesque. Morbi condimentum venenatis nibh sed feugiat. </p> </div> </div>
I've tried using the Vertical-align property but it doesn't do anything. What do I want to happen
Use
clear: Both;
attribute.Columns can be stacked vertically by using
column
. By usingrow
the columns are side by side.