background-image

CSS - Background image stretch horizontally and repeat vertically?

孤街醉人 提交于 2019-12-10 03:45:51
问题 Using background-size: cover I am able to make the background stretch to fit the full width of the page. Using repeat-y I am able to make the background repeat or tile vertically, to the full height of the page. Is there any way to combine these two effects? Unfortunately they don't seem to work together (at least in Chrome). It appears that I can either stretch in both directions with background-size: cover , or not stretch in the x direction but repeat in the y direction. Edit: Using

scale background image

我们两清 提交于 2019-12-10 02:56:10
问题 I would like to scale up and down a background image in my page. I've tried multiple things but nothing quite seems to work the way I want. :( The url of my page is http://quaaoutlodge.com/drupal-7.14/ and for each link, there's a different background image. I know the size and quality of the images will need to be optimized but I first want to figure out the techincal part of it. If someone please coudl assist in getting this going? Thank you very much! Ron 回答1: Same background image on

How to keep background image on bottom left even scrolling

半城伤御伤魂 提交于 2019-12-10 02:47:06
问题 I was wondering if there is a way to keep my background image on bottom left all the time even if the user scroll the browser. My current css can make the image in the bottom of the browser when the site loaded, but if I scroll the browser, it will still stay in the same location. I appreciate any help. html, body { background-image:url("backgroundBottom.png"); background-position:bottom left; background-repeat:no-repeat; background-attachement:fixed; //I just add this, don't think this would

Responsive background images bootstrap 3

99封情书 提交于 2019-12-09 21:16:21
问题 I am using bootstrap and am trying to make my background images responsive, but its just not working! Here is my code... html <div class="row"> <div class="bg"> <img src="../img/home_bg.jpg" alt="home background image"> </div><!-- /.bg --> </div><!-- /.row --> css .bg { background-repeat: no-repeat; background-position: center center; background-attachment: fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } Please help me!

Border-radius on background-image [closed]

荒凉一梦 提交于 2019-12-09 14:05:42
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Is it possible to add border-radius on background-image ? 回答1: Yes it is possible: div { -webkit-border-radius: 50px; -moz-border-radius: 50px; border-radius: 50px; border: none; width: 500px; height: 335px; background: url(http://themescompany.com/wp-content/uploads/2012/02/6402.jpg); } Click here for demo. 回答2

how to fit the plot over a background image in R and ggplot2

自作多情 提交于 2019-12-09 13:20:44
问题 I am trying to fit the plot that is displayed over the background image. I cannot stretch the image too much because of the loss of sharpness. Therefore, I have to fit the plot over the background image which is much thinner than the plot. I do not know how to do it. Please see the attached plot: Here is the sample R Code: library(ggplot2) library(readxl) library(jpeg) library(grid) # find the ".jpg" image files and parse them to get the depth ranges for each image setwd('~/R/Image_Example')

Make background image responsive

天涯浪子 提交于 2019-12-09 10:10:20
问题 I want to make background image responsive both in width as well as in height so that i can run it in mobile. I have used this .your_background_class_name { width: 100%; height:auto; top: 0px; left: 0px; z-index: -1; position: absolute; } but it works in width only not in height. What changes should i do to make it work? 回答1: html { background: url(https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSvctt0I--skoKQVfuVt-i4Et6vQ5ve7lXPkLy9sTElCWLKh1Ps) no-repeat center center fixed; -webkit

Extend background gradient across body without background-attachment: fixed

为君一笑 提交于 2019-12-09 06:39:57
问题 I want to have a background gradient, e.g. background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(2, 126, 174, 0.9)) on the body of my document which extends across the entire height of the body - and scrolls with the body. Using background-attachment: fixed; I get the entire height (of the viewport), but it, well, stays fixed. background-attachment: scroll; gets me the scrolling, but then it just extends across the viewport height. Any way to get both? Edit: As Boltclock pointed out

How to change the background image of a button using JavaScript?

徘徊边缘 提交于 2019-12-09 03:39:22
I want to change the background image of a button using Javascript. Here is what I am currently trying, but it is failing. HTML code - <tr id="Rank1"> <td><button class="darkSquare"></button></td> <td><button class="lightSquare" ></button></td> <td><button class="darkSquare" ></button></td> <td><button class="lightSquare" ></button></td> <td><button id="e1" class="darkSquare" ></button></td> <td><button class="lightSquare" ></button></td> <td><button class="darkSquare" ></button></td> <td><button class="lightSquare"> </button></td> </tr> JavaScript Code initializer(); function initializer() {

CSS two background images using a sprite

半腔热情 提交于 2019-12-08 20:46:29
I'm new to sprites and this particular task is boggling me - please help someone. I currently use two background images like so: body { background-attachment: fixed; background-image: url("images/bktopright.png"), url("images/bkbottomleft.png"); background-position: right top, left bottom; background-repeat: no-repeat; line-height: 1; min-width: 1150px; } In order to improve page load time I'd now like to use one image, a sprite. I think this is unique in that I'd like to use the same image twice on the background, where I show one part of the image in the top right and one part of the image