background-image

css with background image without repeating the image

好久不见. 提交于 2019-11-30 03:27:16
I have a column (lets assume the width is 40px) and there I have some rows. The height of the rows depends on the length of text (if the text is long then there is a break line and therefore the height increases). Now I want to display an icon in each row next to the text to show the user for example that he has already completed something in that tab. So I was trying to solve this by using only css. So if the user completes a tab then I change the css of that row. However, I'm not able to add to that row an image without that the image is being repeated. I'm using this css code: padding: 0

CSS background-size cover and background-position

微笑、不失礼 提交于 2019-11-30 02:58:25
HTML: #backgroundproduct { position: fixed; top: 5%; left: 5%; width: 90%; height: 90%; z-index: 12; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; background-position: top; } <div id="backgroundproduct" style="background-image: url(http://example.com/example.jpg)"> I'm using a images as a background image, only the lower part of the image is more important than the top. How can I make the background go up a little? If the bottom is more important: background-position: bottom; background-position also allows percentage values: 0%

How to use 100% CSS background-image with scrolling content?

怎甘沉沦 提交于 2019-11-30 02:38:14
问题 I want to create a site with a background image that always fills the entire window, even if the content can scroll vertically. I have created this JSFiddle using background-size:cover to scale the background-image to the window. It works, as long as the divs inside are smaller than the window. If you scroll vertically, the background image does not fill the page anymore, and shows a white/grey area instead. So my question is: how can I combine a 100% background image with scrolling content?

How to set the background image of a html 5 canvas to .png image

佐手、 提交于 2019-11-30 00:05:22
I would like to know how it is possible to set the background image of a canvas to a .png file. I do not want to add the image in the back of the canvas and make the canvas transparent. I want the user to be able to actually draw on that canvas with the background being the .png image so that I can extract it later as a .png with the drawings that the user made. As shown in this example , you can apply a background to a canvas element through CSS and this background will not be considered part the image, e.g. when fetching the contents through toDataURL() . Here are the contents of the example

Reference app relative virtual paths in .css file

让人想犯罪 __ 提交于 2019-11-29 23:00:48
Assume I have an "images" folder directory under the root of my application. How can I, from within a .css file, reference an image in this directory using an ASP.NET app relative path. Example: When in development, the path of ~/Images/Test.gif might resolve to /MyApp/Images/Test.gif while, in production, it might resolve to /Images/Test.gif (depending on the virtual directory for the application). I, obviously, want to avoid having to modify the .css file between environments. I know you can use Page.ResolveClientUrl to inject a url into a control's Style collection dynamically at render

Adding background image to div using css?

余生颓废 提交于 2019-11-29 22:06:46
I have been trying to add background image to a div class using css. but have no success. HTML code:- <header id="masthead" class="site-header" role="banner"> <div class="header-shadow"></div> <hgroup></hgroup> <nav role="navigation" class="site-navigation main-navigation"> </nav><!-- .site-navigation .main-navigation --> </header><!-- #masthead .site-header --> CSS:- .header-shadow{ background-image: url('../images/header-shade.jpg'); } Additional information: This is an image with shadow and i am using it at the top of the website, so it mustn't have a particular width. Nitesh You need a add

iOS: Preparing background images for applications

巧了我就是萌 提交于 2019-11-29 21:00:51
Mostly every iOS application has a view with an image as background. Is there any image sizing guide out there? For example here is an iOS screen designed in Sketch: As you can see there is a background image. Now there are lots of Apple devices every application should support. The new iOS 10 supports all devices from iPhone 5 to iPhone 6s Plus. They have different screen sizes and resolutions. When creating Xcode assets, I am giving 3 background images with different sizes - @1x, @2x, @3x . What sizes should they be? The way I see it you have 2 options: In here you will find the resolutions

iOS 8 NavigationBar BackgroundImage

本秂侑毒 提交于 2019-11-29 20:30:50
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, 0, 0, 0)]; [[UINavigationBar appearance] setBackgroundImage:NavigationPortraitBackground

Is there a srcset equivalent for css background image

懵懂的女人 提交于 2019-11-29 20:09:31
img with srcset attribute looks like a great way of doing responsive images. Is there an equivalent syntax that works in css background-image property? HTML <img src="small.jpg" srcset="medium.jpg 1000w, large.jpg 2000w" alt="yah"> CSS .mycontainer { background: url(?something goes here?); } Yoav Weiss image-set is the equivalent CSS feature. We should add equivalent srcset functionality (defining resources according to their dimensions) to the spec. Currently it's only implemented in Safari, Chrome and Opera with the -webkit- prefix, and it's only support the x descriptors. Pretty sure that:

Custom font not displaying in SVG pattern used as background-image

拜拜、爱过 提交于 2019-11-29 19:28:20
问题 I'm working with an SVG pattern that uses a custom font , so as to use that pattern as a background image on an HTML page. Everything renders fine in Chrome and Safari but it starts to get funny in Firefox: Firefox renders the SVG along with the custom font text just fine when I open the SVG file itself (so far so good!); However, Firefox does NOT render the custom font anymore when that same SVG file is used as the background to an HTML element (!) I've spent hours trying to isolate the