?
Solved

Textbox over Image in ASP.NET

Posted on 2010-08-25
2
Medium Priority
?
1,563 Views
Last Modified: 2012-05-10
How can I go about placing a textbox over a header image that is not set as a background image. If I play with the margins I can push the text back over the image but it will not work the same way with a textbox.
<div id="mainbar"><img src="images/contentpageheader.jpg" alt="" />
    <div class="typeface-js"><h2>Careers</h2></div>
    <br /><br /><br />
    <div class="content">
        <div class="typeface-js" id="font-expressway" style="color:#0d1e2b; font-size: 15px; margin-bottom: 10px; line-height: 18px; padding-top: 10px; ">Fill out the form below:</div>
        
        <div id="forml">
        <ul>
            <li class="typeface-js">Name:</li>
            <li class="typeface-js">Phone Number:</li>
            <li class="typeface-js">Email Address:</li>
            <li class="typeface-js">Description of Qualifications:</li>
        </ul>
        </div>
        
        <div id="formr">
        <ul>
        <li><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></li>
        <li><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></li>
        <li><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></li>
        <li><asp:TextBox ID="TextBox4" runat="server"></asp:TextBox></li>
        </ul>
        </div>
  
    </div>
    <div id="contentfooter"><img src="images/contentpagefooter.jpg" alt="" /></div>
</div>

Open in new window

0
Comment
Question by:WCCrobert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
hehdaddy earned 200 total points
ID: 33524168
The only way I can think of off the top of my head (and this maybe wrong). Would be to set the textbox and possibly the imgage to position: relative inside a div. Then you could use z-index to put the textbox on top of the image and place it precisely where you want it.

Maybe give that a shot and see what happens.

Cheers.
0
 
LVL 4

Expert Comment

by:CoveyCraig
ID: 33526689
You could use css instead.  Put this inside the <head> portion of your page.
<%
Response.Write      "<style type=""text/css"">" & vbNewLine & _
            "<!--" & vbNewLine & _
            ".textboxstyle {background-image:url(images/contentpageheader.jpg); background-color:" & strPageBgColor & "; background-repeat:no-repeat; background-position:center; background-attachment:scroll; font-family:" & strDefaultFontFace & ";font-size:10pt; overflow:auto;} " & vbNewLine &_
            "-->" & vbNewLine & _
            "</style>" & vbNewLine
%>

Then where you want a textbox with the background image, call it using 'textboxstyle' like this:

Response.Write      "<input type=""text"" name="whatever" class=""textboxstyle"">"
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

741 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