Pregunta

enter image description here

<form id="form1" runat="server">
<div>
    <div style="height: 350px; width: 250px; background-color: #ECECEA; color: #993399">
        <div class="image">
            <asp:Image ID="imgteacher" runat="server" Height="150" Width="250" /></div>
        <div style="margin-left: 3px">
            <div style="font-size: 28px">
                <asp:Label runat="server" ID="lblname" Text="Mobile Web Development"></asp:Label></div>
            <div style="margin-top: 140px; float: left">
                <asp:Label ID="lbldate" runat="server" Text="01.04.2014"></asp:Label></div>
            <div id="detail" style="margin-top: 150px; font-size: 20px; color: Fuchsia; margin-left: 190px">
                <a href="#">Detail</a></div>
        </div>
    </div>
</div>
</form>

I am developing in Asp.Net . I have so problem. As shown above code margin-top for lbldetail is 140px. At this time it is on the bottom of gray window. But here lblname can be change by user. User can add long name as lblname. At this time lbldetail goes downwards and exits border of gray window.(if lblname would be little , at this time it goes up toward as shown picture) But I want lbldetail's place would not be depend on lblname and its place would be constant(bottom of gray window) I hope I could explain.

¿Fue útil?

Solución

The div with id "detail" needs position absolute. and as Murali Murugesan said, you do need to lose the inline styles and use a CSS file.

div#detail
{
    position:absolute; 
    top:330px; 
    font-size: 20px; 
    color: Fuchsia; 
    margin-left: 190px
}

You can find the example at: http://jsfiddle.net/9Bkha/

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top