如何在文本后面动态添加绿色背景,而不是整个页面宽度,只是文本.
绿色正在使用我当前的代码扩展到整个页面.我无法修改HTML或Javascript,只能修改CSS文件.

<h1>The Last Will and Testament of Eric Jones</h1>
Run Code Online (Sandbox Code Playgroud)
h1 {
text-align: center;
background-color: green;
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试查看我网站的错误,当我访问该网站时,我收到此消息:
Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the …Run Code Online (Sandbox Code Playgroud) 我已经问了一个关于这个的问题,但是我错了.
我GetRandColor()在服务器上有一个返回System.Drawing.Color对象的方法.
我想要的是能够在页面加载时使用它设置html属性.举个例子,
<html>
<body bgcolor="#GetRandColor()">
<h1>Hello world!</h1>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我正在使用 ASP.Net 的菜单控件http://msdn.microsoft.com/en-us/library/ecs0x9w5%28v=vs.80%29.aspx,我正在尝试定位它。
菜单的标记是这个
<asp:Menu ID="SiteMenu" runat="server" Orientation="Horizontal" BorderColor="Blue" Font-Size="XX-Large" StaticMenuItemStyle-BackColor = "Pink" StaticMenuItemStyle-HorizontalPadding = "11">
<Items>
<asp:MenuItem Text="Articles" Value="New Item"></asp:MenuItem>
<asp:MenuItem Text="Wiki" Value="New Item"></asp:MenuItem>
<asp:MenuItem Text="Forums" Value="New Item"></asp:MenuItem>
<asp:MenuItem Text="Links" Value="New Item"></asp:MenuItem>
</Items>
</asp:Menu>
Run Code Online (Sandbox Code Playgroud)
所以我只是想我会在它周围添加标签,
<div horizontal-align:center>
<asp:Menu ID="SiteMenu" runat="server" Orientation="Horizontal" BorderColor="Blue" Font-Size="XX-Large" StaticMenuItemStyle-BackColor = "Pink" StaticMenuItemStyle-HorizontalPadding = "11">
<Items>
<asp:MenuItem Text="Articles" Value="New Item"></asp:MenuItem>
<asp:MenuItem Text="Wiki" Value="New Item"></asp:MenuItem>
<asp:MenuItem Text="Forums" Value="New Item"></asp:MenuItem>
<asp:MenuItem Text="Links" Value="New Item"></asp:MenuItem>
</Items>
</asp:Menu>
</div>
Run Code Online (Sandbox Code Playgroud)
但是没有用。那么我的下一步是什么?