Forum Moderators: not2easy
Errors
URI : file://localhost/first.htm
Line: 7
Parse error - Unrecognized : <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>First Xhtml</title> <link rel="stylesheet" href="first/basic.css" type="text/css" /> <style type="text/css" media="screen"> @import url(http://127.0.0.1/layout.css);
thanks in advance.
regards,
Mark
Correct:
@import url(style.css);
@import "style.css";
Wrong:
@import url("style.css");
@import style.css
Most browsers are forgiving, but it never hurt to do things right ;)
Now, to the problem. Do you have a Web server installed? What happens if you point the browser to [127.0.0.1?...]
Have you tried changing the path for the CSS file to file://localhost/layout.css?
What exactly of the above do you have on line 7?
regards,
Mark
<style type="text/css" media="screen">
@import "http:/127.0.0.1/layout.css";
.leftmenu ul {
margin: 0px;
padding: 0px 0px 10px 15px;
list-style-type: square;
}
h3 {
margin-bottom: 1em;
}
pre {
margin: 15px;
padding: 10px;
border: 1px dashed #ccc;
color: #006;
background-color: transparent;
}
</style>
Then it says error at Line 7 but everything after that it is fine, displaying the valid css, if I delete the @import line it then says line 12 is invalid which is the next definition
.leftmenu ul {
margin: 0px;
padding: 0px 0px 10px 15px;
list-style-type: square;
}
and It says the rest of the definitions are fine so I delete that then it says the h3 line is an error, this really baffles me, the only time it validates is if I just have
<style type="text/css" media="screen"></style>
which defeats the purpose it wont let me define anything in there without an error, Am I doing something wrong that is so simple I dont see it.
regards,
Mark
<style type="text/css" media="screen"></style>
The followoing wont work
<style type="text/css" media="screen">
.leftmenu ul {
margin: 0px;
padding: 0px 0px 10px 15px;
list-style-type: square;
}
</style>
anything in between doesnt work, I think im gonna stuff the validation cause it works fine on every browser I have tried.
regards,
Mark
Are all valid. Try it in the validator (you have to actually link to a CSS file for it to work though).
As a side note, arlier this week I found that you can match:
<div class="-">foo</div>
<div class="1">foo</div>
<div class="^J">foo</div>
With selectors, reading the grammar pays off!
[webmasterworld.com...]
And, what defines a quote? Well, technically there is a variety of quotation marks we could use: " ' ` etc. But some of those would, of course, not be suitable in this situation. However, there are still certain issues even if just regular straight quotes (single or double) are used.