View Full Version : Please help me correct the HTML errors...

06-26-2010, 10:32 PM

This is the URL (http://validator.w3.org/check?verbose=1&uri=http://www.przepiekna.pl/)

I think most of the errors are in the header... this is the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title><?php if (is_home () ) { bloginfo('name'); } elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo('name'); }
elseif (is_single() ) { single_post_title(); }
elseif (is_page() ) { bloginfo('name'); echo ': '; single_post_title(); }
else { wp_title('',true); } ?></title>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/script.js"></script>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie6.css" type="text/css" media="screen" /><![endif]-->
<if condition="is_browser('ie', '8')"><meta http-equiv="X-UA-Compatible" content="IE=8" /></if>
<link rel="alternate" type="application/rss+xml" title="<?php printf(__('%s RSS Feed', 'kubrick'), get_bloginfo('name')); ?>" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php printf(__('%s Atom Feed', 'kubrick'), get_bloginfo('name')); ?>" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<script type="text/javascript" src="swfobject/swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myFlashContent", "9.0.0");

<?php wp_get_archives('type=monthly&format=link'); ?>
<?php wp_head(); ?>

<!-- ADDED BY ME -->
<div id="floatingimage">
<a href="http://wizazforum.pl"><img src="http://wizazforum.pl/images/statusicon/forum_new-48.png" alt="Angry face" /></a>


<!-- ADDED BY ME-->
<script type="text/javascript" src="http://www.przepiekna.pl/wp-content/plugins/page-peel/pagepeel-js.php"> </script>

<div class="PageBackgroundGradient"></div>
<div class="Main"><div class="Sheet"><div class="Sheet-tl"></div><div class="Sheet-tr"><div></div></div><div class="Sheet-bl"><div></div></div><div class="Sheet-br"><div></div></div><div class="Sheet-tc"><div></div></div><div class="Sheet-bc"><div></div></div><div class="Sheet-cl"><div></div></div><div class="Sheet-cr"><div></div></div><div class="Sheet-cc"></div><div class="Sheet-body">
<div class="nav">
<ul class="artmenu">

<?php art_menu_items(); ?>

<!-- ADDED BY ME-->
<li><a class="active" href="http://www.wizazforum.pl"><span><span>Wizaz forum</span></span></a> <li />

<div class="l"></div><div class="r"><div></div></div></div>
<div class="Header">

<div class="Header-jpeg">


<!--[if lte IE 6]>
<img src="http://www.przepiekna.pl/wp-content/themes/wp_005/images/Header.jpg" style="height:125px;left:0;Position:absolute;top:0;width:998px;" />

<br />
<div style="float:left;">
<div class="logo">

<!--[if IE 7]>
<h1 id="name-text" class="logo-name">
<a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div id="slogan-text" class="logo-text">
<?php bloginfo('description'); ?></div>


<div style="float:left;margin:40px 10px 0 500px;height:70px;">
<?php echo stripslashes(get_option('wps_home_ad_468')); ?>

Please help

06-26-2010, 10:43 PM
Umm okay wow...this is wrong

<if condition="is_browser('ie', '8')"></if>

There is no such thing as that. If you look at the other conditional comments you will see that it should be this

<!--[if IE 8]><meta http-equiv="X-UA-Compatible" content="IE=8" /><![endif]-->
This is wrong too. You are making very simple mistakes.

<!-- ADDED BY ME-->
<li><a class="active" href="http://www.wizazforum.pl"><span><span>Wizaz forum</span></span></a> <li />
It should be

<!-- ADDED BY ME-->
<li><a class="active" href="http://www.wizazforum.pl"><span><span>Wizaz forum</span></span></a> </li>
This is wrong too

<![if !IE]>
<div style="position:absolute; right: 80px">
Remove that, give that div and ID an use an IE conditional comment. You can also only have one style attribute per element.

06-26-2010, 11:04 PM
Wonderful help!! Thank you!

BTW why this is wrong?

<![if !IE]>
<div style="position:absolute; right: 80px">

IE reads this code well and I tested it and it works...
How can I make it work? Can I have an example?

Thank you

06-26-2010, 11:36 PM
I was also thinking... if

<![if !IE]>
<div style="position:absolute; right: 80px">

is the same as

<!--[if !IE]><!-->
<div style="position:absolute; right: 80px">

Than I can use the second one... but not sure about the differences...

06-27-2010, 12:00 AM
The first one is how MS says to use a down-level revealed comment but its invalid. The second one is a valid down-level revealed conditional comment so use the second one. As long as you make sure you close that div that you opened then okay but the better thing to do would be to give that div an id and apply different styles to it based off of an IE conditional comment wrapped around a stylesheet that only IE sees. All elements in XHTML need to be lowercase so things like SCRIPT need to become script. Every element must be closed. If the element has no closing element like <br> then you use <br /> instead, same goes for image elements.

06-27-2010, 12:21 AM
Thank you. Please tell me if the following would be correct:

I create a file called ie.css

I add the following on the header:
<!--[if !IE]><!--><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie.css" type="text/css" media="screen" /><!--<![endif]-->

In the ie.css I put the following code:

right: 80px;

In the php file I put the following code

<div id="onlyie">

Please tell me:

is that right what I wrote?
Will this <div> be read by IE only?

06-27-2010, 12:30 AM
Okay you may have been confused on what the down-level revealed comments do. They were meant to hide things from IE, not show them so change this

<!--[if !IE]><!--><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie.css" type="text/css" media="screen" /><!--<![endif]-->
to this

<!--[if IE]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie.css" type="text/css" media="screen" /><![endif]-->
Only IE will see that stylesheet. That div now will have no styling to any browser but IE so the position:absolute; and right:80px will be applied to div in IE only.

06-27-2010, 11:37 AM
moment moment...

<!--[if !IE]><!-->
<div style="position:absolute; right: 80px">

Isn't this a negation meaning: This kind of DIV needs to be used for all the NON Internet Explorer browsers? Eg. FF, Chrome...?

If I put this:

<!--[if IE]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie.css" type="text/css" media="screen" /><![endif]-->

it won't have the same meaning as the

<!--[if !IE]><!-->
<div style="position:absolute; right: 80px">

06-28-2010, 12:12 AM
Right. The first one will be for all browsers except IE. The second one will be for ONLY IE browsers.