|
 |
|
Codewalkers Forums
> PHP Related
> PHP Coding
|
W3 Validation Errors
Discuss W3 Validation Errors in the PHP Coding forum on Codewalkers. W3 Validation Errors Having problems with a PHP script you are coding? This is the place to get help!
|
|
|
|
 |
|
|
|
|

Codewalkers Forums Sponsor:
|
|
|

December 12th, 2012, 04:49 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 9
Time spent in forums: 1 h 36 m 49 sec
Reputation Power: 0
|
|
|
W3 Validation Errors
Really need some help from an expert.
My site estateagentslondon co.uk failed the html validation test at validator . w3 . org /
I placed the clean code into the site and tested and all errors were gone but you cant click the three boxes anymore, links somehow disabled.
Also, the h1 heading goes even smaller with the new code. I always though the heading should be large, so need help with that too.
The old code is in place right now.
Please if anyone can help, then thanks.
|

December 12th, 2012, 05:53 AM
|
 |
Contributing User
|
|
Join Date: Apr 2007
Location: Galway
Posts: 1,362

Time spent in forums: 4 Weeks 1 Day 23 h 41 m 31 sec
Reputation Power: 8
|
|
You have divs and p's inside hyperlinks. They are block elements, you cant do that
If you want the hyperlinks to look different use style or class.
__________________
When I die, I want to go peacefully like my Grandfather did, in his sleep -- not screaming, like the passengers in his car.
|

December 12th, 2012, 05:56 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 9
Time spent in forums: 1 h 36 m 49 sec
Reputation Power: 0
|
|
|
Hi,
Thanks for the replies, but I do not know anything about code and do not know how to fix this issue.
I cant understand why I can't click the boxes anymore or why the h1 heading has gone smaller.
|

December 12th, 2012, 05:58 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 9
Time spent in forums: 1 h 36 m 49 sec
Reputation Power: 0
|
|
|
Line 47, Column 42: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag
<div class="red-box">
✉
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>").
Line 55, Column 44: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag
<div class="green-box">
✉
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>").
Line 63, Column 43: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag
<div class="blue-box">
✉
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>").
|

December 12th, 2012, 06:00 AM
|
 |
Contributing User
|
|
Join Date: Apr 2007
Location: Galway
Posts: 1,362

Time spent in forums: 4 Weeks 1 Day 23 h 41 m 31 sec
Reputation Power: 8
|
|
is the current code at http://www.estateagentslondon.co.uk/ working?
Also the errors you posted are because of what i said before, remove divs and p's from between a's
WRONG
Code:
<a href="sdfsdfds">
<div>
sdfsdfs
</div>
</a>
RIGHT
Code:
<a style="font-size:16px;color:#ff00ff;" href="dfsdf">link</a>
|

December 12th, 2012, 06:03 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 9
Time spent in forums: 1 h 36 m 49 sec
Reputation Power: 0
|
|
The current code is the old code and has three errors.
Everything works though. It just doesn't pass the validation.
I installed the clean code and then removed it because I could no longer click the boxes!
edit, will try what you have suggested 
|

December 12th, 2012, 06:04 AM
|
 |
Contributing User
|
|
Join Date: Apr 2007
Location: Galway
Posts: 1,362

Time spent in forums: 4 Weeks 1 Day 23 h 41 m 31 sec
Reputation Power: 8
|
|
|
provide a link to the broken code, preferably somewhere where we can view the source online.
|

December 12th, 2012, 06:08 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 9
Time spent in forums: 1 h 36 m 49 sec
Reputation Power: 0
|
|
|
I cant post here as it wont let me post links.
Where can I post it?
If you go to www. validator . w3 . org
Type in my url.
Click check and then check again with 'Clean up Markup with HTML-Tidy' box ticked it will give you code that is clean BUT the boxes don't click like they do now!
Also, the h1 heading will go smaller!
|

December 12th, 2012, 06:18 AM
|
 |
Contributing User
|
|
Join Date: Apr 2007
Location: Galway
Posts: 1,362

Time spent in forums: 4 Weeks 1 Day 23 h 41 m 31 sec
Reputation Power: 8
|
|
|
if you want the divs to be clickable, you need to set an onclick event on them.
<div onclick="alert('you clicked me');">sdfsdf</div>
the HI can be styled using
<h1 style="font-size:60px;"></h1>
|

December 12th, 2012, 06:19 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 9
Time spent in forums: 1 h 36 m 49 sec
Reputation Power: 0
|
|
|
this is the clean code but the boxes do not click to their destination!!
<div class="inner clearfix">
<div class="main-box"><a href="replacedbecauseIcannotpostlinks"></a>
<div class="red-box">
<h2>Estate Agent Reviews</h2>
<p>Reviews from landlord and tenants on estate agents around London</p>
</div>
</div>
<div class="main-box"><a href="replacedbecauseIcannotpostlinks"></a>
<div class="green-box">
<h2>Letting Agent Reviews</h2>
<p>Reviews from landlords and tenants on letting agents around London</p>
</div>
</div>
<div class="main-box main-box-last"><a href="replacedbecauseIcannotpostlinks"></a>
<div class="blue-box">
<h2>Property Certificates</h2>
<p>Reviews of Gas, Electrical, EPC and Inventory Report suppliers</p>
</div>
</div>
<div class="clr"></div>
</div>
</div>
<div class="clearfix" id="bottom_in">
|

December 12th, 2012, 06:20 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 9
Time spent in forums: 1 h 36 m 49 sec
Reputation Power: 0
|
|
thank you, will check now 
|

December 12th, 2012, 06:33 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 9
Time spent in forums: 1 h 36 m 49 sec
Reputation Power: 0
|
|
sorry im unclear on how to make the divs clickable:
how do I add this:
<div onclick="alert('you clicked me');">sdfsdf</div>
to that:
<div class="main-box"><a href="www. my site .com"></a>
<div class="red-box">
the logo clicks to the right location so it's strange
thank you again
|

December 12th, 2012, 06:59 AM
|
 |
Contributing User
|
|
Join Date: Apr 2007
Location: Galway
Posts: 1,362

Time spent in forums: 4 Weeks 1 Day 23 h 41 m 31 sec
Reputation Power: 8
|
|
|
you have no text in your <a> tag
This is not a php problem btw.
div class="main-box" onclick="location.href='www.meh.com';">
|

December 12th, 2012, 07:05 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 9
Time spent in forums: 1 h 36 m 49 sec
Reputation Power: 0
|
|
|
I replaced that, most likely in a wrong way, but it didn't work.
Thank you so much for trying but I will pay someone to fix it.
Have a nice day.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|