background-image

How to set a background image in rails from css?

我是研究僧i 提交于 2019-11-27 05:31:15
问题 I am using rails 3.2 and i have to set a background for one of the page and i have tried many ways and nothing went right, so looking for some good help. I have tried background: url(<%= asset_path 'background.jpg' %>) background: url("public/background.jpg"); background-image:url('/assets/images/background.jpg') and nothing worked. Please help me. 回答1: In your CSS: background-image: url(background.jpg); or background-image: url(/assets/background.jpg); In environments/production.rb : #

How to completely remove borders from HTML table

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 05:27:31
问题 My goal is to make an HTML page that is similar to a "photo frame". In other words, I want to make a blank page that is surrounded by 4 pictures. This is my code: <table> <tr> <td class="bTop" colspan="3"> </td> </tr> <tr> <td class="bLeft"> </td> <td class="middle"> </td> <td class="bRight"> </td> </tr> <tr> <td class="bBottom" colspan="3"> </td> </tr> </table> And the CSS classes are the following: .bTop { width: 960px; height: 111px; background-image: url('../Images/BackTop.jpg'); } .bLeft

Background Image Placement

百般思念 提交于 2019-11-27 03:39:01
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. You'll have to create a custom bitmap drawable with your bitmap in an XML file (eg "res/drawables/my_drawable

Symfony2 - Assetic - load images in CSS

隐身守侯 提交于 2019-11-27 02:51:15
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 into the template: {% stylesheets '@CmtCoreBundle/Resources/public/css/*' %} <link rel="stylesheet" type=

Background image tiles have gap between them when using SVG image. How to solve in Chrome?

北城余情 提交于 2019-11-27 02:20:18
问题 When I use a SVG image as the tiled background for the body of my page, there is a slight gap between the tiles. If I switch to the PNG version of the file, it does not happen. I am using the latest version of Google Chrome for Mac – version 19.0.1084.56. I haven’t tested Windows because I don’t have that platform. File works as expected in Safari and FF. After a bunch of Google searches and searching here on SO I haven’t found any similar reports. Maybe someone here has a solution. Here is

HTML5 canvas background image repeat

北城余情 提交于 2019-11-27 02:11:07
问题 I have a html5 canvas that draws a sound wave. I have set the background as an background image, however, I want this background image to repeat. Can anyone tell me how I would do this and what I need to add into my code: var backgroundImage = new Image(); backgroundImage.src = 'http://www.samskirrow.com/client-kyra/images/main-bg.jpg'; var canvas; var context; function init(c) { canvas = document.getElementById(c); context = canvas.getContext("2d"); soundManager.onready(function() {

Repeating website background image - size vs speed

我的未来我决定 提交于 2019-11-27 02:06:16
问题 I was wondering if anyone has done any tests with background images. We normally create a background that repeats at least in one direction (x or y or both). Example Let's say we have a gradient background that repeats in X direction. Gradient height is 400px. We have several possibilities. We can create as small image as possible (1 pixel width and 400 pixels high) or we can create a larger image with 400 pixels height. Observation Since gradient is 400 pixels high we probably won't choose

Change WPF window background image in C# code

邮差的信 提交于 2019-11-27 02:04:32
问题 I have a couple of Images configured as application resources. When my application starts, the background of the main window is set via XAML: <Window.Background> <ImageBrush ImageSource="/myapp;component/Images/icon.png" /> </Window.Background> If a given event occurs, I'd like to change this background to another resource ( "/myapp;component/Images/icon_gray.png" ). I've tried using two constants: private static readonly ImageBrush ENABLED_BACKGROUND = new ImageBrush(new BitmapImage(new Uri(

Responsive web design : “How to resize a background image according to browser window size using CSS”?

大兔子大兔子 提交于 2019-11-27 02:03:43
问题 I am creating a site where my all products images will be re-size according to browser window size so i wrote some media queries where i used one big image and re-sized it in different window size but i have one image which i used in background , how i can re-size it? I want support it in all browser also in IE7 and 8. HTML <div></div> CSS div{ background: url("http://canadianneighborpharmacy.net/images/cnp/discount_20.png") no-repeat scroll 0 0 transparent; position:absolute; width:45px;

Background Image Scaling While Maintaining Aspect Ratio

孤人 提交于 2019-11-27 01:38:21
问题 I would like to have images for my background that change automatically like a slide show. But I would like the images to fill the background no matter what size the browser window is...and if it is scaled down, the aspect ratio of the image does not change. Here is an example of what I'm trying to do: http://www.thesixtyone.com/ How can I accomplish these tasks? Any help will be much appreciated. 回答1: You can't, at least not like you are trying to now. What you can do, however, is create an