I’m bug fixing on a site that has div’s nested within paragraph tags which don’t comply to xhtml validation. I want to create new classes that match what a P tag does. Does anyone know what properties the ‘P’ tag has? i.e. padding:5px?
@CentauriJul 07.2008 — #What a <p> tag "does" is denotes a paragraph of text. How it is normally rendered is up to the browser, but typically it is rendered as a block element with top and bottom margins, which as Fang has suggested, varies between browsers.
@felgallJul 08.2008 — #The needed fix is to get rid of the div tag (unless the "paragraphs" are not really paragraphs and that tag has been misused). Anything inside a paragraph needs to be inline within the paragraph and a div tag can't be inline (unless you are overriding it in the stylesheet to make it identical to a span tag).
@Declan1991Jul 08.2008 — #If i read it correctly, i think he is trying to fix that problem. ?[/QUOTE] I was trying to find out which was incorrect, the p or the div. Depending on that, the solution is totally different.
@sollyauthorJul 08.2008 — #Hi guys, thanks for the replies, it's much appreciated.
I'm bug fixing for British Airways and some of the development is slightly unorthodox hence the div inside the p tag. I've managed to sort it out anyway, I just added padding at 10px 10px 0px and it looks exactly the same in IE and FF.
@felgallJul 08.2008 — #Adding padding doesn't sound like a valid fix for having a div inside a p where it isn't allowed. You either have to change the div to a span or change the p to a div.
@sollyauthorJul 10.2008 — #I've changed the P to a class in my .css and the <p> to <div class="paraFix"> and it's working fine now, thanks for the brainstorm fellas.
@felgallJul 10.2008 — #A more meaningful name for the class would make it easier to maintain in the future. The <p> should never have been there in the first place since it isn't a paragraph and so the class name paraFix is somewhat misleading.