Background image doesn't show in IE7 and IE8 - html

On my site http://aspspider.info/thesamy/GalleriesTest/MainPage/Main.aspx (free hosting for test), I have 2 background images. The body that works in every browser and a content-wrapper that doesn't work in IE7, IE8.
I can't understand why, if the background img of the body shows, why it doesn't work in different areas on the page?
This is the HTML code of the area:
<div id="Content-wrapper">
<div id="GalleriesContent">
<iframe scrolling="no" id="iframeBoxID" frameborder="0" class="iframeBoxClass" name="iframeBox"
src="http://www.google.com"></iframe>
</div>
</div>
and here is the css:
#Content-wrapper
{
/*background-image:url('../logo/blackBackGround2.png'); <-- tired that*/
background-image:url(../logo/blackBackGround2.png);
}
#GalleriesContent
{
background-color:transparent;
clear: both;
}
.iframeBoxClass
{
background-color:transparent;
border: 1px solid white;
width: 100%;
height: 550px;
}

For whatever magical reason IE renders iframes with a white background and has to be told to explicitly render a transparent background in order for your div background to show. That behavior is detailed here and the fix is quite simple, simply add the following attribute to your iframe tag and it should fix the issue:
allowTransparency="true"
e.g.
<iframe allowTransparency="true"></iframe>

Try adding a background-repeat to your CSS
background-repeat: repeat-y;

Related

Iframe scrolls over the fixed header in IE 11 , how to make it scroll under/behind the header?

In my html page, I have a header and its position is fixed. In the contant or body of the page I have an Iframe to display a youtube video and other DIV tabs. In other browsers like chrome, Morzilla etc all the contants schrolls behind the header and works fine!!.
But In IE (IE 11), only the youtube video in Iframe scrolls over/aboves the header. How can I make it to scroll behind the header in IE.
here is the code
css
#header {
position: fixed;
background-color: #ffffff;
margin-top: -18px;
z-index: 10;
width: 100%;
}
iframe {
background-color:transparent !important;
z-index: -1;
}
html (php page)
<div style="text-align:center;padding:20px;font-size:16px ; z-index: -1;">
<div>
<iframe " width="320" height="247" src="http://www.youtube.com/********" frameborder="0" allowfullscreen></iframe>
</div>
</div>
http://jsfiddle.net/Rq25Q/
try adding ?wmode=opaque at the end of src attribute of iframe
like <iframe " width="320" height="247" src="http://www.youtube.com/abcd?wmode=opaque" frameborder="0" allowfullscreen></iframe>
I trying to reproduce what you want, but I can't find any error in IE 11.
.header {
position: fixed;
}
Here is a jsfiddle for this: http://jsfiddle.net/nJBy9/
All the contents scrolls behind the header and works well.
Can you explain what is your problem?
You need to ensure that the z-index of the iframe is less than the z-index of the header:
.header {
z-index: 10;
}
iframe {
z-index: 1
}

CSS rollover image

I would like the top half of this image to display by default, and then use some CSS to make the image shift upward so that the bottom half shows when the mouse hovers over it. Here is the code and what I've tried, but it is not working. Can anyone help me make this code work?
HTML:
<div id="next">
<img src="images/next3.png" alt="next page">
</div>
CSS:
#next a:hover{background: url('images/next3.png') 0 -45px;}
EDIT:
HTML:
<div id="next">
</div>
CSS:
#next {
height:40px;
width:160px;
background-image:url('images/next3.png');
}
#next:hover{background-position: 100% 100%;}
I think you need to use background-position attribute to achieve this.
CSS
div
{
height:40px;
width:160px;
background-image:url('http://i.stack.imgur.com/OOGtn.png');
}
div:hover
{
background-position:100% 100%;
}
JS Fiddle Example
You can also look into CSS Sprites.
You need to use it as a background in the first place. The <img> is covering the background.
Get rid of the image HTML and just use some CSS like this
a {
display: inline-block;
height: 40px;
width: 160px;
background: transparent url(img.jpg) 0 0 no-repeat;
}
a:hover {
background-position: 0 40px;
}
In this case you will need to remove your <img> tag and consistently use the CSS background attribute for both cases. Also define your height and width width of your a tag with CSS too.

Add a Border Radius to <video> tag in Chrome

I've seen this question pop up a couple of times without any clear resolution.
I'm loading a simple video
<video src="" controls></video>
Onto my page. The video works and plays well cross-browser (not showing all the format setup for this question since it isn't relevant).
I've then applied a border-radius to the video tag. This works, except in Chrome.
I can even pull up the console and see the border-radius applied to the video tag, but it isn't rendering the border radius.
Is anyone familiar with this issue? I've read it's a bug in Chrome, but I'm not sure if it's been resolved or if there might be a workaround?
I'm not sure but I think that this is what's meant by "using SVG":
The idea is to create a HTML overlay element that is the same width and height as the video, set multiple SVG backgrounds on it (border-radius's in whatever the background color is) and make it "mouse-invisible" (pointer-events: none):
Demo: http://jsfiddle.net/pe3QS/3/
CSS (minus the SVG's):
#video-container {
position: relative;
}
#overlay {
position: absolute;
width: 320px;
height: 240px;
left: 0;
top: 0;
pointer-events: none;
background-image: url('data:image/svg+xml...');
background-position: top right, top left, bottom left, bottom right;
background-repeat: no-repeat;
}
HTML:
<div id="video-container">
<video width="320" height="240" src="http://www.w3schools.com/html/movie.ogg" type="video/ogg" controls></video>
<div id="overlay"></div>
</div>
You could also use a psuedo-element (not on the video element, it would'nt display):
Demo: http://jsfiddle.net/pe3QS/2/
CSS:
#video-container:after {
position: absolute;
width: 320px;
height: 240px;
content: " ";
.....
HTML:
<div id="video-container">
<video width="320" height="240" src="http://www.w3schools.com/html/movie.ogg" type="video/ogg" controls></video>
</div>
The SVG's are pretty simple to modify, just change the fill attribute on each of them.
This could probably also be done via JS.

Soundcloud not resizing correctly in IE

Trying out Soundcloud for a site. I resized the iframe to fit the space - this worked seamlessly in Chrome/FF/Safari.
On IE however it's not resizing but truncating the viewable space.
For example:
The way it's supposed to look:
IE's interpretation (can't really see or click play button):
HTML:
<div class="rightnav_below">
<iframe width="100%" height="180" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player/?url=http...&auto_play=false&show_artwork=true&color=ff7700"></iframe>
</div><!-- end .rightnav_below -->
CSS:
#wrap #content #rightnav_wrapper .rightnav_below {display: block; text-align: left; margin-top: 20px; background: #ccc; border-color:#fc663d;}
#wrap #content #rightnav_wrapper .rightnav_below iframe{float: none; height: 180px; width: 180px; vertical-align: top; }
Also, getting an error in IE when I do hit that tiny play portion:
Webpage error details
Message: 'nodeName' is null or not an object
Line: 3
Char: 99080
Code: 0
URI: http://w.soundcloud.com/player/?url=...http...&auto_play=false&show_artwork=true&color=ff7700
Any ideas what's going on? Thanks!

Use iframe as a link?

I am using an iframe and in the iframe I am loading a dynamic image. I want to use that image as a link to the respective article. Actually this is a news site.
I already have used many stuffs like:
<iframe src="dynamic url"></iframe>
does work with IE but not with safari and FF.
and
some tweets like
div.iframe-link {
position: relative;
}
a.iframe-link1 {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
code:
<div class="iframe-link">
<iframe src="file" width="90px" height="60px" frameborder="0" scrolling="no"
marginheight="0" marginwidth="0" allowtransparency="true" noscaling="true">
</iframe>
</div>
worked in FF and Safari not in IE7,8.
SO can anybody suggest what to do..
any help would be appreciated.
The Iframe is loading a dynamic address of image like::::
<div class="news_img01">
<div onclick="window.open('URL','_self')" style="cursor: pointer;"><br>
<iframe scrolling="no" height="60px" frameborder="0" width="90px" noscaling="true" allowtransparency="true" marginwidth="0" marginheight="0" src="thumbnails/1188.gif">
</iframe>
</div>
</div>
so i cant add tag inside but already wrapped tag inside . it worked for IE but not for others like FF, Safari..
You could create a overlay to make the area over a iframe clickable. This worked for me.
<div style="position:relative;">
<iframe src="somepage.html" width="500" height="500" />
</div>
I found this code snippet from this thread here:
https://forums.digitalpoint.com/threads/how-do-i-make-this-iframe-clickable.2320741/
According to your earlier comments, you were using the iframe in order to crop an image of unknown size to a 60 by 90 pixel box. To do this, use the overflow:hidden css attribute on the a tag, which slices off any content not fitting within the border-box.
<div class="news_img01">
<a href="URL"
style="display: block; width:90px; height:60px; overflow:hidden;">
<img src="thumbnails/1188.gif" />
</a>
</div>
Why don't you enclose <iframe> inside a <div> and add an onClick event on the containing <div> to navigate the user to the desired page?
<div onClick=""> <!-- Or just bind 'click' event with a handler function -->
<iframe ...></iframe>
</div>
By adding the following css rule, it will work as if the iframe were a clickable link.
div {
cursor: pointer
}
iframe {
pointer-events: none; // This is needed to make sure the iframe is not interactive
}
Set css property pointer-events to none on iframe tag.
a {
display : block; /* or inline-block */
}
a iframe {
pointer-events : none;
}
<a href="https://stackoverflow.com/questions/3317917/use-iframe-as-a-link">
<iframe src="https://www.africau.edu/images/default/sample.pdf"></iframe>
</a>
If the iframe is loading an HTML page, just put your <a> tags in the source of that.
If it is just loading an image, why are you not using an <img> tag?
I would recommend using jQuery to select the image element in that iframe and wrap it with <a> tag so it's clickable.
I believe it's possible to attach an onHTMLReady listener to the document inside the iframe. Then wait for the iframe to load and then make the image clickable
$(frames[0].document).ready(function(){ /*find and wrap with a-tag goes here*/ });
I have the same problem and I solved it with this code:
div.iframe-link {
position: relative;
float: left;
width: 960px;
height: 30px;
}
a.iframe-link {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: #ffffff;
opacity: 0.1;
filter:Alpha(opacity=10);
}
For me,it works for all browsers and IE8 as well.
Hope it helps :)
I faced such type of problem and solved by this:
a.iframe-link1 {
position:absolute;
top:0;
left:0;
display:inline-block;
width:90px;
height:60px;
z-index:5;
}