background-image

Responsive background image in div full width

流过昼夜 提交于 2019-12-03 02:49:49
问题 I'm trying to figure out how to make a background-image in a div full width and responsive. The background-image is expanding across the width of the page (and is responsive), but the height of the image isn't its full height. It seems like it's being cut-off somehow. I'm using bootstrap framework, and the reason I'm trying to do this is I want to overlay some text on the image. I've tried so many different things but cant seem to figure it out, help! <div class="bg-image"> <div class=

Moving Background image in a loop from left to right

放肆的年华 提交于 2019-12-03 02:48:38
I would like to have a moving background image on my page from left to right exactly the same way as in following website http://kxip.in , please suggest how to achieve this. Thanks & Regards An interesting question with a challenging solution. Thankfully, stackoverflow.com is here to help you do your work! Obviously, you'll need jQuery! So, grab some jQuery and then come back. Back? Great. Let's start off. First, add this bit of line to your code: $(function(){ }) So, what is that $ magic stuff? Nevermind you actually learning that! We're here to get answers, not learn! But, if you're the

Auto-resizing skewed background in CSS (+ images?)

瘦欲@ 提交于 2019-12-03 02:24:50
I'm going to convert this PSD image to CSS. I've multiple h2s in multiple pages, so the inner text lenght and background-color may vary. Therefore the background should automatically adapt to "any" length. So far, the markup is something like: <h2 class="sub-heading lab-heading">Laboratori</h2> I may eventually wrap the inner text into a <span> , but keeping a semantic valid markup without any additional element would be ♥ly. The inner text is rotated, but it's not mandatory. What i'm focusing on now is the skewed background. I'm open-minded to any solution using scaled background pngs (eg.

Using Raphael JS, fill an SVG element with with a background-image with an offset

浪尽此生 提交于 2019-12-02 21:13:00
I want to this this Fill SVG element with with a background-image with an offset , but using Raphael JS. Displaying an rectangle with a background image without the offset is easy. canvas.rect( positionx, positiony, width, height ).attr( {fill: "url('/content/image_set.gif')"} ); The code above will display only the upper-left corner of the image. I want to shift it and display another part of it. How can I do it? I'd suggest drawing the image separately from the rect. If you need the stroke you can either draw a filled rect behind the image or draw the rect on top with stroke and no fill. The

Use a DIV as a background for another element

狂风中的少年 提交于 2019-12-02 20:40:37
If I have a div that contains images and text, is it possible to use this div 's content as a background for, let's say, a section ? For example, something like that : HTML: <section id="sec1"> <div id="bg-div"> <em>This is a background</em> <img src="image1"> <img src="image2"> </div> </section> And CSS: #sec1 { background: src(#bg-div); } This way, I could have this div content acting like a background for my section . Here I made an example with 2 divs: .content which contains everything you need in frontend .background - with text, images and everything else in background To overwrap one

background-image in <div>-tag not showing up

馋奶兔 提交于 2019-12-02 18:50:00
问题 im outquestioned. I just wanted to develop my own gallery, but then I already failed at the very start: Displaying an image as a background in a <div> . I have turned my code upside down, searched the web, searched stackoverflow, though I'm not able to solve the problem. Here's my code: HTML/PHP <div class="imageholder" style="background-image:url(<?php echo $picture->thumbPath; ?>);"></div> CSS .imageholder { width: 150px; height: 150px; float: left; background-size: fill; background

Overlay a background-image with an rgba color, with a CSS3 transition

孤街醉人 提交于 2019-12-02 18:45:35
Earlier today I asked Overlay a background-image with an rgba background-color . My goal is to have a div with a background-image, and when someone hovers the div, the background-image gets overlayed with an rgba color. In the answer , a solution with :after was given: #the-div { background-image: url('some-url'); } #the-div:hover:after { content: ' '; position: absolute; left: 0; right: 0; top: 0; bottom: 0; background-color: rgba(0,0,0,.5); } I now would like to have the same, but with a CSS transition: I'd like the background color to fade in. I tried adding transition: all 1s; to the #the

Apply “background-size:cover” to Twitter Bootstrap Carousel slides

我怕爱的太早我们不能终老 提交于 2019-12-02 18:30:32
I am working with a basic Bootstrap Carousel with three slides. Before I implemented the slider, I had one static image via css background-image of its respective div. In my CSS, I was using background-size:cover, and really liked the way the image responded to different browser widths. Depending on the width of my image, I could get the important section of the image to always stay visibile and centered, while the extra width on either side was only visible on widescreen monitors as an added effect. I want to retain that same image behavior now that I'm using Bootstrap's Carousel, but even if

How to make the background image to fit into the whole page without repeating using plain css?

谁说胖子不能爱 提交于 2019-12-02 18:15:32
I have an JPG image with size 1024 x 724. My page size is not fixed. My requirement is: If I resize the page then the background image should also resize and fit to the page. Also I don't want to keep the image related information in my Html page/JSP. I want to do this using plain CSS. I am not using CSS3. Because there is an attribute called background-size which can make the image stretch to the page width and height. Currently only Google Chrome supports this. Any help ? You can't resize background images with CSS2. What you can do is have a container that resizes: <div style='position

How do I set the background image size in CSS?

送分小仙女□ 提交于 2019-12-02 17:43:32
问题 So I have css code as follows: .jumbobg { background: url('http://znc.mane-frame.com/static/silverleaf.png') fixed no-repeat, url('../img/banner-1008444.jpg') no-repeat, grey; } I was wondering, for the first image (silverleaf.png) - how would I set the background-size for that particular image, using either pixels (for silverleaf) or auto ? I tried with background-size tag, but it would resize all the backgrounds defined above. 回答1: The thing is that you have specified two backgrounds in