Categories
CSS HTML

How to Center align div vertically using css?

During the early days of HTML development, to vertically center align a div or an element we used lots of methods or technique to achieve this. We used CSS position property in some cases and in some cases to do it in dynamically we used JavaScript to vertically align a div or an element. But in modern Flex-box solution it is the easy to do this. Just by using CSS ” justify-content: center” to the parent element to align the content to the center (vertically) of it. Most of the modern browser supports this CSS property.

How to Center align div vertically?
Categories
CSS HTML

Vertically align text next to an image with CSS

If we have image follwed with text and need to be aligned verically, we can do this by simply setting “vertical-align:middle;” to image or we can use css property flexbox for this type of layout. Most of us will struggle with the middle aligment of images with text.

Vertically align text next to an image with CSS