, CSS3. , .
HTML:
<div id="example">Example</div>
CSS
#example {
width: 200px;
height: 200px;
padding-left: 100px;
background-origin: content-box;
background-position: 10px 10%;
}
This is a bit of a hack, I think. Instead of starting from the top left corner of the border field, instead it uses a content field that contains 50% (i.e. 100 pixels). As I said, you need to know the exact value of the 50% fill, as the record padding-left: 50%;will be interpreted as 50% of the parent element.
If you need the full space inside this container, you can add to it <div>withmargin-left: -100px;
source
share