473,699 Members | 2,679 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 2041
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
3536
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
3942
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
1532
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
2725
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
4310
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
1477
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
3785
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
1149
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
1398
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
8704
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...
0
9054
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8895
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
7778
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...
1
6545
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3071
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
2362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2015
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.