background-image

Anchoring CSS Repeating Background Image

时间秒杀一切 提交于 2019-12-05 19:57:58
I have a webpage with a header banner in the following configuration: <---Repeating Image Left--><---Banner Image---><---Repeating Image Right---> The page is designed with fixed width content, but the banner spans the entire width of the browser window (thus the reason for including repeating images on the left and right). The two repeating images are different and they are also not standard background images which can be positioned where-ever. Instead, the left image needs to be anchored/stuck to the left-hand side of the banner image and then repeat itself leftwards, from that point, as the

How do I convert a CSS background-position property from percentages into pixels?

蹲街弑〆低调 提交于 2019-12-05 16:01:04
I'm centering a background right now (using background-position: 50% 50%; ), that I'd like to animate using Javascript. But, I want to be able to animate this using pixel measurements. Effectively I want to set the background-position to something like "50% + 10px". Is this possible using Javascript? I can possibly do it by finding the height of the background image and the height of the browser screen and do some arithmetic, but this seems like a convoluted solution. In the future this will be possible using CSS3's calc function. But since that's not widely supported right now, below is a

How to load all background images at one time

为君一笑 提交于 2019-12-05 12:29:56
I have first website page and it have few background images, which are crossfading. So, the problem is that when page are not cached at computer at first, it's took some time to load next background image on crossfading effect. Any ideas how to load all images at once? JSFiddle: https://jsfiddle.net/sawqo6j9/ var i=0; var imghead=[ "url(http://www.psdgraphics.com/file/abstract-mosaic-background.png)", "url(http://www.psdgraphics.com/file/colorful-triangles-background.jpg)", "url(http://www.mrwallpaper.com/wallpapers/gradient-background.jpg)" ]; function slideimg() { setTimeout(function () {

Different CSS background-image depending on month and year

我的未来我决定 提交于 2019-12-05 11:00:42
Basically, I have a div with text in it, and I want the background to display a different image depending on what month and year it is. How can I achieve this? Any help would be greatly appriciated! *I've prepared 4 years worth of monthly images labelled "month0_2011.png" to "month11_2014.png" already if that helps?* Add a .php extension to the CSS and use PHP code to determine that. Just use standard PHP tags. For example: body { background-image:url('<?php echo $currentImagePath ?>'); } Where $currentImagePath is the path to your image, determined beforehand (i.e. top of page) using PHP.

How to Inherit grandparent CSS not parent?

孤人 提交于 2019-12-05 10:38:09
I have a feeling this won't be possible, but thought I'd ask anyway. <body> //body uses 'back' background <div id="div1"> //div1 uses 'front' background <div id="child1"> //child1: no backgrounds, so shows 'front' background </div> </div> </body> My body element uses a background image. (I'll call it the back background image) div1 uses a different background image (I'll call it the front background image), so the front background image covers over the main background image. div1 contains a child div child1 that doesn't use any background images, so it just shows the background image of its

Setting background image of a navigation bar - bootstrap

孤街醉人 提交于 2019-12-05 08:28:26
I have problem setting the background image from folder, 'img/flower.jpg'. I tried using the following code in CSS, the image does not show up: However it works if I reference it from a source in internet. #navigation,.navbar .navbar-default{ background-image: url("img/flower.jpg"); background: url('img/flower.jpg'); } <div class="container"> <!-- Navigation --> <nav class="navbar navbar-default " id="navigation" role="navigation"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> Jeen's Portfolio </div> <!-- /.navbar

Why do my image background disappear on float: left?

允我心安 提交于 2019-12-05 08:04:14
I want to create a navbar with images on each end to make it purty. So, I created the HTML and CSS below and it worked great. My menu items are in a ul/li list. When I style the list to put the items all on one line, the images on the ends disappear. What's up with that? How do I fix it? The culprit is float: left; below. --- test.html --- <html> <head> <link rel="stylesheet" href="test.css" type="text/css"> </head> <body> <div id="container"> <div id="header-usernav" class="span-6 last large"> <div id="header-usernav-leftside"><div id="header-usernav-rightside"> <ul> <li>Register</li> <li

How to deal with background image orientation in UIView

我是研究僧i 提交于 2019-12-05 07:20:46
问题 I'm using setting the background image using methodology below. When I rotate my device the background repeats, which make sense because it is not an image. How do I deal with orientation change if this is the way I'm setting my background image? - (void)viewDidLoad { [super viewDidLoad]; UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"background.png"]]; self.view.backgroundColor = background; [background release]; } 回答1: It took me awhile to understand this

Change background image of <li> on click of <a> tag

一笑奈何 提交于 2019-12-05 06:56:23
问题 html: <ul> <li id="Co" class="libgc" ><b>CO</b></li> <li id="NSCO" class="libgc active"><span> <a href="#NSale.php" target="homeFrame" class="aclass">NSale</a></span></li> </ul> css: .libgc { background-color: #CCC; padding-top: 5px; padding-bottom: 5px; text-align: center; background-image: url(../images/pcnav.png); border: 1px solid #CCC; } jquery: $("li").click(function(){ $(this).css('background-image', 'url("images/btnSelectedTab.png")'); $(this).css('color','black'); }); }); Problem :

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

a 夏天 提交于 2019-12-05 05:51:52
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*/ display: inline-block; } <span class="test">abcde</span> It will not work. the result is: The version of