background-image

Background size on iOS

北城余情 提交于 2019-12-28 11:50:02
问题 I've spent the morning doing research on the following issue. I'm making a one page site, using a lot of images. I'm aware that Safari is known for its weird handling of background-attachment:fixed, but that's working fine; my problem is background-size:cover is not working in conjunction with fixed . I have 5 pages, all of which have a height or min-height of 100%. The last page is fixed like this: #div5 { height:100%; width:100%; position: relative; background-image: url("img/background.jpg

Size the DIV to the size of the background image

十年热恋 提交于 2019-12-28 06:52:12
问题 I have a DIV with the following style .vplayer-container .logo { position: absolute; bottom: 50px; right: 10px; background: url(../img/logo.png) no-repeat; border: 1px solid #000000; max-width: 50px; max-height: 50px; } I want that the DIV size is the same as the background image. Since the bg image change, I want it to be set automatically. I can use JavaScript, but I'd prefer a CSS way for that. I'm targeting HTML5 browsers that is FireFox, Webkit and Opera. Thanks Answer: With Kyle

Background images: how to fill whole div if image is small and vice versa

不问归期 提交于 2019-12-28 04:58:29
问题 I have three problems: When I tried to use a background image in a smaller size div, the div shows only part of image. How can I show the full or a specific part of image? I have a smaller image and I want to use in a bigger div. But don't want to use repeat function. Is there any way in CSS to manipulate the opacity of an image? 回答1: Resize the image to fit the div size. With CSS3 you can do this: /* with CSS 3 */ #yourdiv { background: url('bgimage.jpg') no-repeat; background-size: 100%; }

Background image in a JFrame

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-28 04:28:09
问题 This question has been asked a lot but everywhere the answers fall short. I can get a JFrame to display a background image just fine by extending JPanel and overriding paintComponent, like so: class BackgroundPanel extends JPanel { private ImageIcon imageIcon; public BackgroundPanel() { this.imageIcon = Icons.getIcon("foo"); } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); g.drawImage(imageIcon.getImage(), 0,0,imageIcon.getIconWidth(),imageIcon.getIconHeight()

How to add a background image on top of a previous background image?

那年仲夏 提交于 2019-12-28 03:14:03
问题 I have a css page that I am writing and I need to apply a background image in one class and then use a different class to put a partially transparent background image on top of the one that is already there. That is a bit of a word salad so let me give a bit of a demonstration. html{ <div class="background1">...</div> <div class="background1 backgroundFilter">...</div> <div class="background2">...</div> <div class="background2 backgroundFilter">...</div> } css { .background1 { background

Background Image Placement

左心房为你撑大大i 提交于 2019-12-28 01:52:33
问题 I'm trying to set my root LinearLayout element (which is set to fill_parent in both dimensions) to have a background image which is always located in the lower left corner of the screen no matter the orientation of the device. It would be excellent if there were some way to set the background image position such as that which you can do with css using "background-position: left bottom;" but I'm not seeing a way to achieve this in Android. Is there a way to do this? Thanks for the help. 回答1:

Symfony2 - Assetic - load images in CSS

旧城冷巷雨未停 提交于 2019-12-28 01:45:12
问题 I have a CoreBundle that contains main css files and images. Now I have a problem when I load an image from css; the image isn't shown. background-image:url(../images/file.png) (with a full path it works) I installed the assets using the command: assets:install web and i can see the image and css files under web/bundles/cmtcore/(css|images) . Here's the file structure inside the core bundle: /CoreBundle /Resources /public /css /main.css /images /file.png And here's how I load the css file

Symfony2 - Assetic - load images in CSS

╄→гoц情女王★ 提交于 2019-12-28 01:44:08
问题 I have a CoreBundle that contains main css files and images. Now I have a problem when I load an image from css; the image isn't shown. background-image:url(../images/file.png) (with a full path it works) I installed the assets using the command: assets:install web and i can see the image and css files under web/bundles/cmtcore/(css|images) . Here's the file structure inside the core bundle: /CoreBundle /Resources /public /css /main.css /images /file.png And here's how I load the css file

Changing the colour of background behind image css

扶醉桌前 提交于 2019-12-25 15:55:58
问题 In CSS I'm using a gif as a background image: background: url(http://*URL of gif*) no-repeat 50% 50%; but depending on screen size I can still slightly see the background behind that image(it is white). How do I change the colour behind that image? I want to change it to be black. 回答1: Simply include background color in your declartion background: yourcolor url(http://*URL of gif*) no-repeat 50% 50%; 回答2: The background shorthand property is made up of eight other properties: background-image

Changing the colour of background behind image css

为君一笑 提交于 2019-12-25 15:55:09
问题 In CSS I'm using a gif as a background image: background: url(http://*URL of gif*) no-repeat 50% 50%; but depending on screen size I can still slightly see the background behind that image(it is white). How do I change the colour behind that image? I want to change it to be black. 回答1: Simply include background color in your declartion background: yourcolor url(http://*URL of gif*) no-repeat 50% 50%; 回答2: The background shorthand property is made up of eight other properties: background-image