Why does area have display none? - html

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/

Related

Certain CSS properties not being applied inside an iframe

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.

Css Attribute Position

when you use the Css attribute position and move things around the page does that mess with the rendering of other websites using it? Ex. say you move a box left on Mozilla FireFox then view it on IE with a zoom of 50% does that box stay in the same position or does it move?
If you just change the CSS attributes within your browser (e. g. using the delevoper console), the changes are only local and not transmitted back to the server. So other visitors of that website would not notice any difference.
If you have write access to the CSS stylesheet stored on the server however and you change the attribute declaration therein (and you do not use any vendor-prefixes and the attribute in question is supported by all browsers) then yes, all visitors will notice the change made to that attribute.

VB.net WebBrowser control not handling CSS divs with float

I made a table on the html page using div tags. The content of the table hides and shows with onClick event on the corresponding Enabled/Disabled section. Everything style related about div sections is made with CSS in a separate stylesheet.
All of the files (html, css, js) are located locally on my disk and they will be mostly accessed locally within the software made in VB.net.
The pages I made look perfect in both Chrome and IE (v11), but when I open them with WebBrowser control it seems as the control is not handling the div elements with float property (see image bellow).
Can someone please tell me what the problem is here, as I don't think it's webpage style related, but more of a WebBrowser control related problem?
(open image in new tab for better resolution)
Answering my own question in case if someone comes looking for answers on this topic:
turns out a lot of CSS3 functionality is not supported within VS WebBrowser control. The main issue weren't divs with float property, but the use of calc within width property (width: calc(...);). After setting all the CSS width properties to a pre-calculated percentage, the table began to regain it's shape.
There are some other CSS properties not working properly, for instance display: table; (cell, row, etc.) and box-shadow.
EDIT: I discovered the beauty of Microsoft's idea of emulation behind WebBrowser control. Turns out, even if you have IE11 installed, WebBrowser is dumbed down to IE8 and you have to change/add a registry key in order to enable the IE11 HTML5 and CSS3 functionalities to it.
See: http://www.codeproject.com/Articles/793687/Configuring-the-emulation-mode-of-an-Internet-Expl

Getting clicks on css :pseudo-elements

I'm trying to make a custom checkbox, so I made something like that : http://jsfiddle.net/wQdUn/2/
The problem is that, on WebKit based browsers, the checkbox is toggled only when clicking on the content of the <span>, not on the box itself, while in Firefox I get the behavior I expect.
So I have two questions:
Which one is the right behavior (i.e. the one conform to specifications)?
How do I get the result I want in both browsers (and others...)?
Thanks.
Not sure about the first question, but if you make the span an inline block too, it'll work as you expect in WebKit browsers. See http://jsfiddle.net/wQdUn/5
For those who come to this topic form google:
Safari 6.0.4(8536.29.13) still got this problem, you need to set inline-block on pseudo-element to make click work.
Chrome switched to Blink as it's rendering engine, so this problem didn't happen on chrome any more(26.0.1410.65).

Get specific elements of a website displayed in firefox

I use a screenshot tool like SnagIt and this tool is able to make a screenshot of a specific element inside a website. I tried this feature with firefox, safari and ie, all runs fine. When I use the mouse pointer to aim an element, SnagIt shows a red box around the hovered element in the browser. For example, this tool knows the exact coordinates of a div or img element.
What is the technique behind this feature? Is there a common way for every browser? I've already used Spy++ to get the window handles, unfortunately this isn't the resolution.
I'm in a project in which I need this feature for different browsers.
Thank you very much,
Mark
If you want to know the x,y coordinates of any element in javascript, Then I suggest you use jquery [http://jquery.com] on your page and use its offset function.