有没有办法将背景图像从其元素的右侧定位一定数量的像素?
例如,要从左侧定位一定数量的像素(例如10),我就是这样做的:
#myElement {
background-position: 10px 0;
}
Run Code Online (Sandbox Code Playgroud) 现在我在我的LESS代码中尝试在CSS3中执行此操作:
width: calc(100% - 200px);
Run Code Online (Sandbox Code Playgroud)
但是,当LESS编译时,它输出:
width: calc(-100%);
Run Code Online (Sandbox Code Playgroud)
有没有办法告诉LESS不要以这种方式编译并正常输出?
我想将图像作为网页的背景,但是它相对于中心偏移了一些像素.
我怎样才能做到这一点?
我想要:
background-image: url("bg.png");
background-position: 25% center;
background-attachment: fixed;
background-repeat: no-repeat;
Run Code Online (Sandbox Code Playgroud)
但不是25%,我想要的东西是"中心 - 50px".这有什么解决方案吗?
我有一个500x500像素的图像,在我的网站上设置为背景图像(作为背景图像<body>
)但我需要这个图像位于网页的右下角.我怎样才能做到这一点?(用css方法更好)
谢谢.
首先,看看这个图像
Gmail使用此图片显示动画表情符号.
我们如何使用png图像显示这样的动画?
我想设置一个背景图像一个div,在某种程度上,这是在上RIGHT的div,但有固定10px
的顶部和右侧的距离.
如果想要它在div 的上部LEFT中,我将如何做到这一点:
background: url(images/img06.gif) no-repeat 10px 10px;
反正是有达到同样的效果,但显示在上背景RIGHT?
我想将我的背景图像放在中心,只重复左边的最后一个左边的像素列,右边和最后一个像素的底部重复相同.所以,如果你缩小,你会看到这个
-------------- repeat last pixel of the right of the picture to the right
| |
| |
--------------
^
|
here repeat to the left the first pixels to the left
Run Code Online (Sandbox Code Playgroud)
在图片下方,最低的像素行重复下来.
我希望你明白我的意思......
小须
我<select>
在网站上有各种宽度的元素.我想13px
从选择宽度的右边缘定位背景图像.在伪代码中:
select {
background-image: url(../images/select-arrow.png),
background-position: center (right - 13px);
}
Run Code Online (Sandbox Code Playgroud)
我如何在CSS中执行此操作?
css ×7
animation ×1
background ×1
css-calc ×1
css3 ×1
html ×1
image ×1
javascript ×1
less ×1
png ×1