小编Hit*_*bag的帖子

如何仅使用CSS设置目标文本的背景颜色?

题

如何在文本后面动态添加绿色背景,而不是整个页面宽度,只是文本.

问题

绿色正在使用我当前的代码扩展到整个页面.我无法修改HTML或Javascript,只能修改CSS文件.

在此输入图像描述

HTML

<h1>The Last Will and Testament of Eric Jones</h1> 
Run Code Online (Sandbox Code Playgroud)

CSS

h1 { 
    text-align: center; 
    background-color: green; 
}
Run Code Online (Sandbox Code Playgroud)

html css

119
推荐指数
6
解决办法
37万
查看次数

如何让我的web.config文件远程显示错误?

我正在尝试查看我网站的错误,当我访问该网站时,我收到此消息:

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)

asp.net web-config

10
推荐指数
2
解决办法
3万
查看次数

将Drawing.Color转换为HTML颜色值

我已经问了一个关于这个的问题,但是我错了.

我GetRandColor()在服务器上有一个返回System.Drawing.Color对象的方法.

我想要的是能够在页面加载时使用它设置html属性.举个例子,

<html>
<body bgcolor="#GetRandColor()">
<h1>Hello world!</h1>

</body>
</html>
Run Code Online (Sandbox Code Playgroud)

html c# asp.net

7
推荐指数
1
解决办法
1万
查看次数

如何让我的菜单控制居中?

我正在使用 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)

但是没有用。那么我的下一步是什么?

c# asp.net

1
推荐指数
1
解决办法
8138
查看次数

标签 统计

asp.net ×3

c# ×2

html ×2

css ×1

web-config ×1