473,395 Members | 1,872 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,395 software developers and data experts.

scriptable style access in Opera

VK
Is my understanding correct that
due to the lack of CSS2 support Opera doesn't allow any access to
inline/linked style declarations?
Say in case:
<style type="text/css">
..foo {
color: blue;
}
</style>
....
<div class="foo"...

There is no way to get a reference to the "foo" rule or to
change/remove it?

Jan 3 '06 #1
4 1196
VK wrote:
Is my understanding correct that
due to the lack of CSS2 support Opera doesn't allow any access to
inline/linked style declarations?
No. Recent versions of Opera support CSS2 features that are not
discontinued in CSS2.1:

<URL:http://www.opera.com/docs/specs/css/>

However, recent versions of Opera do not support W3C DOM 2 Style --

<URL:http://www.opera.com/docs/specs/js/dom/css/>

--,
Say in case:
<style type="text/css">
.foo {
color: blue;
}
</style>
...
<div class="foo"...

There is no way to get a reference to the "foo" rule or to
change/remove it?


and that is why this is not possible.
PointedEars
Jan 3 '06 #2
On 03/01/2006 12:41, VK wrote:
Is my understanding correct that due to the lack of CSS2 support
Opera
Opera has among the best CSS support of any browser in use on the Web.
doesn't allow any access to inline/linked style declarations?
It provides the ability to read and modify in-line style declarations,
no access to header (embedded) or external (linked) style sheets, and
read access to computed style properties.
Say in case:
<style type="text/css">
.foo {
color: blue;
}
</style>
...
<div class="foo"...

There is no way to get a reference to the "foo" rule or to
change/remove it?


Correct. That is a header (or embedded) style sheet rule.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jan 3 '06 #3


VK wrote:

Say in case:
<style type="text/css">
.foo {
color: blue;
}
</style>
...
<div class="foo"...

There is no way to get a reference to the "foo" rule or to
change/remove it?


All you can do in Opera is to use the Core and HTML DOM to manipulate
HTML style elements e.g. to change something you could add a new style
element at the end of the head element e.g.

var styleElement = document.createElement('style');
styleElement.type = 'text/css';
styleElement.appendChild(document.createTextNode(
'.foo { background-color: transparent }'
));
document.getElementsByTagName('head')[0].appendChild(styleElement);

Or you can remove a complete style element e.g.
styleElement.parentNode.removeChild(styleElement)

Opera reacts to those DOM changes and makes the necessary CSS changes
resulting from that.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jan 3 '06 #4
VK
Thanks to everyone, my worst assumptions are being confirmed. :-(

P.S. That was not a bias to Opera but indeed a practical question for
my project. But out of any bias it still sucks IMHO no matter how good
the static style support would be.

Jan 3 '06 #5

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

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
3
by: Csaba2000 | last post by:
I have set onmousedown to change the cursor, but this setting is ignored (IE 5.5; NN 6.1 on Win 2K Pro) until the mouse is either moved or the mouse button is released. On Opera 7.01, the setting...
16
by: Harlan Messinger | last post by:
1. CSS has five generic font family specifiers: serif, sans-serif, cursive, fantasy, monospace. IE lets the users select a default proportional font and a default monospace font. Is there any way...
13
by: TheKeith | last post by:
Is it just me or does opera and ie not render the float style properly? IE does a sucky job at it, but opera makes a total mess; Mozilla/Firefox renders it correctly however. I'm just trying to be...
12
by: relaxedrob | last post by:
Hi All! I have a page with with the following style information: <link rel="stylesheet" type="text/css" href="/eEmployment/eTech.css" /> <style type="text/css"> DIV.Application {...
5
by: Andrew Poulos | last post by:
If I have an external stylesheet that is @imported into my page and it has an element that looks like this: * html td { font-style: italic; } how can I use javascript to change the font...
9
by: JimO | last post by:
I'm a newbie at this and I can't seem to find a list properties names to change styles on the fly. So far I've been lucky and managed to guess the names such as BodyElement.style.marginTop = 0;...
8
by: pamelafluente | last post by:
Hi guys, Is it possible to add "onload" (via Javascript) a new class to the <styleheader section? If yes, how would that be done ? <style type="text/css" media="screen"> .NewStyleClass{...
9
by: Piotr K | last post by:
Ok, I tried simply everything that came to my mind and now I ran out of ideas, but to the point - take a look at the code below // GetStyle returns given style value (works fine)...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.