I want to use javascript to add all the formatting to the div. It works in Firefox but not in other browsers. IE and Chrome keep linebreaks around the div for some reason. What am I doing wrong?
Also if I remove the anchor it works in Chrome for some reason.HTML Code:<html> <body> text on left. <a href='#'><div id='icon'></div></a> text on right. <script> var o=document.getElementById('icon'); o.style.width = '44px'; o.style.height = '44px'; o.style.display = 'inline-block'; o.style.backgroundColor = '#888'; </script> </body> </html>


Reply With Quote

Bookmarks