English 中文(简体)
一种背景形象可能大于主人本身?
原标题:Can a background image be larger than the div itself?

我有一把百分之四。 视其内容而定,该数字大约为50px。

难道能够让这块双脚带给这种四面多花的那种背景形象吗?

图像大约为800x600px,我希望能在左侧底层角放置。 它应当像我的网站那样做背景形象,但我已经在我的身上树立了背景形象。 我需要在我的网站上的底层左上角看到另一个形象,而脚踏板就能够做到这一点。

#footer {
    clear: both;
    width: 100%;
    margin: 0;
    padding: 30px 0 0;
    background:#eee url(images/bodybgbottomleft.png) no-repeat left bottom fixed;
}

图像被打上脚步,但是它却拖过四面。 能否做到这一点?

做不到工作!

最佳回答

我不认为你能够使自己的背景形象过度扩散。 图像夹中的形象可能会超出其母体的四面,但背景图像受其背景的圆环的限制。

问题回答

很简单。 将该四条dding到正数和差值,以否定

#wrapper {
    background: url(xxx.jpeg);
    padding-left: 10px;
    margin-left: -10px;
}

如本条所示,您可使用一套cs3的代用品(:和/或以下:)。

https://www.exratione.com/201109/how-to-overflow-a-background-image-using-css3/

Good Luck...

阁下,

但是,作为坚固的工作,我建议把第一期(四)归类为<代码>position:relative,并使用div:,以形成含有你形象的基本内容。 分类为position:absolute 相对于你最初的四分之三,你可以将其搬迁到任何地方。

不要忘记增加这一新内容的内容。 例如:

div {
  position: relative;
}    

div::before {
  content: ""; /* empty but necessary */
  position: absolute;
  background: ...
}

注:如果你希望成为母子主,则使用<条码>div:<>后/代码>。

利用背景覆盖面为我工作。

#footer {
    background-color: #eee;
    background-image: url(images/bodybgbottomleft.png);
    background-repeat: no-repeat;
    background-size: cover;
    clear: both;
    width: 100%;
    margin: 0;
    padding: 30px 0 0;
}

明显了解支助问题,检查 Can I Use:

使用插图:规模(1.1)使图像更大,将其提升到位置:相对;上:10px;

<div class="home-hero">
  <div class="home-hero__img"></div>
</div>
.home-hero__img{
  position:relative;
  top:-10px;
  transform: scale(1.1);
  background: {
    size: contain;
    image: url( image.svg );
  }
}

您已经提到在<代码>上有一个背景图像。

<could在html>上树立了这一背景形象,在上树立了新的形象。 这当然取决于你们的布局,但你却不需要为之 foot。

并不是说,背景形象受到它所应用的内容的约束,而过度流通的财产只适用于元素内的内容(即标记)。

你可以把另一个小块添加到你的脚步中,并将背景形象运用到这里,但这种过度流入却有。

This could help. It requires the footer height to be a fixed number. Basically, you have a div inside the footer div with it s normal content, with position: absolute, and then the image with position: relative, a negative z-index so it stays "below" everything, and a negative top value of the footer s height minus the image height (in my example, 50px - 600px = -550px). Tested in Chrome 8, FireFox 3.6 and IE 9.





相关问题
Using QCView and iSight to capture image

I have a QCView that loads a Quartz file which gives you iSights feedback (basically like a QTCaptureView) Everything displays fine The button simply takes a snapshot using the following simple ...

Taking picture with QTCaptureView

Is it possible to simply take a picture and save it somewhere using a QTCaptureView and Apple s built-in iSight? I ve seen lots of tutorials on recording video but none on simply taking a picture. Any ...

Transform rectangular image into trapezoid

In .NET how can I transform an image into a trapezoid. The Matrix class supports rotation, shear, etc, but I can t see a trapezoidal transformation. I m using the usual System.Drawing.* API, but I m ...

Rotate image through Y-axis on web page

What are my options for rotating an image on a web page through the Y-axis? I m not sure if I even have the terminology right. Is this called a rotate or a transform. Most of the searches that I ve ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

Editing a xaml icons or images

Is it possible to edit a xaml icons or images in the expression design or using other tools? Is it possible to import a xaml images (that e.g you have exported) in the expression designer for editing?...

Convert from 32-BPP to 8-BPP Indexed (C#)

I need to take a full color JPG Image and remap it s colors to a Indexed palette. The palette will consist of specific colors populated from a database. I need to map each color of the image to it s "...