Foundation 5 Data-Interchange background images - image

I already have data-interchange images on the page - they work fine.
Now that I want to put a background image in a 'div' - I can't get it to work.
What actually happens the image will not show until I put some content in the div. And, of course it only shows enough image to cover the block element in front of it.
I'm guessing I have to some custom CSS to fix this. I actually want the div to be content free, but just show the background image/s based on screen size via data-interchange.
Can anyone help please.

a little vague but from what you have said. have you tried adding the class
.clearfix
on the div with your image in.

Related

Change background color of transparent PNG images uploaded to blogger

I have a blog hosted by Blogger with a custom template: http://www.drugchannels.net/
Images uploaded to the blog are hosted at X.bp.blogspot.com (where X is a number). Examples:
https://1.bp.blogspot.com/-Jwy2VQYRIEA/WqmwvsA07WI/AAAAAAAATA4/jWVcEts1h1Y4IXM0hD0njUhSmQ2AZPnxQCLcBGAs/s1600/Specialty_vs_Retail-2014_vs_2017.png
https://4.bp.blogspot.com/-O4S9ps4u67k/Wk0yhTEuV-I/AAAAAAAASUE/5tPedr-p7_4kedNYU4RY711l6K3maokiQCLcBGAs/s1600/DCI-Copay_Accumulator-03Jan2018-CORRECTED.png
I want to have a white background when the image is clicked. (The images look fine on the site itself. This is not a problem with the blog's background, which is set to be solid white.)
Using the Inspect option in Chrome, I see the following information
The body formatting (background: #0e0e0e;) does NOT appear anywhere on my blog or in my template.
How can I fix?
Thank you!
P.S. I have 10 years of legacy posts with images, so I need a global solution that changes the background to white for all images posted to the blog.
Wrap the image in a div and set the background color of that div with css. That should work
.divclass:active {
background:#FFFFFF
}
If you are opening the images in a new tab or window then your only option is changing the background of the images yourself with a photo editor. If you're just trying to give the user a full size view of an image when they click it you could use javascript/jquery and have a full size div with a background and an image pop up in full screen without sending them to the linked image. Theres probably quite a few jquery plugins that will do this with minimal coding knowledge, just google it.
Thanks, Riley.
I can't go back and edit hundreds of images, so the photo editor option won't work.
But based on your suggestion, I used the following solution:
1) Enabled "Showcase Images with Lightbox" on blogger
2) Added CSS from this page (http://www.howbloggerz.com/2016/05/how-to-customize-blogger-lightbox.html) with no background image and background color set ot white (#ffffff).
Downside is that charts/images now pop up on same page rather than opening in a new tab.
Thank you!

Stretch Cover Image to Browser, Lift When Scrolled

So, the new Exposure site is wonderful and got me wondering how they've achieved something like this. Basically, it's a cover image that's stretched to the browser window (even if you resize), what's lovely about is that only when you scroll do you get to see the content below.
I guess you could use something like backstretch.js for the dynamically-resized image. How are they achieving the rest, though?
I've set up a pen here: http://codepen.io/realph/pen/luwdJ
Which seems to do the job, but the content is being covered when you scroll rather than falling below the cover image.
Any idea what I'm doing wrong, or any tips for achieving something like this?
Thanks in advance!
I think this is what your looking for and css can do the whole thing
http://codepen.io/anon/pen/rajDJ
Just add this rule to your images or image class
img {
width: 100%;
}
What exposure is doing there is creating onclick modal window that contains the image but you can do that with js or jquery or there are many jquery plugins that do that.
Also to get the nice grid structure you can use a grid template. Here is one to get you started http://960.gs/

Crop image overflow to edge of browser window

I'm currently developing a responsive website and have a certain image within a set amount of 'columns' (div size) for the site. This image is bigger than the size of div itself so flows over the edges (using html and not CSS Background-Image). When I use the CSS background-image method the image gets cut off to fit the div and overflow:visible doesn't fix it (from what I've read you can't have a background-image overflow it's own div).
So I want this image to overflow it's div but also have the image be cropped to the edge of the browser window, otherwise I have a big empty white bar down the side of the website when you resize the browser window for smaller screen devices, like so:
http://i.imgur.com/74NEmDF.jpg
Are there any known methods of solving this or does Javascript need to be used to fix it (I know little JavaScript so I couldn't figure it out myself). Thanks in advance.
edit: Still no luck, been searching everywhere. Would love any help, thanks guys.
edit 2: Figured it out! Was a very simple fix of adding overflow:hidden to my hero unit (big containing div). I feel so stupid it took me so long to figure out such a simple fix.

z-index not working with images

I am trying to make it so these images will line up the way so that the blank.gif will appear in front of the image. i cannot use it as a background image, and i have tried using a negative z-index like -1 but then the image disappears all together on the site i have tried to use it on. my goal is to make the gray and black image appears behind the blank.gif.
things that i have to avoid or will not work are these:
z-index:-1 (just the negative numbers)
use of background image inside of a <div>
and both the images must remain inside a parent element, and my issue is that i cant use any script that needs to be inside of the head of the html. i have tried but cant find a solution. if you have any method of keeping an image from being right clicked and saved so easily then that would be great. any help is appreciated thank you.
image html are here: index.html
code sample:
<html><div style="position:absolute;width:150px;height:150px;display:inline;">
<img src="http://dl.dropbox.com/u/14413762/blank.gif" style="position:static:width:150px;height:150px;left:0px;top:0px;z-index:2;"><img src="http://dl.dropbox.com/u/14413762/bbc/image.png" style="position:absolute;left:0px;top:0px;;z-index:1;">
</div></html>
Yeah.. You're pretty much wasting time that is better spent elsewhere. A person who wants the image is going to get it, either with the web developer tools in firefox or chrome, viewing the page source, etc.
On a real note though, z-index only works with absolute, relative, or fixed positioned elements. It will not work with your statically positioned element that you set to a z-index of 2. I have done what you are trying to acheive with relatively positioned elements, z-index, and either top and left or negative top and left margins.

WP7 WebBrowser's transparent background (workaround)

It's not possible to set transparent background for WebBrowser of WP7. To make impression of transparent background I want to do the following workaround. I want:
To find a position and size of WebBrowser on the page.
To get page's background image.
Crop it with values what I found on step 1.
To save result in IsolatedStorage
To parse HTML and place <body background="RESULTBACKGROUND">
MyWebBrowser.NavigateToString(NewHtmlString);
I think this should be a workaround of transparent background and should work.
For now I am trying just to place any .jpg image (let's say test.jpg) on step 5.
But fail. I have "Build Action" property of file set to "Content". It is placed in the root of the project. And <body background="test.jpg"> not working. Back of the WebBrowser is still white.
What I am doing wrong?
UPD:
Step 5 is solved.
2Claus: No! Not only from web. I saved both html file and image file to IsolatedStorage and WebBrowser can show image as a backgroud.
Now the problem is that background cannot be fixed. I tried many differrent things with styles. I also tried to add a fixed div behind my text. Nothing works. The picture is always scrolling with a text. I tried to add onscroll event and pass it scrolled value to move the div in an opposite direction, but div is glued to the page :(
Any ideas?
So assuming you're talking about the WebBrowser control, you're forgetting that the HTML only can refer to urls on the world wide web.
So either you need to host your background images on a website, or you need to inject a CSS style that sets the background to either white or black (the two default background-colours of the platform).
For WebBrowser, You don't actually have to save it to the ISO to make changes on the page. You can load it navigate to it normally, and then use InvokeScript to make the changes via custom JS code. It can be a little tricky though, as you will probably need to heavily rely on the eval and stringization. The problem mentioned by Claus is still there - but you need to do some experiments. With the Mango release and SDK 7.1+, the platform support IsoltatedStorage imagesources in the form of is://path/file - maybe - maybe - maybe squared - the webbrowser's renderer udnerstands them too - then setting your bkg's url to such would work. I doubt though, as it could be seen as some minor security breach, etc
I now bumped into the same background fixed image problem. For someone wandering here I solved it placing content into a fixed-height container (div) therefore the container contents is being scrolled and not the html page, leaving background picture "fixed".
body
{
background-image:url('...');
background-position:-20px -150px;
background-repeat:no-repeat;
background-attachment:fixed;
}
div
{
height:300px;
overflow:scroll;
}
Of course background-position and div height is set specifically for a WebBrowser position in page and it's size.

Resources