Can background image extend beyond div's borders?

后端 未结 7 1349
遥遥无期
遥遥无期 2020-12-05 10:05

Can background image extend beyond div\'s borders? Does overflow: visible apply to this?

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-05 10:27

    not possible to set a background image 'outside' it's element,

    BUT YOU CAN DO what you want with using 'PSEUDO' element and make that whatever size you want and position it wherever you want. see here : i have set the arrow outside the span enter image description here

    here is the code

    HTML :

    dasdasda

    strong text

     .tooltip{position:relative; float:left;}
        .tooltip .msg {font-size:12px;
            background-color:#fff9ea;
            border:2px #e1ca82 solid;
            border-radius:5px;
            background-position:left;
            position:absolute;
            padding:4px 5px 4px 10px;
            top:0%; left:104%;
            z-index:9000; position:absolute; max-width:250px;clear:both;
        min-width:150px;}
    
    
        .tooltip .msg:before {
            background:url(tool_tip.png);
            background-repeat:no-repeat;
        content: " ";
            display: block;
            height: 20px;
            position: absolute;
            left:-10px; top:1px;
            width: 20px;
            z-index: -1;
            }
    

    see here example: http://jsfiddle.net/568Zy/11/

提交回复
热议问题