background-image

How does this scrolling shadows CSS-magic work?

限于喜欢 提交于 2020-01-13 19:31:26
问题 I found this infamous article from 2012. It details how to create scrolling shadows and still works beautifully but I really want to understand the solution and I can't seem to find the necessary information online. Here is the minified code originally created (blog-post) by @kizmarh and improved by @leaverou: .scrollbox { overflow: auto; width: 200px; max-height: 150px; background: /* Shadow covers */ linear-gradient(white 30%, rgba(255, 255, 255, 0)), linear-gradient(rgba(255, 255, 255, 0),

Chrome 69 when using 'transform', '-webkit-background-clip: text' and 'color:transparent' don't work

大兔子大兔子 提交于 2020-01-13 09:05:53
问题 CSS code : .test { -webkit-background-clip: text; color: transparent; background-image: linear-gradient(to right, #e74c3c 20%, #f4d03f 40%, #2ecc71 60%, #5dade2 80%, #a569bd 100%); display: inline-block; } <span class="test">abcde</span> but with 'transform', .test { -webkit-background-clip: text; color: transparent; background-image: linear-gradient(to right, #e74c3c 20%, #f4d03f 40%, #2ecc71 60%, #5dade2 80%, #a569bd 100%); transform-origin: 0; transform: scale(1.2); /*any attributes*/

A way to create random-noise background image (png) with javascript?

女生的网名这么多〃 提交于 2020-01-12 05:32:04
问题 The new layout of YouTube added a background random-noise which I like very much, having seen almost exactely the same effect on other sites, so I plan to use the same technique in my webpage prototypes, or at least have this "trick" in my toolbox for future use. The image is like this (taken from http://g.raphaeljs.com/barchart.html): Now Youtube accomplishes the (embarrassingly identical) same effect by embedding the image in source code: (on Youtube main page, right click background to

fixed background for part of a site (div) in iOS

隐身守侯 提交于 2020-01-11 12:12:55
问题 I want to have a fixed position background image that covers the whole screen only for a section of my website (actually two sections, but independently, so there is no difference). I use this CSS on the container DIV of the section: #wrapper { background-image: url(../img/bg1_IMG_1509.jpg); background-position: center center; background-repeat: no-repeat; background-attachment: fixed; background-size: cover; } (Note: I used the seperate properties instead of the shorthand background hoping

fixed background for part of a site (div) in iOS

*爱你&永不变心* 提交于 2020-01-11 12:11:33
问题 I want to have a fixed position background image that covers the whole screen only for a section of my website (actually two sections, but independently, so there is no difference). I use this CSS on the container DIV of the section: #wrapper { background-image: url(../img/bg1_IMG_1509.jpg); background-position: center center; background-repeat: no-repeat; background-attachment: fixed; background-size: cover; } (Note: I used the seperate properties instead of the shorthand background hoping

Inline SVG not working as background-image in IE

冷暖自知 提交于 2020-01-11 09:46:10
问题 I'm trying to set the background-image css property to encoded data URI content as shown in this fiddle It works as expected for all browsers I tested. The only browser that doesn't show the contents is IE 9/10. But I have another example that works in IE 9/10. The difference here is that the data URI contents are initially created in Chrome (by Raphaël) and then used in the example. If the SVG is created in IE (as in the 1st fiddle by Raphaël) itself it's not being displayed if used as

How to shift a background image with css

隐身守侯 提交于 2020-01-10 11:51:04
问题 I wanted to put a border around a table which has a background image. The border works fine, but when I do this (it is an 8px border) the background image gets cut off by the border. Am I able to shift the background image to start 8px to the right and 8px down? 回答1: You can use the background-position: background-position: 8px 8px; 回答2: you could also use some short hand. background: <colour> <image url> <repeat> <left> <top> <scroll> for yours i'd be thinking something like: background :

Set the Background Image of a SurfaceView

余生长醉 提交于 2020-01-09 10:12:26
问题 Is there a way to set the background image of a SurfaceView? Does it have to be done in xml or can I do it all in Java - I've got something that looks like this in my constructor: Drawable sky = (getResources().getDrawable(R.drawable.sky)); this.setBackgroundDrawable(sky); But it still doesn't show anything. 回答1: You cannot set a background drawable on a SurfaceView. You'll have to draw the background onto the surface yourself. 回答2: While you can't directly set a background image to a

Set the Background Image of a SurfaceView

和自甴很熟 提交于 2020-01-09 10:12:05
问题 Is there a way to set the background image of a SurfaceView? Does it have to be done in xml or can I do it all in Java - I've got something that looks like this in my constructor: Drawable sky = (getResources().getDrawable(R.drawable.sky)); this.setBackgroundDrawable(sky); But it still doesn't show anything. 回答1: You cannot set a background drawable on a SurfaceView. You'll have to draw the background onto the surface yourself. 回答2: While you can't directly set a background image to a

Add background image into applet frame

半世苍凉 提交于 2020-01-07 08:29:03
问题 I am trying to add a background image to my applet, but don't know how to add. Here is my code. public class SAMmain extends JApplet{ public JMenuBar mbar=new JMenuBar(); public JMenu newStudent,viewtudent,markAttendence; public void init() { setSize(1366, 768); setJMenuBar(mbar); newStudent= new JMenu("New Student "); mbar.add(newStudent); viewtudent= new JMenu("View student"); mbar.add(viewtudent); markAttendence= new JMenu("Mark Attendence"); mbar.add(markAttendence); } public void start()