First of all, let me preface this by saying I am NOT trying to apply additional CSS to the contents of an iframe from the parent document. I am having issues with a perfectly working document that when displayed in an iframe, the styling breaks. I only say this because whenever I google this issue that's all I get.
I have an HTML document that works and displays perfectly fine when viewed in a browser by itself, however I need to show this content in an iframe. The issue is that somehow, it seems like it's randomly picking and choosing which CSS properties get applied.
For example, if you check the fiddle linked below and inspect one of the list items in the iframe, you can see that the li tags have a border-bottom set. However, if you look at the .service ul li selector in the code, you'll see that there is actually a border-left and border-right there as well which are being ignored. This is only one of the many weird things happening. If you inspect around the document you'll see more instances where this happens.
I've never seen anything like this and it makes no sense at all. I can literally see elements in the inspector where some CSS properties from the same selector are working, and some are ignored. This document displays without issue outside of an iframe.
fiddle
BTW the code is loaded from a data string rather than a URL because it's rendered from an ejs template and it is not served on a public route, nor do I want it to be. However this should be irrelevant.
There is a conflict with the hash "#" symbol in your css. Switching your hex color to red fixes the issue in your fiddle. You will have to come up with another way to add the color without introducing unwanted characters inside your iframe html code that is inside an attribute.
Related
I’ve got a tricky issue going on that I can’t seem to figure out. It’s a lot of different files so let’s start without any code or file docs added.
So I’ve got a SVG image with a lot of square paths all over it. I placed an Square image over one of the square paths in Inkscape. Then I embedded the SVG file into HTML, where I think added a link to that path w/ image. I was having no issues adding the links or anything and it was working just fine, but now it seems as if the image is canceling out the link. Before the link worked just fine but when the image loads over the square it acts as if it’s covering the link. Before the image is fully loaded into the browser the link works and is accessible. But once the image loads on top of that path with the link it covers it and doesn’t work anymore.
Is this common and am I dumb? Seems like I’m just missing something here. Need to basically add the image somehow without it covering the linked path underneath.
Please help!!!
You have probably already found the answer. In SVG all elements are drawn on top of all previous (so the order of the elements in the file matters).
If one element completely covers the other below him then it will essentially block its interactive events. The solution is to notify CSS engine to drop through any pointer events for this element (or elements with same style) using
.nopointer { pointer-events: none }
in the section of the SVG or in the wrapped HTML CSS style section.
For the links to work for SVG elements - since you can add a link attribute to SVG elements as well, e.g. if you would have SVG IMAGE elements overlaid on your rectangles - don't forget to add the XLink namespace in the SVG root element declaration.
I've got a tough one. I work for a company that uses a sharepoint that is 100% text based due to varying network performace issues accross the world. It provides the option to input HTML for styling but scrubs any javascript. I do not have access to code CSS and I'm assuming jquery is not available.
I would like to embed images into the sharepoint as a proof of concept by taking advantage of a floating div (or iframe) that displays with an href to display a png file stored on a server. I don't want the div (or the image) to load unless the user clicks a link or a button.
I'm pretty amature at anything other than basic HTML formating. I'm not even sure it's possible to do something like this with only html.
Thank you in advance to anyone willing to take a stab at this.
You could do it with this HTML, which is ugly and unmaintainable.
Use an iframe with scrolling="none". Use width and height attributes to give it dimensions.
Inside the iframe have your img elements with an id attribute. Ensure they're spaced with enough vertical space so they can't be seen by default, and appear isolated when viewed later.
Link your links to those id attributes, e.g. link
I have a huge issue caused by the default style in google chrome.
The default dispay for area tag is none. But the area/map is still rendered.
http://jsfiddle.net/hm826/1/
Everything works fine when I apply a css display inline or block.
I am interested to know why the default is none in chrome? Is there any reason? Can I apply the display inline without any implications? How is the element rendered if it is not displayed?
I use the newest Google chrome on windows 7.
The area element isn't displayed because it's an kind of abstraction to add multiple links/anchors onto one image instead of multiple images with a lot of anchors.
If something is shown e.g. a background color in that area tag you can't see the image anymore where the map was overlayed.
There are a lot of things where elements have a kind of initial style given by the browser and I guess it's just to give developers the information that this element is not shown.
Example:
Added a new fiddle based on given example which shows this property is not set in real when I try to get the property with javascript/jquery.
In Chrome I get an undefined
So it's fact it's just a helper in DEV tools.
http://jsfiddle.net/ExNGj/
I am currently transitioning a site from one host to another. The original .swf files I am trying to replace but for some reason there is a strange looking border around the images. Can anyone explain why or how to fix it?
Here is the site that is currently being hosted where the header image .swf file is displayed properly:
http://www.waimeasmiles.com
This is the site under the new host where the strange border is:
http://waimeasmiles.com.192-185-7-17.secure22.win.hostgator.com/smile_gallery.asp
Thanks for any help.
That's a weird little border alright. I've glanced over the code and didn't see anything glaring. I can tell you that the "border" you're seeing is the swf's declared background color. (One black, the other white.) It's as if the swfs have a 1px offset but from what I can see nothing has changed regarding their embed or styles.
In fact, one of the only differences I noticed while scanning your code was:
The original location's html has a closing paragraph tag at the end of the file (outside the closing body and html tags) but it seems to have been removed from the new location's html.
Errant or "catch-all" closing tags are bad, mmmk. I can't think of any reason this would affect the flash, but considering the heavily nested, difficult to read code on that page, I might try adding it back just for the sake of having tried it. ;)
Aside from that you may want to try "zeroing out" some elements in your css to see if that helps. Something like:
div, object {
margin:0px;
padding:0px;
border:none;
outline:none;
}
I have this CSS Menu. It's fully functional.
But when I put it in my page inside some table cell, it blows up like this. Don't mind the silver and the blue lines, they are from the page.
Now I have debugged the page and the menu itself. No error still this weird behavior. Then I got another menu and put that in here and it showed the same error. Any idea why is this happening?
I could paste the code but I don't think anybody is going to go through 500 lines of HTML and 100 lines of CSS.
I am using the latest Firefox. IE6 shows the same behavior.
check the code here...
CSS Menu Independent in a page
CSS Menu Inside a complex page
Your "in-place" stylesheet is much longer than your "minimum" one, and contains rules that are changing the layout. In particular, do a search for "280" -- you're setting some widths to that.
In some browsers, tables get some default styles that are not what you expect. I can't recall right now, but I think one of them was align="centre" by default.
Maybe try setting the table attributes to what you want them to be explicitly?
W3Schools for table attributes.