background-image

Extend a background into the margin

夙愿已清 提交于 2019-12-11 07:24:10
问题 I have a <div> element that has a 10 pixel margin, as shown in the code below. My question is rather simple: how do I extend the background image into the margin? I tried using the CSS3 background-clip and background-origin sub-atributes, but they have no option for extending a background into the margin. CSS: #pagesidebar { background-image:url('/Users/bagavatu/images/background.png'); margin:10px; } HTML: <div id="pagesidebar">Hello</div> I know I could append the pagesidebar div into a

How widely supported are background-size and background-origin?

爷,独闯天下 提交于 2019-12-11 07:11:24
问题 And which browsers require a prefix: -moz-background-size , -webkit-background-size , and similar? Thanks! 回答1: See CanIUse.com for a table showing browser support for this feature for all browsers and versions in common use. Short answer: IE6/7/8 don't support it. Firefox 3.6 requires -moz- prefix. Older versions of safari might have issues. Everywhere else it should work just fine. 回答2: See https://developer.mozilla.org/en/CSS/background-size Chrome supports it directly since 3.0; Firefox

How to stretch background-image in html and css styling?

北慕城南 提交于 2019-12-11 06:37:09
问题 I am new to html and css and is trying to create a personal website for learning purposes. I am having difficulties with the background image not stretching to fit the screen. Providing the code in the following. body{ background-image: url(backgroundimage.jpg); /*background-color: #95afc0;*/ background-size: cover; } The image works fine when the window is in full screen. I would like to see if there is any way for me to prevent it from duplicating the images to fit the screen and just crop

CSS background-image resizes when I set background-attachment: fixed

北城余情 提交于 2019-12-11 06:25:34
问题 I have a div named "page". I set its background-image with CSS, using the code below. I size the image to take 100% of the div's width, and it sets nicely its height to keep its scale. But when I set "background-attachment: fixed", it resizes the image. It increases the image size, and now it doesn't fit into my div, so most of it is cut. I will highly appreciate any help. The CSS code: #page { height: 100%; width: 60%; margin: 0 auto; background-image: url('bg2.jpg'); -webkit-background-size

IOS iphone 4s not repainting dynamic images that are initially outside the viewport

谁都会走 提交于 2019-12-11 05:46:06
问题 I have been suffering from a bug for sometime: I am doing something like the following: $container.on('touchmove', function(){ $container.trigger( 'lazyload.appear'); }); $img.one( 'lazyload.appear', function(){ var that= this; var $self= $(that); $self.css('background-image', "url('real.path.to.img')" ); }); However, on IOS there seems to be a problem with repainting the background-images, when they are initially outside the viewport. When I drag my finger, until the image is in the viewport

CSS clip-circle an image and put another image as border

被刻印的时光 ゝ 提交于 2019-12-11 05:39:47
问题 Similair question can be found here: CSS: How to fit an image in a circle where bottom is clipped but top pops out? However, I would like to have the red outline replaced by an image, e.g.: I tried among others :before and :after psuedo tags but did not find the soluition. Which direction I should look to achieve this? 回答1: You can use multiple background like this: .box { width:200px; height:210px; border-radius: 0 0 50% 50%/0 0 70% 70%; background: url(https://i.stack.imgur.com/bdZeE.png)

Java - Is there a way to insert a background image in a JList?

江枫思渺然 提交于 2019-12-11 05:32:41
问题 JLists don't offer a method for this, and that's very sad. Do you know how to do it? 回答1: Fixed Position List (ie the image is fixed, but you can scroll the list)... import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import javax.swing.JFrame; import javax.swing.JList;

CSS background stretches to fill screen on Safari but not on iOS

做~自己de王妃 提交于 2019-12-11 04:52:36
问题 This CSS successfully stretches my background image to fill 100% of the screen area and not scroll on safari but not on iOS. How can I also prevent the image from scrolling on iOS? body { width: 100%; height: 100%; padding: 0; margin: 0; border: 0; background: url(../img/background.jpg) center repeat-x; background-size: auto 100%; background-attachment: fixed } 回答1: body { width: 100%; height: 100%; padding: 0; margin: 0; border: 0; background: url(../img/background.jpg) center repeat-x fixed

Background not working for a div

拥有回忆 提交于 2019-12-11 04:23:09
问题 I have the following HTML: <html> <head> <title> Think in a NEW BOX. </title> <link rel="stylesheet" type="text/css" href="styles/default.css" /> </head> <body onload=""> <div id="content"> <div id="header"> <img src="images/title-1.png" /><img src="images/title-2a.png" /><img src="images/title-3.png" /></div><div id="fcontent"> hi hi </div> </div> </body> </html> ...and the following CSS: div#fcontent{ background-image:url('images/forground.png'); width:100%; padding:0px; margin-top:0px;

Bootstrap CSS/HTML background image resize

你说的曾经没有我的故事 提交于 2019-12-11 04:08:56
问题 Using bootstrap when I resize my browser, the picture that is in the background shrinks and the background color doesn't. Here is the link to the site which contains the HTML code: http://codedifferently.com/crest.html Here is the CSS code that I used: @charset "UTF-8"; /* CSS Document */ /* Move down content because we have a fixed navbar that is 50px tall */ body { padding-top: 0px; padding-bottom: 20px; } div.jumbotron { background-image: url('img/chicago2.jpg'); background-color: #3FF;