473,382 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

CSS styles with hyphens cause JS error

because some CSS attributes have hyphens in them ( and are being
interpreted as minus )
I do believe that IE (at least) is bugging out when I would try
something like the following
with (element) {
style.background-color = "#0000ff"; // style.backgroundColor =
"blue" works fine
}
other examples: font-family border-style etc., etc.
Is there an alternate (bug-free) syntax ? please help with
suggestions; TIA

May 23 '06 #1
1 1294
awebguynow wrote:
because some CSS attributes have hyphens in them ( and are being
interpreted as minus )
I do believe that IE (at least) is bugging out when I would try
something like the following
with (element) {
style.background-color = "#0000ff"; // style.backgroundColor =
"blue" works fine
}
other examples: font-family border-style etc., etc.
Is there an alternate (bug-free) syntax ? please help with
suggestions; TIA

All hyphenated CSS attributes are represented in JavaScript by
capitalised equivalents. So style.backgroundColor = "blue" is correct.

--
Ian Collins.
May 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Harag | last post by:
Hi All If I had the following 3 style in a CSS file <style> .bordered {border: red thin soldid;} .warning {background-color: #900;} .box {padding: 5%; text-align:justify;} </style>
2
by: christian | last post by:
I am having a recurring problem with a specific css stylesheet. For no evident reason, seemingly random styles (though from the same area of the stylesheet) are selectively ignored by browsers....
3
by: Harlan Messinger | last post by:
I've put a sample web page at http://gavelcade.com/tests/font-styles-lost.html that illustrates strange inconsistencies both among and within browsers in a situation where I've applied styles...
5
by: richard_thomas | last post by:
Hi, I'm having trouble running the following query: select * from message where text_body like ' ----------%' ie, five spaces followed by at least ten hyphens. The query doesn't...
18
by: Gustaf Liljegren | last post by:
IE does, and I can't remember this used to be a problem in Netscape. I guess someone in the Mozilla team just came up with a Smart Idea about the True Semantics of the Hyphen Minus character. :-(...
8
by: Danny | last post by:
I've read the recent post about not breaking at hyphens in HTML documents. I *want* breaking to occur at hyphens. (for 'hyphen' read 'minus sign') IE6 and Opera7.54 both break phrases such as...
2
by: Herbert Liechti | last post by:
Hello I like to grant some permissions to the user www-data (default user for apache under debian) GRANT SELECT, UPDATE, INSERT, DELETE ON customer TO herbie, www-data; The statements...
3
by: sagar | last post by:
Hello everyone, I am developing a AJAX based IM application. I use javascript to dynamically generated small windows using nested <div> within the web-page. I use the following ways to set...
5
by: MLM450 | last post by:
I want to use visual styles in my app, but it is causing a problem with a DLL I use. Is there a way to disable visual styles for that DLL? I do not have access to the code for the DLL. The DLL's...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.