Question : Image within a Div is upside down... Need to have it align bottom and "STAY" within DIV boundaries

Ladies and Gentlemen,

Here's my code....

<div id="graphic" style="z-index:0; height:90px; width:100px; vertical-align:bottom; border:thin #000000 outset;"><a onmouseover="return overlib('Graph displays amount of money used.<br><br><% if(ttlFnd.BOF && ttlFnd.EOF){ Response.Write("$ 0.00"); } else { Response.Write("Funds Used to Date: $" + ttlFnd.Fields.Item("amtUsed").Value);}%>');" onmouseout="return nd();"><img name="pctUsed" src="images/pctUsed.png" width="100" height="<% if(ttlFnd.BOF && ttlFnd.EOF){ Response.Write("0"); } else { Response.Write(((ttlFnd.Fields.Item("remBal").Value / ttlFnd.Fields.Item("total_funding").Value) * 100 ) - 10);}%>" /></a></div>

What I need is the IMG to align BOTTOM to the DIV.  It's appearing UPSIDE DOWN in the rendered page.  I know you can't v-align: bottom an IMG since it doesn't work. Any thoughts please.

It doesn't matter that I'm using CLASSIC ASP with JAVASCRIPT. That's not the problem.  This is a CSS Issue.

The IMG file is 1px height and 100px width.  The height dynamically shrinks with the percentage of funds remaining.  So when there's 100% funds the IMG fills the DIV nicely. As the percentage gets smaller, the IMG starts to decrease. That's not happening. I'm getting the whitespace at the bottom of the DIV when it should be at the TOP of the DIV container.

Does that make sense?

Thanks,

Peter

Answer : Image within a Div is upside down... Need to have it align bottom and "STAY" within DIV boundaries

Since a combobox returns a string, it's not surprising that the linked cell is getting messed up. I suggest not linking the combobox to a cell, but instead using VBA code to update the value.

The snippet below shows both a KeyUp and LostFocus sub so the date cell (A1 in the code) is updated when you are done typing in the combobox.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Private Sub ComboBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Dim v As Variant
If KeyCode <> 13 Then Exit Sub
On Error Resume Next
v = CDate(ComboBox1.Value)
If Not IsError(v) Then Range("A1").Value = v
On Error GoTo 0
Range("A1").Select
End Sub

Private Sub ComboBox1_LostFocus()
Dim v As Variant
On Error Resume Next
v = CDate(ComboBox1.Value)
If Not IsError(v) Then Range("A1").Value = v
On Error GoTo 0
End Sub
Random Solutions  
 
programming4us programming4us