Solved

vertical align  -baseline

Posted on 2009-05-12
5
455 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jquery add something to a div 4 38
Error in page 3 46
Syntax Error 2 46
Target h5 of a div 3 8
Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

920 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

16 Experts available now in Live!

Get 1:1 Help Now