Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

What's the CSS to align text of a DIV to the bottom center?

Posted on 2014-11-29
6
212 Views
Last Modified: 2014-12-29
I have a bootstrap based row / column system. One row is labels for a progress bar. The second row will be the glyphicon map pointer (the pointer is NOT included in this question).

How do I align this text to the bottom of the div?

Screenshot
(The red column outlines are there to show the columns. I added the arrows to show which ones need to be moved down...

Here's the fiddle... but it doesn't exactly work as the screenshot since (at least on this monitor) the result section is a little narrow....

http://jsfiddle.net/d388t1oL/
0
Comment
Question by:DrDamnit
  • 2
  • 2
6 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 40471986
use the vertical-align: bottom style

Reference:
http://www.w3schools.com/cssref/pr_pos_vertical-align.asp
0
 
LVL 43

Accepted Solution

by:
Rob earned 500 total points
ID: 40472097
You can do it by wrapping the inner content with a tag like the <label> one you have for start, before making the containing element have the postition of relative.  The inner tags then can have the absolute positioning assigned and it's easily put to the bottom of the container.

demo here: http://jsfiddle.net/d388t1oL/6/embedded/result/ (from http://jsfiddle.net/d388t1oL/6/)

#progress .progressMarker {
height: 85px;
text-align: center;
position: relative;
}

#progress .progressMarker * {
position: absolute;
bottom: 0px;
}

Open in new window

0
 
LVL 58

Expert Comment

by:Gary
ID: 40521065
I've requested that this question be closed as follows:

Accepted answer: 250 points for aikimark's comment #a40471986
Assisted answer: 250 points for Rob Jurd's comment #a40472097

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
LVL 43

Expert Comment

by:Rob
ID: 40521066
Don't like to object, however both the author and I tried the vertical-align property with no success because the elements are floating, which changes their dimensional properties.  Hence the need for absolute positioning within the element.

I believe my answer is the only correct one.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40521077
@Rob
...both the author and I tried...
How would I or future readers know that?!?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question