xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

CSS background & background-image & border-image All In One

CSS background & background-image & border-image All In One

background


background-image


border-image



background & radius border

background color & view bug

https://codepen.io/xgqfrms/full/JQeqXQ


linear-gradient

https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient

https://codepen.io/xgqfrms/pen/WqEBLB

https://codepen.io/xgqfrms/pen/bPrymz

background-size

cover

https://developer.mozilla.org/zh-CN/docs/Web/CSS/background-size


.circle {
    position: absolute;
    width: 1.76rem;
    height: 1.56rem;
    line-height: 1.56rem;
    /* background: url("../../images/guide/hexagon.png") cover no-repeat center center ; */
    background: url("../../images/guide/hexagon.png") no-repeat center center ;
    background-size: cover;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    font-size: 0.28rem;
    /* font-size: 0.16rem; */
    color: #fff;
}

/* iphone 6/7/8 */
/* width: 375px & height: 667px */
@media (min-width: 375px) and (max-width: 375px) and (orientation: portrait) {
    .circle {
        position: absolute;
        width: 1.76rem;
        height: 1.76rem;
        line-height: 1.56rem;
        background: url("../../images/guide/hexagon.png") no-repeat center center;
        text-align: center;
        vertical-align: middle;
        cursor: pointer;
        font-size: 0.16rem;
        color: #fff;
    }
    .menu-text31 {
        transform: translateX(0.55rem) translateY(-0.15rem);
    }
    .menu-text32 {
        transform: translateX(-0.35rem) translateY(0.3rem);
    }
}

/* iphone 6/7/8 plus*/
/* width: 414px & height: 736px */
@media (min-width: 414px) and (max-width: 414px) and (orientation: portrait) {
    .circle {
        position: absolute;
        width: 1.76rem;
        height: 1.56rem;
        line-height: 1.56rem;
        background: url("../../images/guide/hexagon.png") no-repeat center center;
        text-align: center;
        vertical-align: middle;
        cursor: pointer;
        font-size: 0.16rem;
        color: #fff;
    }
    .menu-text31{
        transform: translateX(0.45rem) translateY(-0.15rem);
    }
    .menu-text32{
        transform: translateX(-0.35rem) translateY(0.2rem);
    }
}

demo

css background-image & linear-gradient

.text-brand-yellow-pink {
    --tw-gradient-from: #fed038;
    --tw-gradient-stops: var(--tw-gradient-from),var(--tw-gradient-to,rgba(254,208,56,0));
    --tw-gradient-to: #ff0d6a;
}

.text-brand-yellow-pink, .text-ukraine-gradient {
    -webkit-background-clip: text;
    background-clip: text;
    background-image: linear-gradient(to right,var(--tw-gradient-stops));
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    color: transparent;
}

https://gatsbyconf.com/

refs

https://developer.mozilla.org/en-US/docs/Web/CSS/background

https://developer.mozilla.org/en-US/docs/Web/CSS/background-image

https://developer.mozilla.org/en-US/docs/Web/CSS/border-image



©xgqfrms 2012-2020

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2019-06-26 14:36  xgqfrms  阅读(442)  评论(3编辑  收藏  举报