What could affect the location of text outside of <div>...</div>
? They are using the same CSS but text appears in 2 locations on 2 different pages.
Here are 2 sample pages:
Homepage link shows in the correct location: CodeList
Homepage link shows in the wrong location: Code Assessment
I copied and pasted all the top section html on CodeList to CodeAssessment and the text skewing r开发者_运维问答emains. I turned on show Whitespace in Visual studio, but since what I believe to be the relevant text was copied and pasted, that didn't reveal anything.
I'm using the Gestured template from FreeCssTemplates. The location of those links is not related to their intended usage, I just copied and pasted the html out to somewhere I could easily link them for testing and assistance. So I know the form components may appear not to work, but this isn't their home. They work here locally on my IIS and inside cassini.
Not sure what your question is, but my advice: make sure any HTML code validates before you try to fix design or rendering errors (or browser dependency bugs for that matter). In any case, never place any layout outside the boundaries of <body>...</body>
. Fix it, and you'll be able to effectively use CSS on them.
In a meanwhile deleted answer, Peter Lacomb Jr spotted that backslashes where used where URI was required. Backslashes are illegal anywhere else then in Windows (and then only for file paths). For URIs, URLs etc: never use backslashes. They have no special meaning. Forward slashes, on the other hand, do have special meaning: as a path separator.
Looking further:
The offending page starts out with a comment. I don't know why you put it there, but this triggers backwards compatibility mode. Your code is XHTML. Let it start with an XML declaration. Also, fix the <script>
body as Peter suggested, like so:
<script ...>
//<![CDATA[
functionA(...) { blabla; }
functionB(...) { blabla; }
etc...
// ]]>
</script>
And no, it doesn't affect the javascript itself. It's just for making it easier to write <
and &
, which need to be escaped, but not inside XML CDATA
sections. You should actually always do this when using XHTML.
To check whether the document is in backwards compatibility (quirks) mode type the following in the address bar of IE after you've loaded your page. You'll notice it is different for the two pages:
javascript:alert(document.compatMode);
I see that you're using .NET for your application. Are you using master pages for the layout of the site? I'm going to assume that you are.
The section on the CodeAssessment.aspx page which is marked:
<div id="Div1"></div>
probably shouldn't have been copied and pasted into that page at all. That section should have probably been left on the master page. You content areas are where you should have your application (the dropdowns, the radio buttons, etc).
Take a look at using Master Pages on asp.net and see how they break up a site and use master pages in conjunction with content pages.
All you really have to do is make sure that your master page is valid and then your content pages should work like expected.
Good luck, and hope this helps some.
精彩评论