background-image

How to set background url for css files in thymeleaf?

本秂侑毒 提交于 2019-12-21 05:06:48
问题 I have a thymeleaf template where I don't have CSS files imported and wanted to declare style attribute for the body element with background-image: url{/image.jpg} property with relative image URL. I wanted to load the URL without including the application context name( /myapp/ ) it. It is similar to the problem over here, except it din't work for me. CSS: <style> body { background: url(../img/Background.jpg) no-repeat center center fixed; background-size: cover; } </style> But the above CSS

add background image to android ListView using Picasso

那年仲夏 提交于 2019-12-21 05:06:12
问题 I need to add a background image to a ListView. Normally I would call listview.setBackground(myImage) . But the image is coming from server and so I need to use Picasso to load the image into the background of my ListView. How do I do that? 回答1: Option One Define an anonymous subclass of com.squareup.picasso.Target Picasso.with(yourContext) .load(yourImageUri) .into(new Target() { @Override @TargetApi(16) public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { int sdk = android

Bootstrap Responsive Images Scaling

做~自己de王妃 提交于 2019-12-21 04:12:12
问题 Using Twitter Bootstrap I realize that by default it scales images responsively. This is great, but isn't always perfect. Say for example I have a 500x300 image on desktop, then it resizes for mobile that image is going to be really small and not very tall, losing much of the detailed parts of the image. I have seen how other sites actually don't scale the image much, but rather use the parent div to sort of mask the image. (http://www.fitnessfireworks.com was a great example of this, no

Moving Background image in a loop from left to right

那年仲夏 提交于 2019-12-20 12:35:35
问题 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 回答1: 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 $

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

泪湿孤枕 提交于 2019-12-20 12:21:51
问题 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

Background image stretch y-axis only, keep repeat-x

喜你入骨 提交于 2019-12-20 10:23:21
问题 I have an image set as a background image of a div. The DIV size is changing and inside their is the image which is a gradient. CSS: #scroller_shadow{ background-image:url(../img/ui/shadow.png); background-repeat:repeat-x; background-position:top; } I need a cross-browser solution for making the image fit the height of the div in the y-axis only, keeping the repeat-x. The DIV is being resized dynamically via JQuery. Their might be a cross-browser option using JQuery. I don't mind using

Use a DIV as a background for another element

半城伤御伤魂 提交于 2019-12-20 09:48:42
问题 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 . 回答1: Here I made an example with 2 divs: .content which contains

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

我们两清 提交于 2019-12-20 09:01:52
问题 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

Background image doesn't show for header

若如初见. 提交于 2019-12-20 07:09:34
问题 I have simple html page with body and header elements : <body> <header class="logoBar"></header> </body> I try to add background image to header . If i do: .logoBar { background:url('http://img704.imageshack.us/img704/2162/67726065.jpg') repeat-x center top; } It doesn't show image. But if i make: body { background:url('http://img704.imageshack.us/img704/2162/67726065.jpg') repeat-x center top; } I see image. Why doesn't it work for header ? Thank you. 回答1: Try setting a width and height on

full screen background html

烂漫一生 提交于 2019-12-20 06:26:03
问题 I'm trying to show a picture as the background of my website so I'm using the following code HTML: <div> <img src="images/background.jpg" id="bg" alt="background_image" /> </div> Css: #bg { width: 100%; height: 75%; position: absolute; z-index: -5000; } I was wondering how can I put a limit on how big is the background going to get because I don't want it to stretch more than 2000px. Thanks 回答1: Just include max-width in your CSS. #bg { width: 100%; max-width: 2000px; height: 75%; position: