简体   繁体   English

任何人都可以告诉我在应用CSS时出错了

[英]Can any one tell where i went wrong in applying CSS

I applied a css for image button as follows 我按如下方式应用了css for image按钮

<style type="text/css">
    .selected
    {
        padding-left:50px;
        background: transparent url('Images/samplecopy.jpg') ;
        background-repeat: repeat;
    }
</style>

<asp:ImageButton ID="btnYes" CssClass="selected" runat="server" ImageUrl="~/Images/image.jpg" />

But i am not getting as per required. 但我没有按要求得到。 i would like to cover the whole image button with the background image that applied 我想用应用的背景图像覆盖整个image button

在此输入图像描述

I need to hover that black back ground exactly on the image can any one help me 我需要将黑色背景正好悬停在图像上,任何人都可以帮助我

Don't use the padding, that's what causing the problem. 不要使用填充,这是导致问题的原因。

Use the following code and see if it helps 使用以下代码,看看它是否有帮助

<style type="text/css">
.selected
{
    padding:0px;
    background: transparent url('Images/samplecopy.jpg') ;
    background-repeat: repeat;
}
</style>

UPDATE UPDATE

clear: both;
padding: 5px;
border: 1px;
background: transparent url('Images/samplecopy.jpg') ;
background-repeat: repeat;
color: #FFF;
font-weight: bold;
font-size: 12px;
border-radius:3px;

Try these properties in CSS and tell me if it helps. 在CSS中尝试这些属性,并告诉我它是否有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM