在不同的浏览器中显示ASP .NET控件

时间:2014-09-26 19:46:13

标签: css asp.net

我有这个标记:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="TestCSSTemplates.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">    
    <title></title>   
   <style type="text/css">
        ul { list-style: none }
        span { display:inline-block; text-align: right; width: 100px; }
        .DespliegaEnLinea { display: inline-block; }
   </style>
</head>
<body>
    <form id="form1" runat="server">
        <ul >
            <li>
                <span >Are you sure?: </span>
                <asp:RadioButtonList ID="RadioButtonList1" runat="server" 
                RepeatDirection="Horizontal" CssClass="DespliegaEnLinea">
                    <asp:ListItem>yes</asp:ListItem>
                    <asp:ListItem>no</asp:ListItem>
                </asp:RadioButtonList>                
            </li>
        </ul>       
    </form>
</body>
</html>

当页面显示在Chrome或Internet Explorer中(激活了兼容模式时为9或更低),页面按我的意图呈现: li 标记内的所有内容只有一行。 但是,当上述页面显示在Internet Explorer 11(或未激活兼容模式的9,8)时,它会在 span 标记 radiobuttonlist 控制

如何使此页面始终在一行中呈现 li 标记的内容,而不管用于查看它的浏览器是什么?

0 个答案:

没有答案