Questions tagged [cross-browser]

Cross-browser development refers to the practice of building web sites, web applications, libraries, or components so that they function across different web browsers and rendering engines.

Cross-browser development refers to the practice of building web sites, web applications, libraries, or components so that they function across different web browsers and rendering engines. This contrasts with the concept of developing for one browser or engine.

9067 questions
132
votes
4 answers

How to add/update an attribute to an HTML element using JavaScript?

I'm trying to find a way that will add / update attribute using JavaScript. I know I can do it with setAttribute() function but that doesn't work in IE.
dev.e.loper
  • 35,446
  • 76
  • 161
  • 247
131
votes
4 answers

contenteditable, set caret at the end of the text (cross-browser)

output in Chrome:
hey
what's up?
I believe in FF it would look something like…
user317005
129
votes
5 answers

Flexbox and Internet Explorer 11 (display:flex in ?)

I am planning to move away from "floaty" layouts and use CSS flexbox for future projects. I was delighted to see that all major browsers in their current versions seem to support (in one way or another) flexbox. I headed over to "Solved by Flexbox"…
Kodekan
  • 1,601
  • 2
  • 13
  • 20
129
votes
13 answers

Get the string representation of a DOM node

Javascript: I have the DOM representation of a node (element or document) and I'm looking for the string representation of it. E.g., var el = document.createElement("p"); el.appendChild(document.createTextNode("Test")); should yield: get_string(el)…
Boldewyn
  • 81,211
  • 44
  • 156
  • 212
117
votes
7 answers

Cross-browser custom styling for file upload button

I'm trying to style a file upload button to my personal preferences, but I couldn't find any really solid ways to do this without JS. I did find two other questions about this subject, but the answers there either involved JavaScript, or suggested…
Joeytje50
  • 18,636
  • 15
  • 63
  • 95
115
votes
2 answers

Browser support for URLs beginning with double slash

I've recently seen a few links used without a protocol. It didn't seem too difficult to understand - I think it's a great idea and pretty intuitive. For those of you unaware, using a URL like //example.com/script.js will point to either…
dtbarne
  • 8,110
  • 5
  • 43
  • 49
112
votes
2 answers

use initial width for element not working in IE

I have a graph plugin that inserts canvas and a legend to its container. In this plugin the table has no width defined and in my CSS there is a width for tables inside that container were my plugin gets inserted. So, the new div is…
Rikard
  • 7,485
  • 11
  • 55
  • 92
108
votes
6 answers

Browser statistics on JavaScript disabled

I am having a hard time collecting publically available statistics on the percentage of web users that browse with JavaScript disabled. Yahoo has published data from 2010 and R. Reid published data from 2009 (picked from a site he had access to).…
Jesper Rønn-Jensen
  • 106,591
  • 44
  • 118
  • 155
107
votes
1 answer

Is putting your favicon.ico file in a non-root path a bad idea?

When and how do browsers request the favicon.ico file? Do they always check for it in root, or do they read the content of the webpage first to see if the page specifies the location? I have my favicon.ico path in /images There is the following tag…
Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
106
votes
3 answers

Extra space under textarea, differs along browsers

There`s some extra space under textarea tag. From 1 to 4 pixels in different browsers. The markup is very simple: …
Roman
  • 1,946
  • 3
  • 20
  • 28
102
votes
5 answers

Should PUT and DELETE be used in forms?

Assuming my web application has full support of PUT and DELETE on the server side, should I make use of them? Basically my question is how many browsers support this:
or Is there any benefits to using…
Earlz
  • 62,085
  • 98
  • 303
  • 499
101
votes
6 answers

Detecting when Iframe content has loaded (Cross browser)

I'm trying to detect when an iframe and its content have loaded but not having much luck. My application takes some input in text fields in the parent window and updates the iframe to provide a 'live preview' I started with the following code (YUI)…
David Snabel-Caunt
  • 57,804
  • 13
  • 114
  • 132
100
votes
7 answers

Is there a CSS cross-browser alternative to Firefox' "width: -moz-fit-content;"?

I need some divs to fit their content width at the same time. I am now doing it like this: .mydiv { background: none no-repeat scroll 0 0 rgba(1, 56, 110, 0.7); border-radius: 10px 10px 10px 10px; box-shadow: 0 0 5px #0099FF; color:…
Darme
  • 6,984
  • 5
  • 37
  • 52
99
votes
9 answers

Remove white space above and below large text in an inline-block element

Say I have a single span element defined as an inline-block. It's only contents is plain text. When the font size is very large, you can clearly see how the browser adds a little padding above and below the text. HTML: CSS: span { display:…
MusikAnimal
  • 2,286
  • 2
  • 22
  • 28
97
votes
6 answers

Cross browser method to fit a child div to its parent's width

I'm looking for a solution to fit a child div into it's parent's width. Most solutions I've seen here are not cross-browser compatible (eg. display: table-cell; isn't supported in IE <=8).
mate64
  • 9,876
  • 17
  • 64
  • 96