473,748 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Closing paragraph tags being ingnored

KeredDrahcir
426 Contributor
I'm wondering if anyone can help me. I'm getting validation errors where I'm told I'm trying to open a div inside a paragrpah.
I'm closing the paragrpah before I open the div but for some reason the validator doesn't see the closing p tag ans when I view source, the browser doesn't see it.
It's quite definatly in the code.
Expand|Select|Wrap|Line Numbers
  1. <div class="my class">
  2.   <p style="text-align: center;">
  3.     <br />
  4.     <a href="javascript:void(0)" onclick = "my script">
  5.       <img width="225" height="228" src="my image" alt="" />
  6.     </a></p>
  7. <div style="position: fixed; top:50px; left: 25%;">My content</div></div>
That is my code but the closing p tag after the closing a tag goes missing. It does it more than once.
Feb 28 '12 #1
10 2046
drhowarddrfine
7,435 Recognized Expert Expert
Which browser? That should validate so it depends on what's going on before that.

I wouldn't be using XHTML self closing tags like <br /> or <img/> in HTML markup cause it's unnecessary and sometimes leads to problems.
Feb 28 '12 #2
KeredDrahcir
426 Contributor
I need to use the self-closing tags because I'm using XHTML. I know that the code should validate but the browser missed out the closing paragraph tag. I get it in Internet Explorer, Firefox, Safari, Google Chrome and Opera.

I did fix it using a division instead of a paragraph but I don't want to have to that every time and would like to know why it happens. Any other ideas?
Feb 29 '12 #3
drhowarddrfine
7,435 Recognized Expert Expert
the browser missed out the closing paragraph tag. I get it in Internet Explorer, Firefox, Safari, Google Chrome and Opera.
Sounds like you're contradicting yourself. I don't see the problem.
Feb 29 '12 #4
KeredDrahcir
426 Contributor
I meant I get the problem.

This is my code:
Expand|Select|Wrap|Line Numbers
  1.     <div class="my class">
  2.       <p style="text-align: center;">
  3.         <br />
  4.         <a href="javascript:void(0)" onclick = "my script">
  5.           <img width="225" height="228" src="my image" alt="" />
  6.         </a></p>
  7.     <div style="position: fixed; top:50px; left: 25%;">My content</div></div>
  8.  
This is what the browser shows:
Expand|Select|Wrap|Line Numbers
  1.     <div class="my class">
  2.       <p style="text-align: center;">
  3.         <br />
  4.         <a href="javascript:void(0)" onclick = "my script">
  5.           <img width="225" height="228" src="my image" alt="" />
  6.         </a>
  7.     <div style="position: fixed; top:50px; left: 25%;">My content</div></div>
  8.  
Notice the difference on the second to last line.
Feb 29 '12 #5
drhowarddrfine
7,435 Recognized Expert Expert
I just don't see that. Perhaps your script is doing something?
Feb 29 '12 #6
KeredDrahcir
426 Contributor
Do you notice that the closing paragrpah tag afer the closing anchor is missing in the second piece of code?
If you're asking if the onclick script is affect it, then I can be sure that it isn't all it does it changes the display values of two divisions.
Feb 29 '12 #7
drhowarddrfine
7,435 Recognized Expert Expert
Yes I saw that but I don't see the problem in any browsers myself.
Feb 29 '12 #8
KeredDrahcir
426 Contributor
So you have no idea what's causing it for me? Is that correct?
Feb 29 '12 #9
drhowarddrfine
7,435 Recognized Expert Expert
Yep .
Feb 29 '12 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3538
by: LPA | last post by:
Hi, I have a function to take the 300 first words of a db field. As this field contains HTML, if some tags are not closed (TABLE, TD, TR, SPAN, DIV, P, ....) the presentation is out. Is someone have a solution ? Thanx
3
3948
by: Jean-Fran?ois Lacrampe | last post by:
Hello, I want to write a _very_ simple text parser that would replace a string like: "This is text with /italics/, *bold* and _underline_." and generate automatically something like this: "This is text with <i>italics</i>, <b>bold</b> and <span
8
1535
by: Peter van Schie | last post by:
Hi all, Give an xml document that looks something like this: <?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet type="text/xsl" href="http://localhost/archiefassistent/xsl/fulldoc.xsl"?> <result> <currentpage>1</currentpage> <document id="5">
3
2727
by: Grant Harmeyer | last post by:
I have an XSL file that is being applied to an RSS feed, and it works great except for 2 things: 1.) XSL doesn't close the <img> tag for xhtml even though I have it being closed in the XSL file (I've tried <img /> and <img></img>). This blows my xhtml compatibility. 2.) Also, the RSS feed has a namespace "dc", how do I extract data from the elements have a dc namespace? I've tried: <div class="bodysm"><i><xsl:value-of...
20
4316
by: AndyZa | last post by:
Is the following html valid? <p><hr width="50%"></p> Or would the following be more "technically correct"? <p> <hr width="50%"> Do I require the closing </p> tag?
4
1481
by: Mark Rae | last post by:
Hi, Is there a way to prevent ASP.NET 2 from stripping off the self-closing meta tags...? E.g. <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1" /> is turned into
4
3787
by: basm101 | last post by:
Hello, I need to know how to create closing tag elements when using DOM to add in form elements to a page. Here is the code...the <div> I am adding to the page is called dropDownList (for legacy reasons...it isnt really a drop down list!). I need to put in closing td tags... I tried this: var tdClose = document.createElement(/td); and this:
1
1151
by: dhruvbaruah | last post by:
Hi I'm working on a classified website. The problem i'm facing is that in the Place an AD I have a section where you put the description of the product. The problem is even if the user puts paras the writeup does not take it. As an admin I have to put the <br> tags in the write-ups. How do I change the script so that it automatically take the paras.
1
1402
by: Hvid Hat | last post by:
I'm using <xsl:copy-of select="content" /on the following XML: <?xml version="1.0"?> <content> <p></p> <p>This is a paragraph</p> <p></p> <p>This is another paragraph</p> </content>
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.