All Questions

984
votes
40answers
1040281 views

How to vertically center a div for all browsers?

I want to center a div vertically with CSS. I don't want tables or Javascript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support. <body> <...
1611
votes
33answers
2404165 views

How do I vertically center text with CSS?

I have a div element which contains text, and I want to align the contents of this div vertically center. Here is my div style: #box { height: 170px; width: 270px; background: #000; ...
764
votes
23answers
1161843 views

Vertically align text in a div

I am trying to find the most effective way to align text with a div. I have tried a few things and none seem to work. .testimonialText { position: absolute; left: 15px; ...
515
votes
23answers
927698 views

Vertical alignment of elements in a div

I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CS...
1036
votes
30answers
1083917 views

How to vertically align an image inside a div?

Question How can you align an image inside of a containing div? Example In my example, I need to vertically center the <img> in the <div> with class ="frame" : <div class="frame" st...
1575
votes
20answers
987466 views

Vertically align text next to an image?

Why won't vertical-align: middle work? And yet, vertical-align: top does work. <div> <img style="width:30px;height:30px"> <span style="vertical-align:middle">Doesn't work.<...
117
votes
10answers
305510 views

Vertically align an image inside a div with responsive height

I have the following code which sets up a container which has a height that changes with the width when the browser is re-sized (to maintain a square aspect ratio). HTML <div class="responsive-co...
19
votes
4answers
10624 views

Why does this inline-block element have content that is not vertically aligned

Came across a weird CSS issue. Can someone explain why the box having content is not vertically aligned? If you put text inside the span with class .divPutTextToFixIssue - it aligns properly. http:/...
90
votes
8answers
62729 views

Vertical (rotated) label in Android

I need 2 ways of showing vertical label in Android: Horizontal label turned 90 degrees counterclockwise (letters on the side) Horizontal label with letters one under the other (like a store sign) ...
898
votes
22answers
1442451 views

How to align content of a div to the bottom?

Say I have the following CSS and HTML code: #header { height: 150px; } <div id="header"> <h1>Header title</h1> Header content (one or multiple lines) </div> ...

Previous Next