Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Floated Right Image not appearing at the top 2

Status
Not open for further replies.

Kalisto

Programmer
Feb 18, 2003
997
GB
I have a div on the page. The intent is to have a question on the left hand side, and occupying most of the space. There is also a little prompt icon for more help, that should appear at the top right of the div.

the code is
Code:
<div style="width:700px;">
  <div class="Question">
    <asp:Label BorderStyle="Solid" BorderWidth="1px" Width="665px" runat="server" ID="lbQuestion">Here is a sample Question?</asp:Label>
        </div>

<span style="float:right;vertical-align:top"><a href="#" onclick=""><img alt="Info Button" class="infoButton" src="Images/info.jpg" /></a></span>
    </div>

The css elements are;
Code:
.Question
{
padding:10px 10px 10px 10px;width:700px;font-size:x-large;font-weight:bold;color:Black;border-bottom:white 2px solid;
	border-right:2px solid red;border-top:2px solid red;
}

.infoButton
{
	border:0px; height:15px;width:15px;
}

The border colours were added so I could try and see what was going on before I posted here :$

Can anyone help me with what Ive got wrong?
The asp:label resolves into an inline span element if that has any relevence on it

K
 
Try floating the question left.

The default behavior is for the image (even though floated) to drop below the (non-floated) div above it in the code.

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Or, even better, put the button in the code before the question: before the actual element, if you want the question element to wrap around the floated info button or inside the question div but before any content, if you want the button to be inside the question div with text wrapping around it.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Thanks to Both, I think I prefer Vragabonds soluton from a code simplicity point of view. (I can remove the span tag, and tidy up some of the other divs as well, so the page footprint is smaller.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top