Solved

Html - invisible <br style><p></p> showing up in chrome debug

Posted on 2010-09-20
13
249 Views
Last Modified: 2012-08-13
Hi, if you visit this link:  http://marckandalaft.com/index.php?k=MK

there is a bit wider of a gap between the submenu and the content section than i want.  You will notice the wider gap if you compare it to any other section in the site.

If you analyze the page in google chrome developer - and click into the div's -to highlight them - you will find that the gap is caused by the lines <br style><p></p>.  The problem is that those lines do not exist in the source code - look at the source!  I did a search for <br style> in the .php file and nothing.  

where the heck are those lines coming from?

thanks
0
Comment
Question by:nbj622
  • 7
  • 6
13 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 33721363
Your javascript is adding "<br>  <p></p>" between "<!-- START MK SECTION -->" and '<table width="100%">'.  If you have Firefox Web Developer, use "View Generated Source" to see it.
<!-- START MK SECTION -->	                
  
        
       		<br>
                            
		                    <p></p><table width="100%">

Open in new window

0
 

Author Comment

by:nbj622
ID: 33721402
i just deleted the block of javascript and all the whitespace right after<!-- START MK SECTION --!> between <table...> -   the problem is still there wtf?!
0
 

Author Comment

by:nbj622
ID: 33721445
this is the snippet from the php file - notice nothing comes after <!-- START MK SECTION -->

---------------------------

<!-- END PHOTOGRAPHY SECTION -->      

<?php }else{ ?>



                                                <!-- START MK SECTION --><table width="100%">
                            <tr>
                       
                       


0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 33721461
Right under "Maria Lund" you have a broken <div , no '>'.
<!-- Maria Lund -->	                

 <div class="block2"

Open in new window

0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 33721489
I know you won't find anything in the PHP file.  It is being done by one of the javascripts on the page.  That's why you see it in the 'DOM' view and not the source.  I just can't tell which one it is yet.
0
 

Author Comment

by:nbj622
ID: 33721510
thx for the broken div info - fixed.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 33721522
You have "<div id="publications">" in more than one place.  'id' should be unique.  'class' can be repeated.  In addition, there is "<p></p>" in the DOM source before "<div id="publications">" when in the original source it is "</p><p>".  Some javascript is rearranging things I think.
0
 

Author Comment

by:nbj622
ID: 33721685
i fixed all of the publications and <p> and <b> tags within.  the client made a mistake there.  the problem still persists. :(
0
 

Author Comment

by:nbj622
ID: 33721699
im running the validator on it now, i need to clean it up
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 33722820
I had to go to work this evening.  Looks like you have the original problem cleared up but the publications and <p> tags still act different between the original source and the DOM source.  I'll check in in the morning.
0
 

Author Comment

by:nbj622
ID: 33725455
through validating i found the sneaky <br/> - it was hidden between td's right after <!--- Publications Start --> .  the DOM must have slid it back towards the START MK, making it tricky to find using the developer tools. my client introduced a bunch of errors into the file - i should have gone to the validator first.  hey dave thanks for the help and ill award you the points cuz your publications tip was just about right.
0
 

Author Closing Comment

by:nbj622
ID: 33725467
not an exact answer.  very close though.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 33727154
Thanks, glad I could help.  That would make it hard to find.  I've had those where I accidentally put something in between tags in a table.  It always moves it to just before the table in the DOM.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now