473,413 Members | 2,056 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,413 software developers and data experts.

Access CSS with JavaScript

I have a css file this is a portion of it:

/* trackaccept.css */
div.track {
width:400px;
height: 100px;
}

I have this in my ASP page:

<link rel="stylesheet" type="text/css" href="/includes/trackaccept.css"/>

I need to read the values for width and height in my page. How do I acess those values using JavaScipt? Thanks.

I have a length of 2 for CSS objects so I don't know whether it is 0 or 1 I'm assuming 0.since I don't have any other external CSS statements. The other is declared in the page as <style></style>

--
George Hester
__________________________________
Jul 20 '05 #1
11 15714


George Hester wrote:
I have a css file this is a portion of it:

/* trackaccept.css */ div.track { width:400px; height: 100px; }

I have this in my ASP page:

<link rel="stylesheet" type="text/css"
href="/includes/trackaccept.css"/>

I need to read the values for width and height in my page. How do I
acess those values using JavaScipt? Thanks.

I have a length of 2 for CSS objects so I don't know whether it is 0
or 1 I'm assuming 0.since I don't have any other external CSS
statements. The other is declared in the page as <style></style>


Whether you have
<link rel="stylesheet"
or
<style type="text/css">
doesn't matter, browsers like IE4+ or Netscape 6+ and Mozilla support a
document.styleSheets
collection where each sheet appears.
You can access the CSS rules in the stylesheets and read and change
value of properties in a rule, unfortunately different in IE and
Netscape. IE has
document.styleSheets[i].rules[i].style.width
Netscape
document.styleSheets[i].cssRules[i].style.width

Here is an example:

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getStyleObject (styleSheetIndex, ruleIndex) {
if (document.styleSheets) {
var styleSheet = document.styleSheets[styleSheetIndex];
if (styleSheet) {
var rule;
if (styleSheet.cssRules) {
rule = styleSheet.cssRules[ruleIndex];
}
else if (styleSheet.rules) {
rule = styleSheet.rules[ruleIndex];
}
if (rule && rule.style) {
return rule.style;
}
else {
return null;
}
}
else {
return null;
}
}
else {
return null;
}
}

function testStyleSheet () {
var style = getStyleObject(0, 0);
if (style) {
alert('style.height: ' + style.height);
}
else {
alert('style not found.');
}
}
</script>
</head>
<body onload="testStyleSheet();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>

Note that even Opera 7 doesn't support document.styleSheets. And I don't
know about Safari or Konqueror support, does anyone else care to check
and contribute?

Of course with external style sheets make sure you use <body onload
before trying to access them.

You can also check the selector of a rule with selectorText:

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getStyleObjectFromSelector (selectorText) {
if (document.styleSheets) {
for (var i = document.styleSheets.length - 1; i >= 0; i--) {
var styleSheet = document.styleSheets[i];
var rules;
if (styleSheet.cssRules) {
rules = styleSheet.cssRules;
}
else if (styleSheet.rules) {
rules = styleSheet.rules;
}
if (rules) {
for (var j = rules.length - 1; j >= 0; j--) {
if (rules[j].selectorText == selectorText) {
return rules[j].style;
}
}
}
}
return null;
}
else {
return null;
}
}

function testStyleSheet () {
var selectors = ['#aDiv', '.someClass'];
for (var i = 0; i < selectors.length; i++) {
var selector = selectors[i];
var style = getStyleObjectFromSelector(selector);
if (style) {
alert('Selector ' + selector + ': style.height: ' + style.height);
}
else {
alert('No rule found for selector ' + selector);
}
}
}
</script>
</head>
<body onload="testStyleSheet();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>
Of course if you are looking for the computed style of an object there
is no need to read through style sheet rules, getComputedStyle allows
that with Mozilla and with Opera 7 and element.currentStyle with IE5+:

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getComputedStyleForElement (element, cssPropertyName) {
if (element) {
if (window.getComputedStyle) {
return window.getComputedStyle(element,
'').getPropertyValue(cssPropertyName.replace(/([A-Z])/g,
"-$1").toLowerCase());
}
else if (element.currentStyle) {
return element.currentStyle[cssPropertyName];
}
else {
return null;
}
}
else {
return null;
}
}

function getComputedStyleForId (elementId, cssPropertyName) {
if (document.getElementById) {
return
getComputedStyleForElement(document.getElementById (elementId),
cssPropertyName);
}
else {
return null;
}
}

function testComputedStyle () {
var ids = ['aDiv', 'aP'];
for (var i = 0; i < ids.length; i++) {
var cssValue = getComputedStyleForId(ids[i], 'backgroundColor');
if (cssValue === null) {
alert('Style background-color for id ' + ids[i] + ' not found.');
}
else {
alert('Computed style for background-color for id ' + ids[i] + '
is ' + cssValue);
}
}
}
</script>
</head>
<body onload="testComputedStyle();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>

Watch out for Netscape 7 and Opera 7 normalizing CSS values, for
instance color values are returned as rgb(r, g, b).
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
Oh Martin thanks for that.

--
George Hester
__________________________________
"Martin Honnen" <ma*******@yahoo.de> wrote in message news:3f********@olaf.komtel.net...


George Hester wrote:
I have a css file this is a portion of it:

/* trackaccept.css */ div.track { width:400px; height: 100px; }

I have this in my ASP page:

<link rel="stylesheet" type="text/css"
href="/includes/trackaccept.css"/>

I need to read the values for width and height in my page. How do I
acess those values using JavaScipt? Thanks.

I have a length of 2 for CSS objects so I don't know whether it is 0
or 1 I'm assuming 0.since I don't have any other external CSS
statements. The other is declared in the page as <style></style>


Whether you have
<link rel="stylesheet"
or
<style type="text/css">
doesn't matter, browsers like IE4+ or Netscape 6+ and Mozilla support a
document.styleSheets
collection where each sheet appears.
You can access the CSS rules in the stylesheets and read and change
value of properties in a rule, unfortunately different in IE and
Netscape. IE has
document.styleSheets[i].rules[i].style.width
Netscape
document.styleSheets[i].cssRules[i].style.width

Here is an example:

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getStyleObject (styleSheetIndex, ruleIndex) {
if (document.styleSheets) {
var styleSheet = document.styleSheets[styleSheetIndex];
if (styleSheet) {
var rule;
if (styleSheet.cssRules) {
rule = styleSheet.cssRules[ruleIndex];
}
else if (styleSheet.rules) {
rule = styleSheet.rules[ruleIndex];
}
if (rule && rule.style) {
return rule.style;
}
else {
return null;
}
}
else {
return null;
}
}
else {
return null;
}
}

function testStyleSheet () {
var style = getStyleObject(0, 0);
if (style) {
alert('style.height: ' + style.height);
}
else {
alert('style not found.');
}
}
</script>
</head>
<body onload="testStyleSheet();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>

Note that even Opera 7 doesn't support document.styleSheets. And I don't
know about Safari or Konqueror support, does anyone else care to check
and contribute?

Of course with external style sheets make sure you use <body onload
before trying to access them.

You can also check the selector of a rule with selectorText:

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getStyleObjectFromSelector (selectorText) {
if (document.styleSheets) {
for (var i = document.styleSheets.length - 1; i >= 0; i--) {
var styleSheet = document.styleSheets[i];
var rules;
if (styleSheet.cssRules) {
rules = styleSheet.cssRules;
}
else if (styleSheet.rules) {
rules = styleSheet.rules;
}
if (rules) {
for (var j = rules.length - 1; j >= 0; j--) {
if (rules[j].selectorText == selectorText) {
return rules[j].style;
}
}
}
}
return null;
}
else {
return null;
}
}

function testStyleSheet () {
var selectors = ['#aDiv', '.someClass'];
for (var i = 0; i < selectors.length; i++) {
var selector = selectors[i];
var style = getStyleObjectFromSelector(selector);
if (style) {
alert('Selector ' + selector + ': style.height: ' + style.height);
}
else {
alert('No rule found for selector ' + selector);
}
}
}
</script>
</head>
<body onload="testStyleSheet();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>


Of course if you are looking for the computed style of an object there
is no need to read through style sheet rules, getComputedStyle allows
that with Mozilla and with Opera 7 and element.currentStyle with IE5+:

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getComputedStyleForElement (element, cssPropertyName) {
if (element) {
if (window.getComputedStyle) {
return window.getComputedStyle(element,
'').getPropertyValue(cssPropertyName.replace(/([A-Z])/g,
"-$1").toLowerCase());
}
else if (element.currentStyle) {
return element.currentStyle[cssPropertyName];
}
else {
return null;
}
}
else {
return null;
}
}

function getComputedStyleForId (elementId, cssPropertyName) {
if (document.getElementById) {
return
getComputedStyleForElement(document.getElementById (elementId),
cssPropertyName);
}
else {
return null;
}
}

function testComputedStyle () {
var ids = ['aDiv', 'aP'];
for (var i = 0; i < ids.length; i++) {
var cssValue = getComputedStyleForId(ids[i], 'backgroundColor');
if (cssValue === null) {
alert('Style background-color for id ' + ids[i] + ' not found.');
}
else {
alert('Computed style for background-color for id ' + ids[i] + '
is ' + cssValue);
}
}
}
</script>
</head>
<body onload="testComputedStyle();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>

Watch out for Netscape 7 and Opera 7 normalizing CSS values, for
instance color values are returned as rgb(r, g, b).
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3
Hello again Matin. I tried the ComputedStyle one you gave. After fixing for line continuation issues in my newsreader I am getting undefined for both alerts. Is there something wrong with it? Here is what you had and what I put it to that is removing the line continuation issues.

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getComputedStyleForElement (element, cssPropertyName) {
if (element) {
if (window.getComputedStyle) {
return window.getComputedStyle(element,'').getPropertyVal ue(cssPropertyName.replace(/([A-Z])/g, "-$1").toLowerCase());
}
else if (element.currentStyle) {
return element.currentStyle[cssPropertyName];
}
else {
return null;
}
}
else {
return null;
}
}

function getComputedStyleForId (elementId, cssPropertyName) {
if (document.getElementById) {
return
getComputedStyleForElement(document.getElementById (elementId), cssPropertyName);
}
else {
return null;
}
}

function testComputedStyle () {
var ids = ['aDiv', 'aP'];
for (var i = 0; i < ids.length; i++) {
var cssValue = getComputedStyleForId(ids[i], 'backgroundColor');
if (cssValue === null) {
alert('Style background-color for id ' + ids[i] + ' not found.');
}
else {
alert('Computed style for background-color for id ' + ids[i] + ' is ' + cssValue);
}
}
}
</script>
</head>
<body onload="testComputedStyle();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>

--
George Hester
__________________________________
"Martin Honnen" <ma*******@yahoo.de> wrote in message news:3f********@olaf.komtel.net...


George Hester wrote:
I have a css file this is a portion of it:

/* trackaccept.css */ div.track { width:400px; height: 100px; }

I have this in my ASP page:

<link rel="stylesheet" type="text/css"
href="/includes/trackaccept.css"/>

I need to read the values for width and height in my page. How do I
acess those values using JavaScipt? Thanks.

I have a length of 2 for CSS objects so I don't know whether it is 0
or 1 I'm assuming 0.since I don't have any other external CSS
statements. The other is declared in the page as <style></style>


Whether you have
<link rel="stylesheet"
or
<style type="text/css">
doesn't matter, browsers like IE4+ or Netscape 6+ and Mozilla support a
document.styleSheets
collection where each sheet appears.
You can access the CSS rules in the stylesheets and read and change
value of properties in a rule, unfortunately different in IE and
Netscape. IE has
document.styleSheets[i].rules[i].style.width
Netscape
document.styleSheets[i].cssRules[i].style.width

Here is an example:

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getStyleObject (styleSheetIndex, ruleIndex) {
if (document.styleSheets) {
var styleSheet = document.styleSheets[styleSheetIndex];
if (styleSheet) {
var rule;
if (styleSheet.cssRules) {
rule = styleSheet.cssRules[ruleIndex];
}
else if (styleSheet.rules) {
rule = styleSheet.rules[ruleIndex];
}
if (rule && rule.style) {
return rule.style;
}
else {
return null;
}
}
else {
return null;
}
}
else {
return null;
}
}

function testStyleSheet () {
var style = getStyleObject(0, 0);
if (style) {
alert('style.height: ' + style.height);
}
else {
alert('style not found.');
}
}
</script>
</head>
<body onload="testStyleSheet();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>

Note that even Opera 7 doesn't support document.styleSheets. And I don't
know about Safari or Konqueror support, does anyone else care to check
and contribute?

Of course with external style sheets make sure you use <body onload
before trying to access them.

You can also check the selector of a rule with selectorText:

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getStyleObjectFromSelector (selectorText) {
if (document.styleSheets) {
for (var i = document.styleSheets.length - 1; i >= 0; i--) {
var styleSheet = document.styleSheets[i];
var rules;
if (styleSheet.cssRules) {
rules = styleSheet.cssRules;
}
else if (styleSheet.rules) {
rules = styleSheet.rules;
}
if (rules) {
for (var j = rules.length - 1; j >= 0; j--) {
if (rules[j].selectorText == selectorText) {
return rules[j].style;
}
}
}
}
return null;
}
else {
return null;
}
}

function testStyleSheet () {
var selectors = ['#aDiv', '.someClass'];
for (var i = 0; i < selectors.length; i++) {
var selector = selectors[i];
var style = getStyleObjectFromSelector(selector);
if (style) {
alert('Selector ' + selector + ': style.height: ' + style.height);
}
else {
alert('No rule found for selector ' + selector);
}
}
}
</script>
</head>
<body onload="testStyleSheet();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>


Of course if you are looking for the computed style of an object there
is no need to read through style sheet rules, getComputedStyle allows
that with Mozilla and with Opera 7 and element.currentStyle with IE5+:

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getComputedStyleForElement (element, cssPropertyName) {
if (element) {
if (window.getComputedStyle) {
return window.getComputedStyle(element,
'').getPropertyValue(cssPropertyName.replace(/([A-Z])/g,
"-$1").toLowerCase());
}
else if (element.currentStyle) {
return element.currentStyle[cssPropertyName];
}
else {
return null;
}
}
else {
return null;
}
}

function getComputedStyleForId (elementId, cssPropertyName) {
if (document.getElementById) {
return
getComputedStyleForElement(document.getElementById (elementId),
cssPropertyName);
}
else {
return null;
}
}

function testComputedStyle () {
var ids = ['aDiv', 'aP'];
for (var i = 0; i < ids.length; i++) {
var cssValue = getComputedStyleForId(ids[i], 'backgroundColor');
if (cssValue === null) {
alert('Style background-color for id ' + ids[i] + ' not found.');
}
else {
alert('Computed style for background-color for id ' + ids[i] + '
is ' + cssValue);
}
}
}
</script>
</head>
<body onload="testComputedStyle();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>

Watch out for Netscape 7 and Opera 7 normalizing CSS values, for
instance color values are returned as rgb(r, g, b).
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #4
Oh I got it never mind it was anothe line continuation issue.

--
George Hester
__________________________________
"George Hester" <he********@hotmail.com> wrote in message news:ta********************@twister.nyroc.rr.com.. .
Hello again Matin. I tried the ComputedStyle one you gave. After fixing for line continuation issues in my newsreader I am getting undefined for both alerts. Is there something wrong with it? Here is what you had and what I put it to that is removing the line continuation issues.

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getComputedStyleForElement (element, cssPropertyName) {
if (element) {
if (window.getComputedStyle) {
return window.getComputedStyle(element,'').getPropertyVal ue(cssPropertyName.replace(/([A-Z])/g, "-$1").toLowerCase());
}
else if (element.currentStyle) {
return element.currentStyle[cssPropertyName];
}
else {
return null;
}
}
else {
return null;
}
}

function getComputedStyleForId (elementId, cssPropertyName) {
if (document.getElementById) {
return
getComputedStyleForElement(document.getElementById (elementId), cssPropertyName);
}
else {
return null;
}
}

function testComputedStyle () {
var ids = ['aDiv', 'aP'];
for (var i = 0; i < ids.length; i++) {
var cssValue = getComputedStyleForId(ids[i], 'backgroundColor');
if (cssValue === null) {
alert('Style background-color for id ' + ids[i] + ' not found.');
}
else {
alert('Computed style for background-color for id ' + ids[i] + ' is ' + cssValue);
}
}
}
</script>
</head>
<body onload="testComputedStyle();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>

--
George Hester
__________________________________
"Martin Honnen" <ma*******@yahoo.de> wrote in message news:3f********@olaf.komtel.net...


George Hester wrote:
I have a css file this is a portion of it:

/* trackaccept.css */ div.track { width:400px; height: 100px; }

I have this in my ASP page:

<link rel="stylesheet" type="text/css"
href="/includes/trackaccept.css"/>

I need to read the values for width and height in my page. How do I
acess those values using JavaScipt? Thanks.

I have a length of 2 for CSS objects so I don't know whether it is 0
or 1 I'm assuming 0.since I don't have any other external CSS
statements. The other is declared in the page as <style></style>


Whether you have
<link rel="stylesheet"
or
<style type="text/css">
doesn't matter, browsers like IE4+ or Netscape 6+ and Mozilla support a
document.styleSheets
collection where each sheet appears.
You can access the CSS rules in the stylesheets and read and change
value of properties in a rule, unfortunately different in IE and
Netscape. IE has
document.styleSheets[i].rules[i].style.width
Netscape
document.styleSheets[i].cssRules[i].style.width

Here is an example:

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getStyleObject (styleSheetIndex, ruleIndex) {
if (document.styleSheets) {
var styleSheet = document.styleSheets[styleSheetIndex];
if (styleSheet) {
var rule;
if (styleSheet.cssRules) {
rule = styleSheet.cssRules[ruleIndex];
}
else if (styleSheet.rules) {
rule = styleSheet.rules[ruleIndex];
}
if (rule && rule.style) {
return rule.style;
}
else {
return null;
}
}
else {
return null;
}
}
else {
return null;
}
}

function testStyleSheet () {
var style = getStyleObject(0, 0);
if (style) {
alert('style.height: ' + style.height);
}
else {
alert('style not found.');
}
}
</script>
</head>
<body onload="testStyleSheet();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>

Note that even Opera 7 doesn't support document.styleSheets. And I don't
know about Safari or Konqueror support, does anyone else care to check
and contribute?

Of course with external style sheets make sure you use <body onload
before trying to access them.

You can also check the selector of a rule with selectorText:

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getStyleObjectFromSelector (selectorText) {
if (document.styleSheets) {
for (var i = document.styleSheets.length - 1; i >= 0; i--) {
var styleSheet = document.styleSheets[i];
var rules;
if (styleSheet.cssRules) {
rules = styleSheet.cssRules;
}
else if (styleSheet.rules) {
rules = styleSheet.rules;
}
if (rules) {
for (var j = rules.length - 1; j >= 0; j--) {
if (rules[j].selectorText == selectorText) {
return rules[j].style;
}
}
}
}
return null;
}
else {
return null;
}
}

function testStyleSheet () {
var selectors = ['#aDiv', '.someClass'];
for (var i = 0; i < selectors.length; i++) {
var selector = selectors[i];
var style = getStyleObjectFromSelector(selector);
if (style) {
alert('Selector ' + selector + ': style.height: ' + style.height);
}
else {
alert('No rule found for selector ' + selector);
}
}
}
</script>
</head>
<body onload="testStyleSheet();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>


Of course if you are looking for the computed style of an object there
is no need to read through style sheet rules, getComputedStyle allows
that with Mozilla and with Opera 7 and element.currentStyle with IE5+:

<html>
<head>
<title>reading out stylesheet information</title>
<style type="text/css">
#aDiv {
color: darkgreen;
background-color: lightgreen;
height: 200px;
}
</style>
<script type="text/javascript">
function getComputedStyleForElement (element, cssPropertyName) {
if (element) {
if (window.getComputedStyle) {
return window.getComputedStyle(element,
'').getPropertyValue(cssPropertyName.replace(/([A-Z])/g,
"-$1").toLowerCase());
}
else if (element.currentStyle) {
return element.currentStyle[cssPropertyName];
}
else {
return null;
}
}
else {
return null;
}
}

function getComputedStyleForId (elementId, cssPropertyName) {
if (document.getElementById) {
return
getComputedStyleForElement(document.getElementById (elementId),
cssPropertyName);
}
else {
return null;
}
}

function testComputedStyle () {
var ids = ['aDiv', 'aP'];
for (var i = 0; i < ids.length; i++) {
var cssValue = getComputedStyleForId(ids[i], 'backgroundColor');
if (cssValue === null) {
alert('Style background-color for id ' + ids[i] + ' not found.');
}
else {
alert('Computed style for background-color for id ' + ids[i] + '
is ' + cssValue);
}
}
}
</script>
</head>
<body onload="testComputedStyle();">
<div id="aDiv">
<p>
Test.
</p>
</div>
</body>
</html>

Watch out for Netscape 7 and Opera 7 normalizing CSS values, for
instance color values are returned as rgb(r, g, b).
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #5
JRS: In article <zC********************@twister.nyroc.rr.com>, seen in
news:comp.lang.javascript, George Hester <he********@hotmail.com> posted
at Sat, 6 Dec 2003 18:55:27 :-
Lines: 256
Oh Martin thanks for that.

--
George Hester
__________________________________
"Martin Honnen" <ma*******@yahoo.de> wrote in message news:3f********@olaf.komte
l.net...


George Hester wrote:
> I have a css file this is a portion of it:
> ...


*Plonk*. See FTI28, and c.l.j FAQ.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 20 '05 #6
What's your problem? Do you just hate helpful people or do you just hate in general?

--
George Hester
__________________________________
"Dr John Stockton" <sp**@merlyn.demon.co.uk> wrote in message news:u$**************@merlyn.demon.co.uk...
JRS: In article <zC********************@twister.nyroc.rr.com>, seen in
news:comp.lang.javascript, George Hester <he********@hotmail.com> posted
at Sat, 6 Dec 2003 18:55:27 :-
Lines: 256


Oh Martin thanks for that.

--
George Hester
__________________________________
"Martin Honnen" <ma*******@yahoo.de> wrote in message news:3f********@olaf.komte
l.net...


George Hester wrote:

> I have a css file this is a portion of it:
> ...


*Plonk*. See FTI28, and c.l.j FAQ.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

Jul 20 '05 #7
George Hester hu kiteb:
What's your problem? Do you just hate helpful people or do you just
hate in general?


I think his point is that requoting an extremely long post IN FULL just
to add a simple thank you is a waste of bandwidth. Most people here tend
to agree with that sentiment.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #8
6KB more then yours 2KB!!!. How much bandwidth did that run the Doctor? Funny place but I hear you will try to be more considerate in the future. Can't have too many six-pence spent needlessly now can we?

--
George Hester
__________________________________
"Fabian" <la****@hotmail.com> wrote in message news:br*************@ID-174912.news.uni-berlin.de...
George Hester hu kiteb:
What's your problem? Do you just hate helpful people or do you just
hate in general?


I think his point is that requoting an extremely long post IN FULL just
to add a simple thank you is a waste of bandwidth. Most people here tend
to agree with that sentiment.


--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #9
George Hester wrote:
6KB more then yours 2KB!!!.
Your `!' key is borken.

Well, it sums up *and* it multiplies with every top-posting person.
[TOFU: Text Over, Fullquote Under / Top post]


*PLONK*
PointedEars
Jul 20 '05 #10
This works well if my stylesheet is inline or from a local file. But if
try to import a sheet where href="http://remote_server/...." then I
can't seem to access the rules for the stylesheet. I can see the
stylesheet in the StyleSheets object, but the rules collection is not
accessible. Any thoughts?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #11
On 03 May 2004 01:07:02 GMT, tim arthur <ti**@msn.com> wrote:
This works well if my stylesheet is inline or from a local file. But if
try to import a sheet where href="http://remote_server/...." then I
can't seem to access the rules for the stylesheet. I can see the
stylesheet in the StyleSheets object, but the rules collection is not
accessible.
To whom and to what are you responding? ALWAYS quote material that shows
the context of your post.
Any thoughts?


A URL to an example would be nice.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #12

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

Similar topics

6
by: Denis | last post by:
I am trying to launch an .mdb file via javascript. I do not need to do anything but open the application. It is able to open the application but for some reason it opens and then closes. At...
7
by: George Hester | last post by:
Please take a look at this google artcle: http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9 The op was having trouble with...
4
by: Lefteris | last post by:
Hi, I am trying to write a simple application in javascript that automatically fills the fields of a form in a page at another domain. I display the foreign domain page on a frame and have the...
6
by: Jon Davis | last post by:
I recently learned how to do an <OBJECT> alternative to <IFRAME> in current browsers using: <object id="extendedhtml" type="text/html" data="otherpage.html" width="250" height="400"></object> ...
3
by: Robert Oschler | last post by:
I know there isn't any $_POST array in Javascript, it exists on the server side accessible from PHP and other server side scripting languages. But I knew it would let you know specifically what...
7
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I access a property of an object using a string?...
3
by: SM | last post by:
Hello, Im trying to access elements in my XML file using the JavaScript DOM but i'm not sure how. I use AJAX to access the XML and then use the responseXML property to access the XML file data. I...
10
by: Stefan Weber | last post by:
Hi, I'm trying to access the JavaScript code contained in a <scripttag via its "text" attribute. This works well, if the code is embedded in the HTML page. However, when the code is in an...
7
by: tshad | last post by:
How do you hide an asp.net object and still be able to access it? I had my email in a session variable, but you can't access the session variable from Javascript (I don't think - since Javascript...
7
by: JDOMPer | last post by:
Don’t misunderstand me – I use AJAX, but I think there is a far simpler, elegant alternative that just uses Javascript, the DOM and Php ( hence - JDOMP) for data transfers, and is cross-browser...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.