Add URL link in CSS Background Image?

前端 未结 3 1265
暖寄归人
暖寄归人 2020-12-15 07:57

I have a CSS entry that looks like this:

.header {
    background-image: url(\"./images/embouchure.jpg\");
    background-repeat: no-repeat;
    height:160px         


        
3条回答
  •  无人及你
    2020-12-15 08:16

    Try wrapping the spans in an anchor tag and apply the background image to that.

    HTML:

    
    

    CSS:

    .header {
        border-bottom:1px solid #eaeaea;
    }
    
    .header a {
        display: block;
        background-image: url("./images/embouchure.jpg");
        background-repeat: no-repeat;
        height:160px;
        padding-left:280px;
        padding-top:50px;
        width:470px;
        color: #eaeaea;
    }
    

提交回复
热议问题