/* Keyword values */background-position:top;background-position:bottom;background-position:left;background-position:right;background-position:center;/* <percentage> values */background-position:25%75%;/* <length> values */background-position:00;background-position:1cm 2cm;background-position:10ch...
ckground-position指定背景图片的初始位置。这个初始位置是相对于以background-origin定义的背景位置图层来说的。 /* Keyword values */background-position:top;background-position:bottom;background-position:left;background-position:right;background-position:center;/* <percentage> values */background-position:25...
In the first rule of the following example, only a value forbackground-color has been given and the other individual properties are set to their initial values. In the second rule, many individual properties have been specified. body{background:red} p{background:url("chess.png...
but an initial background position needs to be set along with the background image you want to use for the effect. 但背景的初始位置需要与背景图一同设置,背景图是用来做效果用的。 blog.sina.com.cn 3. The background attribute loads the sprite and then sets the background position to 336 pix...
The background-position CSS property sets the initial position for each background image. The position is relative to the position layer set by background-origin.
该属性的语法如下: background-position: [ percentage | length | left | center | right ] 1 or 2 values | initial | inherit 下面的示例演示了如何使用background-position属性。 示例 p { background-image: url("images/smiley.png"); background-position: 50% center; }测试看看‹/› ...
background-position-x:1cm;background-position-x:8em;/* side-relative values */background-position-x:right 3px;background-position-x:left25%;/* Multiple values */background-position-x:0px,center;/* Global values */background-position-x:inherit;background-position-x:initial;background-...
background-position-x:1cm;background-position-x:8em;/* side-relative values */background-position-x:right 3px;background-position-x:left25%;/* Multiple values */background-position-x:0px,center;/* Global values */background-position-x:inherit;background-position-x:initial;background-...
Document div { width: 500px; height: 400px; background: coral; background-image: url(../6594.jpg); background-size: 50% auto; background-repeat: no-repeat; background-position: center; } 写回答1回答 好帮手慕星星 2021-09-02 同学你好,课程中老师讲解的确实有问题,写一...
DOCTYPE html>234567雪碧图练习8910111213141516171819 CSS 1*{margin:0;padding:0;}2html,body{3width:100%;4height:100%;5}6.footer{7position:relative;8width:100%