Solved

vertical align  -baseline

Posted on 2009-05-12
5
454 Views
Last Modified: 2012-05-06
hi - i need all of the content within the blue block to align at the bottom of the orange block so all of the "Artwork Piece Number 1"s line up:

http://ctemps.cjehost.com/thumbs2.php

below is the html - here's the 2 styles that im trying to tweak with "vertical-align:baseline" (and bottom) can't get either to work though  thanks!

.boxPadThumb{/*oh well! looks like you need to adjust both!*/
      padding:0 5px 16px 16px;
      float:right;
      min-height:200px;
      background:#FF9966;
      vertical-align:baseline;
      }

.fourColBox{
width:125px;
min-height:150px;
vertical-align:baseline;
float:left;
margin-left:0;
background:#00CCCC;
}


<div class="boxPadThumb"><!---begin thumb box-->

						<div class="fourColBox">

							<div class="img-shadow"><a href="#" class="imgOver"><img src="images/fpo_thumb_num3.jpg" border="0" /></a>

							</div>

							<div class="clr"></div>

<div  class="iconCTN">

							<div class="iconCart"><a href="#"><img src="images/cart_icon.gif" border="0" /></a></div>

							<div class="iconQuickView"><a href="#"><img src="images/quick_view_icon.gif" border="0" /></a></div>

						</div>

						<div class="thumbCaption">Artwork Piece Number 1</div>

						</div>

					<!---end thumb box--></div>

Open in new window

0
Comment
Question by:phillystyle123
  • 3
  • 2
5 Comments
 
LVL 42

Accepted Solution

by:
David S. earned 500 total points
ID: 24369530
vertical-align doesn't apply to floated elements.  Use display:inline-block instead (with the workarounds for IE5-7 and FF1-2):

http://www.dynamicsitesolutions.com/css/example-menus/4/
http://gtwebdev.com/workshop/layout/inline-block-gallery.php
0
 

Author Comment

by:phillystyle123
ID: 24369881
i don't get it - so i can't use

.thumbRow{
width:100%;
float:left;
vertical-align:bottom;
background:#00FFFF;
}

i don't get how using display:inline would help
0
 
LVL 42

Expert Comment

by:David S.
ID: 24369957
vertical-align only applies to table-cells and inline elements. A floated element is neither.

display:inline-block is not the same as display:inline. display:inline-block allows you to have an element that can have a set width and height and yet participate in line-box formatting like inline elements do.
0
 

Author Comment

by:phillystyle123
ID: 24370181
hmm - i'm still not getting this -

check it out:

http://ctemps.cjehost.com/thumbs2.php

i notice that if i use position:relative; instead of float:right: i start to get the desired effect -however, it only works in ff - what am i missing - i'm trying to get all of teh green boxes to vertical-align:baseline;


.boxPadThumb{/*oh well! looks like you need to adjust both!*/

	padding:0 15px 0 15px;

	float:right;

	display:inline-block;

    vertical-align:baseline;

	margin-bottom:0;

	background:#00FF00;

	}

Open in new window

0
 
LVL 42

Expert Comment

by:David S.
ID: 24370285
Remove the float:right declaration.

It's not as simple as just adding display:inline-block. Take a look at the code used in the examples I linked to in my first reply.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now