/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] validation errors – doctype

Hi. I have used validation tool to find and fix most of my index page few dozen errors.

There are however the following that I cannot fix without some help.

Firstly I should point out that my page is .shtml ,i.e. the index page is [url]http://www.minifigtimes.com/index.shtml[/url]

I have a css file, [url]http://www.minifigtimes.com/default.css[/url]

It contains the following DOCTYPE that I probably just lifted from somewhere (I dont know if this is right for my page, probably not..)

[code=php]<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>[/code]

The errors I can’t fix are shown here: [B][url]http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.minifigtimes.com%2F[/url][/B]

There are 7 errors but most are repetition I think, i.e. I think I have 4 errors.

Some are related to a Javascript I am using to display random images with an associated hyperlink.

Any help really appreciated. Thanks!

to post a comment
HTML

24 Comments(s)

Copy linkTweet thisAlerts:
@scragarJan 28.2009 — Well line 60 has an un-needed <html> tag, so get rid of that first, same goes for the <head> tag and it's content in there. Merge your head tags if you can.

After that you need to add <![CDATA[ tags around javascript, so the validator knows it's not HTML:
//&lt;![CDATA[
....
// ]]&gt;

And finally:[code=html]<script type='text/javascript'>[/code]
There is no language attribute any more, use the type attribute instead.
Copy linkTweet thisAlerts:
@LEGO-MafiaauthorJan 28.2009 — Hey thanks again scragar.

The reason why there are 2 <html> and <head>, <body> tags is that I am using an SSI, http://www.minifigtimes.com/insert-menu.shtml

This file is placed on line 60.

Can you clarify if I should remove tags from the SSI file?

I have placed the CDATA in different places around the javascript code such as below but although it removed the validation error the script isn't executing. I am assuming maybe that I have them in the wrong places.

[code=php]
//<![CDATA[

<script type='text/javascript'>
<!--

/*
Random Image Link Script- By JavaScript Kit(http://www.javascriptkit.com)
Over 200+ free JavaScripts here!
Updated: 00/04/25
*/

function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-218.png"
myimages[2]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-217.png"
myimages[3]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-215.png"
myimages[4]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-213.png"
myimages[5]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-211.png"
myimages[6]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-210.png"
myimages[7]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-237.png"
myimages[8]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-249.png"
myimages[9]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-250.png"
myimages[10]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-255.png"
myimages[11]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-259.png"
myimages[12]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2006/archive-006.png"
myimages[13]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2006/archive-026.png"
myimages[14]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-240.png"
myimages[15]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-276.png"
myimages[16]="http://www.brickshelf.com/gallery/legolandtimes3/archives/2008/archive-281.png"




//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="http://legolandtimes.bravehost.com/news/2008/1/00218.html"
imagelinks[2]="http://legolandtimes.bravehost.com/news/2008/1/00217.html"
imagelinks[3]="http://legolandtimes.bravehost.com/news/2008/1/00215.html"
imagelinks[4]="http://legolandtimes.bravehost.com/news/2008/1/00213.html"
imagelinks[5]="http://legolandtimes.bravehost.com/news/2008/1/00211.html"
imagelinks[6]="http://legolandtimes.bravehost.com/news/2008/1/00210.html"
imagelinks[7]="http://legolandtimes.bravehost.com/news/2008/1/00237.html"
imagelinks[8]="http://legolandtimes.bravehost.com/news/2008/1/00249.html"
imagelinks[9]="http://legolandtimes.bravehost.com/news/2008/1/00250.html"
imagelinks[10]="http://legolandtimes.bravehost.com/news/2008/1/00255.html"
imagelinks[11]="http://legolandtimes.bravehost.com/news/2008/1/00259.html"
imagelinks[12]="http://legolandtimes.bravehost.com/news/2006/1/00006.html"
imagelinks[13]="http://legolandtimes.bravehost.com/news/2006/1/00026.html"
imagelinks[14]="http://legolandtimes.bravehost.com/news/2008/1/00240.html"
imagelinks[15]="http://legolandtimes.bravehost.com/news/2008/1/00276.html"
imagelinks[16]="http://legolandtimes.bravehost.com/news/2008/1/00281.html"


var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')
}
random_imglink()
//-->
</script>

// ]]>[/code]
Copy linkTweet thisAlerts:
@CharlesJan 28.2009 — Only mark SCRIPTs as CDATA in XHTML, you are using HTML. From the HTML 3.2 Specification:These elements are defined with CDATA as the content type. As a result they may contain only SGML characters. All markup characters or delimiters are ignored and passed as data to the application, except for ETAGO ("</") delimiters followed immediately by a name character [a-zA-Z]. This means that the element's end-tag (or that of an element in which it is nested) is recognized, while an error occurs if the ETAGO is invalid.

http://www.w3.org/TR/REC-html32#script [/quote]
If you had put those marks inside the SCRIPT element but outside the script itself, as Mr. Scrager had suggested, then the marks would themselves have been escaped and seen as a part of the script causing a syntax error. Putting them outside of the SCRIPT elemement escapes the SCRIPT tags and turns the tags themselves, and the script, into text. And you should be using the following DOCTYPE:&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"&gt;
Copy linkTweet thisAlerts:
@LEGO-MafiaauthorJan 28.2009 — Only mark SCRIPTs as CDATA in XHTML, you are using HTML. From the HTML 3.2 Specification:If you had put those marks inside the SCRIPT element but outside the script itself, as Mr. Scrager had suggested, then the marks would themselves have been escaped and seen as a part of the script causing a syntax error. Putting them outside of the SCRIPT elemement escapes the SCRIPT tags and turns the tags themselves, and the script, into text.
[/QUOTE]


So as mine is HTML, what should I use instead of CDATA?


And you should be using the following DOCTYPE:&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"&gt;
[/QUOTE]


If I change it to this I get 67 errors ?
Copy linkTweet thisAlerts:
@CharlesJan 28.2009 — So as mine is HTML, what should I use instead of CDATA?[/QUOTE]Nothing at all, everybody already knows that the script is CDATA. This is all that you need:&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;Example&lt;/title&gt;
&lt;script type="text/javascript"&gt;
if (document.getElementById) onload = function () {
var p = document.createElement ('P');
p.appendChild (document.createTextNode ('Hello, World!'));
document.getElementsByTagName ('BODY')[0].appendChild(p);
}
&lt;/script&gt;
But if you are old school about it:&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;HTML lang="en"&gt;
&lt;HEAD&gt;
&lt;META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;TITLE&gt;Example&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;
&lt;SCRIPT type="text/javascript"&gt;
&lt;!--
if (document.getElementById) onload = function () {
var p = document.createElement ('P');
p.appendChild (document.createTextNode ('Hello, World!'));
document.getElementsByTagName ('BODY')[0].appendChild(p);
}
// --&gt;
&lt;/SCRIPT&gt;
&lt;/BODY&gt;
&lt;/HTML&gt;
Copy linkTweet thisAlerts:
@FangJan 28.2009 — The reason why there are 2 <html> and <head>, <body> tags is that I am using an SSI[/QUOTE]These elements should only be in one file, the other included files must not have them as well.

The .shtml document&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;

&lt;script type="text/javascript"&gt;
&lt;!--#include file="script.txt" --&gt;
&lt;/script&gt;

&lt;style type="text/css"&gt;
&lt;!--#include file="css.txt" --&gt;
&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;!--#include file="menu.txt" --&gt;
&lt;!--#include file="content.txt" --&gt;
&lt;/body&gt;
&lt;/html&gt;
Then menu.txt would only contain:&lt;div class="pd_menu_01 "&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="/"&gt;Home&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="#"&gt;News&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://legolandtimes.bravehost.com/aaa-news.html" &gt;Latest Headlines&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://legolandtimes.bravehost.com/aaa-news-shorts.html" &gt;In Brief&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://legolandtimes.bravehost.com/aaa-news-archive.html" &gt;Archives&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="football.shtml"&gt;Sport&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="football.shtml"&gt;Football&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href="#"&gt;Resources&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://legolandtimes.bravehost.com/aaa-tlt-about.html" &gt;About&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://legolandtimes.bravehost.com/aaa-tlt-contact.html" &gt;Contact&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;/div&gt;
Copy linkTweet thisAlerts:
@LEGO-MafiaauthorJan 28.2009 — Thanks Fang. Can I have this in the menu.txt insert:

is there a reason why you changed the insert from a .shtml to .txt ?

can i have the following style code and <img> tag also in the menu.txt insert as I had this in my .shtml insert?


[code=php]<style type="text/css" media="screen">
body{ behavior:url("csshover2.htc"); }
.pd_menu_01 {float:left; padding:0; margin:0;color: #000000;background: #D1D1D1;width:100%; border:solid 1px #FFFFFF;clear:both;} /*Color navigation bar normal mode*/
.pd_menu_01 a, .pd_menu_01 a:visited {
font-family:calibri;
font-style:normal;
font-weight:bold;
font-size:12px;
color: #000000;
background-color: #D1D1D1;
text-decoration: none;
}
.pd_menu_01 ul {list-style-type:none;padding:0; margin:0;}
.pd_menu_01 ul li {float:left; position:relative; z-index:auto !important ; z-index:1000 ; border-right:solid 1px #FFFFFF; border-left:solid 1px #FFFFFF;}
.pd_menu_01 ul li a {color: #000000;background: #D1D1D1;float:none !important ; float:left ; display:block; height:30px; line-height:30px; padding:0 10px 0 10px; text-decoration:none; }
.pd_menu_01 ul li ul {display:none; border:none;color: #000000;background: #D1D1D1; width:1px}
.pd_menu_01 ul li:hover a {background-color:#D1D1D1; text-decoration:none; color:#0482FF;} /*Color main cells hovering mode*/
.pd_menu_01 ul li:hover ul {display:block; position:absolute; z-index:999; top:29px; margin-top:1px; left:0;}
.pd_menu_01 ul li:hover ul li a {display:block; width:12em; height:auto; line-height:1.3em; margin-left:-1px; padding:5px 10px 5px 10px; border-left:solid 1px #FFFFFF; border-bottom: solid 1px #FFFFFF; background-color:#FFFFFF; color:#0482FF;} /*Color subcells normal mode*/
.pd_menu_01 ul li:hover ul li a:hover {background-color:#D1D1D1; text-decoration:none;color:#FFFFFF;} /*Color subcells hovering mode*/
.pd_menu_01 ul li a:hover {background-color:#D1D1D1; text-decoration:none;color:#0482FF;} /*Color main cells hovering mode*/
.pd_menu_01 ul li a:hover ul {display:block; width:12em; position:absolute; z-index:999; top:29px; left:0; }
.pd_menu_01 ul li ul li a:visited { background-color:#FFFFFF; color:#0482FF;} /*Color subcells normal mode*/
.pd_menu_01 ul li a:hover ul li a {display:block; width:12em; height:1px; line-height:1.3em; padding:4px 16px 4px 16px; border-left:solid 1px #FFFFFF; border-bottom: solid 1px #FFFFFF; background-color:#FFFFFF; color:#0482FF;}
.pd_menu_01 ul li a:hover ul li a:hover {background-color:#D1D1D1; text-decoration:none;color:#FFFFFF;} /*Color subcells hovering mode*/
</style>




<img src="images-site/banner-main.png" alt="The Minifig Times">

<br>

<div class="pd_menu_01 ">
<ul><li><a href="/">Home</a>
</li></ul>

<ul><li><a href="#">News</a>
<ul>
<li><a href="http://legolandtimes.bravehost.com/aaa-news.html" >Latest Headlines</a></li>
<li><a href="http://legolandtimes.bravehost.com/aaa-news-shorts.html" >In Brief</a></li>
<li><a href="http://legolandtimes.bravehost.com/aaa-news-archive.html" >Archives</a></li>
</ul>
</li></ul>

<ul><li><a href="football.shtml">Sport</a>
<ul>
<li><a href="football.shtml">Football</a></li>
</ul>
</li></ul>


<ul><li><a href="#">Resources</a>
<ul>
<li><a href="http://legolandtimes.bravehost.com/aaa-tlt-about.html" >About</a></li>
<li><a href="http://legolandtimes.bravehost.com/aaa-tlt-contact.html" >Contact</a></li>
</ul>
</li></ul>

</div>
[/code]
Copy linkTweet thisAlerts:
@CharlesJan 28.2009 — The filename extension of the included file can be anything that you like. I typiclly use ".inc" and then block outside access to ".in*".

The rule is that your include command gets completely replaced by the contents of the included file and all that matters is the final result. You can't combine in one file the style and HTML for your menu because each needs to end up in a different part of the resulting document. Sort of.

If your menu file contains the last part of the document's HEAD element and the first part of its BODY then it will work.
Copy linkTweet thisAlerts:
@FangJan 28.2009 — It is irrelevant if it is .shtml or .txt for the included files. Using .inc as [B]Charles [/B]suggests is a common notation. Only the 'parent' document must conform to the correct file extension for your server, probably .shtml

It is better to split style, JavaScript and code into separate files.

The style in your menu.txt can not be within the <body>, place it in the css.txt or as menucss.text&lt;style type="text/css"&gt;
&lt;!--#include file="css.txt" --&gt;
&lt;!--#include file="menucss.txt" --&gt;
&lt;/style&gt;
Better still is to use external css documents&lt;link rel="stylesheet" type="text/css" href="menucss.css" title="menu"&gt;
Copy linkTweet thisAlerts:
@LEGO-MafiaauthorJan 28.2009 — The filename extension of the included file can be anything that you like. I typiclly use ".inc" and then block outside access to ".in*".

The rule is that your include command gets completely replaced by the contents of the included file and all that matters is the final result. You can't combine in one file the style and HTML for your menu because each needs to end up in a different part of the resulting document. Sort of.

If your menu file contains the last part of the document's HEAD element and the first part of its BODY then it will work.[/QUOTE]


Thanks Charles for explanation.

However, I have removed the html, head, body tags from my .shtml insert but left in the style code. It seems to work fine but maybe its wrong?

here is what now my insert looks like..


[code=php]
<style type="text/css" media="screen">
body{ behavior:url("csshover2.htc"); }
.pd_menu_01 {float:left; padding:0; margin:0;color: #000000;background: #D1D1D1;width:100%; border:solid 1px #FFFFFF;clear:both;} /*Color navigation bar normal mode*/
.pd_menu_01 a, .pd_menu_01 a:visited {
font-family:calibri;
font-style:normal;
font-weight:bold;
font-size:12px;
color: #000000;
background-color: #D1D1D1;
text-decoration: none;
}
.pd_menu_01 ul {list-style-type:none;padding:0; margin:0;}
.pd_menu_01 ul li {float:left; position:relative; z-index:auto !important ; z-index:1000 ; border-right:solid 1px #FFFFFF; border-left:solid 1px #FFFFFF;}
.pd_menu_01 ul li a {color: #000000;background: #D1D1D1;float:none !important ; float:left ; display:block; height:30px; line-height:30px; padding:0 10px 0 10px; text-decoration:none; }
.pd_menu_01 ul li ul {display:none; border:none;color: #000000;background: #D1D1D1; width:1px}
.pd_menu_01 ul li:hover a {background-color:#D1D1D1; text-decoration:none; color:#0482FF;} /*Color main cells hovering mode*/
.pd_menu_01 ul li:hover ul {display:block; position:absolute; z-index:999; top:29px; margin-top:1px; left:0;}
.pd_menu_01 ul li:hover ul li a {display:block; width:12em; height:auto; line-height:1.3em; margin-left:-1px; padding:5px 10px 5px 10px; border-left:solid 1px #FFFFFF; border-bottom: solid 1px #FFFFFF; background-color:#FFFFFF; color:#0482FF;} /*Color subcells normal mode*/
.pd_menu_01 ul li:hover ul li a:hover {background-color:#D1D1D1; text-decoration:none;color:#FFFFFF;} /*Color subcells hovering mode*/
.pd_menu_01 ul li a:hover {background-color:#D1D1D1; text-decoration:none;color:#0482FF;} /*Color main cells hovering mode*/
.pd_menu_01 ul li a:hover ul {display:block; width:12em; position:absolute; z-index:999; top:29px; left:0; }
.pd_menu_01 ul li ul li a:visited { background-color:#FFFFFF; color:#0482FF;} /*Color subcells normal mode*/
.pd_menu_01 ul li a:hover ul li a {display:block; width:12em; height:1px; line-height:1.3em; padding:4px 16px 4px 16px; border-left:solid 1px #FFFFFF; border-bottom: solid 1px #FFFFFF; background-color:#FFFFFF; color:#0482FF;}
.pd_menu_01 ul li a:hover ul li a:hover {background-color:#D1D1D1; text-decoration:none;color:#FFFFFF;} /*Color subcells hovering mode*/
</style>




<img src="images-site/banner-main.png" alt="The Minifig Times">

<br>

<div class="pd_menu_01 ">
<ul><li><a href="/">Home</a>
</li></ul>

<ul><li><a href="#">News</a>
<ul>
<li><a href="http://legolandtimes.bravehost.com/aaa-news.html" >Latest Headlines</a></li>
<li><a href="http://legolandtimes.bravehost.com/aaa-news-shorts.html" >In Brief</a></li>
<li><a href="http://legolandtimes.bravehost.com/aaa-news-archive.html" >Archives</a></li>
</ul>
</li></ul>

<ul><li><a href="football.shtml">Sport</a>
<ul>
<li><a href="football.shtml">Football</a></li>
</ul>
</li></ul>


<ul><li><a href="#">Resources</a>
<ul>
<li><a href="http://legolandtimes.bravehost.com/aaa-tlt-about.html" >About</a></li>
<li><a href="http://legolandtimes.bravehost.com/aaa-tlt-contact.html" >Contact</a></li>
</ul>
</li></ul>

</div>

[/code]
Copy linkTweet thisAlerts:
@LEGO-MafiaauthorJan 28.2009 — It is irrelevant if it is .shtml or .txt for the included files. Using .inc as [B]Charles [/B]suggests is a common notation. Only the 'parent' document must conform to the correct file extension for your server, probably .shtml

It is better to split style, JavaScript and code into separate files.

The style in your menu.txt can not be within the <body>, place it in the css.txt or as menucss.text&lt;style type="text/css"&gt;
&lt;!--#include file="css.txt" --&gt;
&lt;!--#include file="menucss.txt" --&gt;
&lt;/style&gt;
Better still is to use external css documents&lt;link rel="stylesheet" type="text/css" href="menucss.css" title="menu"&gt;
[/QUOTE]


ok cool I will do it this way, makes sense. Thanks!
Copy linkTweet thisAlerts:
@CharlesJan 28.2009 — That's likely to cause troule. Remember, what matters is the resulting document and your resulting document has a STYLE element in the BODY. See http://validator.w3.org/check?verbose=1&uri=http&#37;3A%2F%2Fwww.minifigtimes.com%2F .

Either move the [font=monospace]</head><body>[/font] to your include file, just after the STYLE or remove them altogether. In HTML the HTML, HEAD and BODY start and end tags are all optional.

But it looks like you're heading down a fine path following Mr. Fang. I would, however, keep the STYLE and SCRIPT tags in the include file and not the parent. That way the type is defined in the same file as content. On principle this is easier to maintain. On the other hand, Mr. Fang's method gives you a nice external file that you can reference with the HTML.
Copy linkTweet thisAlerts:
@LEGO-MafiaauthorJan 28.2009 — Just one thing...

Earlier today I had about 4 errors coming up on my HTML using the validator after spending half a day reducing the number from 20 something.

Once I changed the DOCTYPE from TRANSITIONAL to STRICT I got 67 errors.

http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.minifigtimes.com%2F

now one of them is recurring alot, this:
[code=php]
Line 147, Column 3: document type does not allow element "BR" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag.

<br>

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").[/code]



can you just tell me if it is going to be alot of work to fix this?
Copy linkTweet thisAlerts:
@CharlesJan 28.2009 — HTML has essentially two kinds of elements, block and inline. Inline elements need to be contained by block elements.

However and in your case your HTML needs help across the board. You really shouldn't be using BR elements at all. Start by getting all of your paragraphs inside of P elements and then use CSS to adjust the margins on each.
Copy linkTweet thisAlerts:
@LEGO-MafiaauthorJan 29.2009 — ok thanks for the info.

So <br> is pretty much defunct?

If i am to make the traditional <br> effect using a P element what do I put between the brackets for these 2 effects (P.1-line-break I want to be like <br> and P.2-line-break I want to be like <br><br>)

CSS
[code=php]
P.1-line-break {

}

P.2-line-break {

}
[/code]


HTML
[code=php]
<P class="2-line-break">text</P>[/code]
Copy linkTweet thisAlerts:
@FangJan 29.2009 — Try:p.1-line-break {margin:1em 0;}

p.2-line-break {margin:2em 0;}
Copy linkTweet thisAlerts:
@LEGO-MafiaauthorJan 29.2009 — Based on the comment that <br> is not to be used, I wanted to replace this:

[code=php]<br>
<br>
<br>
<br>
<br>
<br>[/code]


with a P element:


[code=php]p.6-line-break {margin:6em 0;}[/code]

[code=php]<P class="6-line-break"></P> [/code]

Is this the wrong approach? I dont really see the logic
Copy linkTweet thisAlerts:
@FangJan 29.2009 — You may only want the margin above or below:

margin:0 0 6em 0; or margin-bottom:6em;

Which you use depends if you have reset the css.

http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/

http://developer.yahoo.com/yui/reset/
Copy linkTweet thisAlerts:
@LEGO-MafiaauthorJan 29.2009 — I want to insert 6 blank lines between my page's menu and start of content.

I have this:

CSS
[code=php]p.filler-menu-and-content {margin:0 0 6em 0;}[/code]


HTML
[code=php]<P class="filler-menu-and-content"> </P> [/code]

It only seems to work if I put some text between the <P> tags such as:

HTML
[code=php]<P class="filler-menu-and-content"> . </P> [/code]

Anyway to do it without having to put in text. I just want to emulate 6 consecutive <br> tags below my page's menu code (an insert) and above the start of my page's content.
Copy linkTweet thisAlerts:
@FangJan 29.2009 — Place it in an existing element, don't create an empty one for the purpose..filler-menu-and-content {margin:0 0 6em 0;}
&lt;div class="pd_menu_01 filler-menu-and-content"&gt;
You may have to add the class to a different element. I have not checked if the required result was achieved.
Copy linkTweet thisAlerts:
@LEGO-MafiaauthorJan 29.2009 — Thanks Fang. I get the idea with that now.

I've fixed 60 odd errors on my page but have 6 left.

Can anyone help with sorting these out?

[B]

http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.minifigtimes.com%2F[/B]
Copy linkTweet thisAlerts:
@FangJan 29.2009 — It should begin:&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;The Minifig Times for all your Lego News&lt;/title&gt;
&lt;link rel="shortcut icon" href="http://legolandtimes.bravehost.com/lego-icon.ico"&gt;
&lt;link rel="stylesheet" type="text/css" href="default.css"&gt;

and you have 2 closing style tags </style>
Copy linkTweet thisAlerts:
@LEGO-MafiaauthorJan 29.2009 — 
and you have 2 closing style tags </style>[/QUOTE]


Thanks. I could only find 1 closing style tag in my index.shtml page - is there a problem that my SSI insert file insert-menu.ins also had a <style> and </style> tag?

I removed the </style> tag that appears in my index.shtml so now the start of this file looks like:

[code=php]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>The Minifig Times for all your Lego News</title>
<link rel="shortcut icon" href="http://legolandtimes.bravehost.com/lego-icon.ico">
<link rel="stylesheet" type="text/css" href="default.css">



<style type="text/css"><!--#include file="insert-menu-css.ins"-->



<meta name="description" content="A Lego news blog providing an insight into the crazy world of deranged Legomen otherwise known as minifigs.">
<meta name="abstract" content="The Minifig Times provides Lego news from the town, city, castle, pirates, train, space, technic and western themes.">
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<meta name="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>[/code]


is this OK?
Copy linkTweet thisAlerts:
@FangJan 29.2009 — I would include both style tags in the parent document or in the included file; less confusing.
&lt;style type="text/css"&gt;&lt;!--#include file="insert-menu-css.ins"--&gt;
×

Success!

Help @LEGO-Mafia spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...