|
Author |
Message |
GuruOnAMountain
Junior WebHelper
Joined: 27 Feb 2008
Posts: 2
|
Posted:
Wed Feb 27, 2008 4:02 pm (16 years, 1 month ago) |
|
I'm very new to this, but tried a website, DTD and CSS sheet before using a step by step guide and managed to get it all to work fine. Now, however, I'm trying it on my own for the first time and struggling. No matter what I've tried, I've had no luck. I also think I've done my DTD wrong, but I'm not sure if that would effect the CSS sheet or not, I'm guessing that it wouldn't.
I'll copy and post my website and CSS code below. If any one could give me a step for a hint, it'd be much appreciated!!
This is my website code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE website [
<!ELEMENT website (header,title,graphic,body,sidebar,button,content)
<!ELEMENT header (title,graphic)>
<!ELEMENT body (sidebar,button,content)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT graphic (#PCDATA)>
<!ELEMENT sidebar (#PCDATA)>
<!ELEMENT p (#PCDATA)>
<!ELEMENT content (#PCDATA)
]>
<?xml-stylesheet href="website.css" type="text/css"?>
<website>
<header>
<title>Suck It & See!</title>
<graphic><img src = "Lolly3.gif" alt = "Lolly Logo"/></graphic>
</header>
<body>
<sidebar>
<p><a href = "Homepage.html"><img src = "HomeButton.png" alt = "Home"/></a></p>
<p><a href = "LogInPage.html"><img src = "LogInButton.png" alt = "Log In"/></a></p>
<p><a href = "RegisterPage.html"><img src = "RegisterButton.png" alt = "Register"/></a></p>
<p><a href = "ViewItemsPage.html"><img src = "ViewItemsButton.png" alt = "View Items"/></a></p>
<p><a href = "AboutUsPage.html"><img src = "AboutUsButton.png" alt = "About Us"/></a></p>
<p><a href = "ContactUsPage.html"><img src = "ContactUsButton.png" alt = "Contact Us"/></a></p>
<p><a href = "HelpPage.html"><img src = "HelpButton.png" alt = "Help"/></a></p>
</sidebar>
<content>
Welcome to Suck It & See!
</content>
</body>
</website>
CSS code (there's not much too this....I'll do more once I manage to get this little bit working):
content {
font-weight:bold;
color:red;
}
Thanks in advance!! |
|
|
|
|
Robert Wellock
WebHelper
Joined: 18 Jan 2002
Posts: 61
Location: Yorkshire - UK
|
Posted:
Thu Feb 28, 2008 4:08 pm (16 years, 1 month ago) |
|
I assume you are serving it as 'application/xml' or 'text/xml' and viewing it via something like Mozilla your style sheet must come directly after; <?xml version="1.0" encoding="UTF-8"?> line, i.e. reside on the second line before the ... !DOCTYPE ... plus you must escape the two ampersands.
If you just use the plain XML file without the DTD it will then work - CSS only matches patterns it doesn't care about which markup language you use.
You have a few other typos too so I've fixed them below:
Code: | <!DOCTYPE website [
<!ELEMENT website (header,title,graphic,body,sidebar,button,content)>
<!ELEMENT header (title,graphic)>
<!ELEMENT body (sidebar,button,content)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT graphic (#PCDATA)>
<!ELEMENT sidebar (#PCDATA)>
<!ELEMENT p (#PCDATA)>
<!ELEMENT content (#PCDATA)>
]> |
Thus if you want to add the DTD and make it useful you will need to add more valid the attributes, etc. |
________________________________ };-) http://www.xhtmlcoder.com/ |
|
|
|
GuruOnAMountain
Junior WebHelper
Joined: 27 Feb 2008
Posts: 2
|
Posted:
Fri Feb 29, 2008 11:47 am (16 years, 1 month ago) |
|
Thanks very much for the help! |
|
|
|
|
Robert Wellock
WebHelper
Joined: 18 Jan 2002
Posts: 61
Location: Yorkshire - UK
|
Posted:
Wed Mar 12, 2008 12:42 pm (16 years, 1 month ago) |
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.247829 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |