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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox acts strangely when in <span> 2

Status
Not open for further replies.

katherinep

Programmer
Sep 18, 2003
49
AU
Hello,

I am currently making a site using stylesheets for positioning so it conforms to w3c standards. I have a page with a form on it but it is acting strangely. The code looks like this

Code:
<span class="form_item">
<input name="Fri" type="text" size="4">
</span>

and form_item looks like this

Code:
form_item {  margin-left: 190px;  margin-right:190px;}

Whats happens is when the text box is inside the <span> tag it is really hard to select the textbox, you have to click on the very bottom or very top to manage to select it. Anyone have any ideas?

Thanks,

Katherine
 
Hi Katherine,

Why don't you just apply the class to the input itself? Like this:

Code:
<input name="Fri" type="text" size="4" class="form_item">

This works for me in IE and firefox.

Regards


Jakob
 
Thanks Jakob, it works perfectly, I don't know why I didn't think of that!

Katherine
 
it's not always that you can apply the styles and it will work.. eg. for making css layout for hyperlinks, I had to use <div>

I dont know what it is with <span>,but it seems kindof limited some times. I use the <div>, whenever I can.

There are always some issues in IE, if you optimize for standard code, but most of the time, you can find a work-around.

Olav Alexander Mjelde
Admin & Webmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top