background-image

Is there an ideal size for background images?

僤鯓⒐⒋嵵緔 提交于 2019-12-19 06:29:11
问题 For example, would a 1x1 image load faster than a 2x2? The size would be smaller, but the browser would have to work twice as much, right? So, is there an ideal size and shape (square vs rectangle) for background images? I know it's probably not too important, but I'm interested to know. Thank you 回答1: I don't think there is an 'ideal' size for your image. Although the quality of the image will have a role in the download time. An image with rich colors embedded will be heavy in size compared

can you create space between background image repeats?

我们两清 提交于 2019-12-19 05:53:03
问题 Is it possible to repeat a background image, but specify a number of pixels before the next repeat starts. i.e. background: url(img.png) [after 40px] repeat-x; I don't want to add empty space to the image. 回答1: background-repeat: space; background-repeat: round; // round(520 / 100) = round(5.2) = 5 The browser will render five images in the space but adjust the image width to 104px (520px / 5). The image is made wider to fit the container. Full details here or read Background Size property 来源

Animate text fill from left to right

别来无恙 提交于 2019-12-19 04:39:23
问题 I wanted to animate a the text fill with CSS. The Text should be filled with color from left to right. this is my CSS: .box-with-text { background-image: -webkit-linear-gradient(right, crimson 50%, white 50%); background-repeat: repeat; background-position: 0 0; background-size: 200% 100%; -webkit-text-fill-color: transparent; -webkit-background-clip: text; -webkit-animation: stripes normal forwards ease-in-out; animation: stripes 2s normal forwards ease-in-out; } Now only the first letter is

Why does a fixed background-image move when scrolling on IE?

佐手、 提交于 2019-12-18 12:22:23
问题 I'm trying to make background-image fixed. As you see in my blog, the background-image is moving when scrolling on IE 11. How can I fix this? This is my CSS: background-image: url("./images/cover.jpg"); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; 回答1: This is a known bug with fixed background images in Internet Explorer. We recently did some work to improve this behavior and have shipped updates to our preview build

Prevent fixed-position background-image: cover from resizing in mobile browsers upon address bar hide

混江龙づ霸主 提交于 2019-12-18 11:50:59
问题 Sorry for a lack of example on this one, but I figure it's easy enough to understand. I have a fixed background on my site, which is currently implemented like this: #background { position: fixed; top: 0; bottom: 0; left: 0; right: 0; background-color: #28305e; background-image: url(../images/background.jpg); background-size: cover; -moz-background-size: cover; background-position: center center; z-index: -10; } <div id="background"></div> This is great in all browsers so far except for

How to use responsive background image in css3 in bootstrap

余生颓废 提交于 2019-12-18 10:59:43
问题 I dont want to use html tag. This is my css. I am using bootstrap 3.0. background:url('images/ip-box.png')no-repeat; background-size:100%; height: 140px; display:block; padding:0 !important; margin:0; On 100% zoom this is OK. but when I zoom in at 180% approx, the image will be short from top and bottom, I want some css tricks. 回答1: For full image background, check this: html { background: url(images/bg.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size:

iOS 8 NavigationBar BackgroundImage

二次信任 提交于 2019-12-18 10:18:04
问题 With iOS 8 the concept of just iPhone and iPad sizes along with portrait and landscape have changed and therefor setting the navigation bars background image isn't working the same. Currently i'm using the following code: UIImage *NavigationPortraitBackground = [[UIImage imageNamed:@"nav-image-portrait"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; UIImage *NavigationLandscapeBackground = [[UIImage imageNamed:@"nav-image-landscape"] resizableImageWithCapInsets:UIEdgeInsetsMake(0

Issues with “background-position” in “background” shorthand property

假装没事ソ 提交于 2019-12-17 21:35:34
问题 I was attempting to use the background shorthand property to specify background-size , background-repeat , and background-color , but kept failing. I eventually realized that you have to set background-position if you set background-size , so I just set the property as inherit / contain no-repeat #FF7000 , as to the best of my knowledge, the default background-position should be inherited from the parent ( body , in this case), as I have not explicitly set body 's background-position . It

How to use image as a table background in email?

空扰寡人 提交于 2019-12-17 21:17:24
问题 Stack Overflow users. We run a newsletter. We need to display an image with text as a header. We've got a massive personalization for a big user database, so we need a dynamic text overlaying a text image. What are the options currently supported by most clients? The obvious plan is to use table's background-image . Supposedly it's not working in Outlook? There is a fallback plan that's bulletproof in terms of client support: generate an image server-side an include as graphic file. What

Background image JFrame with content

柔情痞子 提交于 2019-12-17 21:09:10
问题 I have a JFrame with BorderLayout , there are panels on all sides (North, East ,...). In the panels there are labels and buttons mostly. Now I want the frame to have a background image, some research told me that i had to change the content pane of my frame. When I try this however, the content gets put in the background and isn't visible. Also, I don't know how to resize the image if the frame is resized. Is there an easy fix for this or will I have to rework most of my code? 回答1: put JPanel