浏览器无法正确呈现ASP .NET控件 [英] ASP .NET controls not rendered properly by browser

查看:75
本文介绍了浏览器无法正确呈现ASP .NET控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我写了下面的代码来产生一些标签,文本框和一个输入区域:

Hello,

I have written the following to produce some labels, text boxes and an input area:

<asp:Label id="lblFrom" style="left: 121px; position: absolute; top: 200px" runat="server" Font-Names="Trebuchet MS">Your E-Mail:</asp:Label>
<asp:TextBox id="txtFrom" style="left: 225px; width=300px; position: absolute; top: 200px" runat="server" Font-Names="Trebuchet MS"></asp:TextBox>
<asp:Label id="lblSubject" style="left: 121px; position: absolute; top: 225px" runat="server" Font-Names="Trebuchet MS">Subject:</asp:Label>
<asp:TextBox id="txtSubject" style="left: 225px; width=300px; position: absolute; top: 225px" runat="server" Font-Names="Trebuchet MS"></asp:TextBox>
<asp:Label id="lblMessage" style="left: 121px; position: absolute; top: 250px" runat="server" Font-Names="Trebuchet MS">Message:</asp:Label>
<textarea id="txtMessage" style="left: 225px; width=300px; height=200px; position: absolute; top: 250px; right: 174px;" runat="server"></textarea>

当我在浏览器中预览时,控件远小于指定的大小.当我查看源代码时,就像这样:

When I preview in browser, the controls are much smaller than the sizes specified. When I view source, it is like so:

<span id="lblFrom" style="font-family:Trebuchet MS;left: 121px; position: absolute; top: 200px">Your E-Mail:</span>
<input name="txtFrom" type="text" id="txtFrom" style="font-family:Trebuchet MS;left: 225px; width=300px; position: absolute; top: 200px" />
<span id="lblSubject" style="font-family:Trebuchet MS;left: 121px; position: absolute; top: 225px">Subject:</span>
<input name="txtSubject" type="text" id="txtSubject" style="font-family:Trebuchet MS;left: 225px; width=300px; position: absolute; top: 225px" />
<span id="lblMessage" style="font-family:Trebuchet MS;left: 121px; position: absolute; top: 250px">Message:</span>
<textarea name="txtMessage" id="txtMessage" style="left: 225px; width=300px; height=200px; position: absolute; top: 250px; right: 174px;"></textarea>


代码看起来不错.为什么会发生这种情况?


The code looks fine. Why is this happening?

推荐答案

是的,即使对我来说,代码也很好.原因可能是您更改了浏览器的文本大小.如果不是,请在多个浏览器上对其进行测试,然后告诉我们无法正确显示控件的浏览器名称.
Yes even to me also the code is looking fine. A cause may be you have changed the text size of the browser. if not then please test it on multiple browser and then tell us the name of the browser which does not display the controls properly.


这篇关于浏览器无法正确呈现ASP .NET控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆