Page 1 of 1
DOC TYPE errors - xhtml...
Posted: Fri Jan 22, 2016 10:44 am
by simonmlewis
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
We have that in the top of the template.
But the "XHTML" part of it is apparently too restrictive.
I am told that simple <!DOCTYPE html> will do, but if I do that, I get gaps around DIVs where before, there were no gaps.
Why would that be?
Re: DOC TYPE errors - xhtml...
Posted: Fri Jan 22, 2016 10:48 am
by Celauran
XHTML is somewhat dated and probably not appropriate. <!DOCTYPE html> is the HTML5 doctype and is probably what you want to be using. Hard to speculate on anything else without markup, styling, and possibly screenshots using each doctype.
Re: DOC TYPE errors - xhtml...
Posted: Fri Jan 22, 2016 10:52 am
by simonmlewis
Is there a slightly previous version of
<!DOCTYPE html>
That I can use? It might be that the style of CSS or coding, is not HTML5, and that could be why I am getting the gaps. (tho it would be odd to add a gap, where there is no gap in the code)
Re: DOC TYPE errors - xhtml...
Posted: Fri Jan 22, 2016 10:56 am
by Celauran
https://www.w3.org/QA/2002/04/valid-dtd-list.html
You could fall back to HTML 4.
What issues are you encountering with XHTML?
Re: DOC TYPE errors - xhtml...
Posted: Fri Jan 22, 2016 11:05 am
by simonmlewis
The main bizarre image is a set of divs with images inside. So I have tiled DIVs.
Within each Div is an image div with no width setting (so full width).
Inside is an image. For some reason, that image is not filling out the div, it's always having a 4 or 5 pixel gap at the bottom.
If I set the inner div to be 80%, it shrinks it down, but still there is that gap.
The CSS has no padding or margin inside that div. And if I click on the gap, there is something any padding/margin.
Take off the doctype and go back to the old one (before html 4!!), and the gap goes.
Re: DOC TYPE errors - xhtml...
Posted: Fri Jan 22, 2016 11:08 am
by simonmlewis
I just did this:
Code: Select all
img
{
height: auto; /* Make sure images are scaled correctly. */
width: 100%; /* Adhere to container width. */
display:block;
}
And it worked. IT didn't stretch it, it just made the lower div move up as the image div was scaled.
Why would it even "not" scale it anyway??
Re: DOC TYPE errors - xhtml...
Posted: Sat Jan 23, 2016 3:16 pm
by simonmlewis
I've been reading up a lot about this.
Seems that Google preferrs it to be standard html5 now, and that 5 seems to want display: block if the image is in a DIV.
But it also warns about this:
[text]: Using the meta element to specify the document-wide default language is obsolete. Consider specifying the language on the root element instead.
From line 42, column 1; to line 42, column 54
S</title>↩<meta http-equiv="content-language" content="EN-GB" />↩<meta[/text]
Where do I put the language?
We want it there, because we have other sites in diff languages. Maybe it's not relevant at all, but if we want it where should it go?
Re: DOC TYPE errors - xhtml...
Posted: Sat Jan 23, 2016 3:47 pm
by Celauran
The root elements means the html tag itself, so
Code: Select all
<!DOCTYPE html>
<html lang="en-GB">
<head>
.. etc
Re: DOC TYPE errors - xhtml...
Posted: Sat Jan 23, 2016 4:18 pm
by simonmlewis
What about the Utf-8?
If I use that it hates it and tells me to use Windows. How does it know what to use and where do I put it?
Trying to get errors I can control down to zero. For homepage at least.
Re: DOC TYPE errors - xhtml...
Posted: Sat Jan 23, 2016 4:20 pm
by Celauran
Character set goes in a meta tag.
Code: Select all
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
... other stuff
Re: DOC TYPE errors - xhtml...
Posted: Sat Jan 23, 2016 4:22 pm
by Celauran
Re: DOC TYPE errors - xhtml...
Posted: Sat Jan 23, 2016 4:23 pm
by Celauran
Re: DOC TYPE errors - xhtml...
Posted: Sat Jan 23, 2016 4:27 pm
by simonmlewis
Thanks. Will def look.