|
-
Apr 23rd, 2002, 09:30 AM
#1
Thread Starter
Frenzied Member
I don't know...
Sorry, I have no idea what a good subject would be.
And I am growing to hate the documentation at the W3C. I can't find what I need.
Code:
<html>
<head>
<title>Test Page</title>
<style type="text/css">
body {
text-align: center;
}
.Container {
text-align: center;
width: 600px;
border-style: solid;
border-color: red;
border-width: 2px;
}
.leftBox {
position: relative;
float: left;
width: 40%;
margin: 4%;
border-style: inset;
border-width: 4px;
border-color: blue;
}
.rightBox {
float: left;
width: 40%;
margin: 4%;
border-style: inset;
border-width: 4px;
border-color: gray;
}
</style>
</head>
<body>
<div class="Container" id="Container">
<script type="text/javascript">
document.write(document.getElementById("Container").style.borderColor);
</script>
<div class="leftBox">
<p>bar</p>
</div>
<div class="rightBox">
<p>blah</p>
</div>
</div>
</body>
</html>
This page as two problems.
The first: document.getElementById() returns a Node object. .style.borderColor will return that Node objects inline style attribute border-color value. I want to get the border color set in the style sheet. I some how imagine this should be possible without using the ID attribute.
Second: This page doesn't show consistently on every browser. Go figure. I don't care so much about that, I just want to know how it is supposed to be displayed. Is text-align supposed to apply to block element children (div), or just inline (span)? Is the border for div.Container supposed to wrap around the children divs, or not? These are things that I am sure are specified in the standards, I'm just not finding what I want.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|