Empty paragraph tag

Given the below:

<html>
<head>
</head>
<body>

<div id=blah style="width:500px; height:500px;border:1px solid;">
      <p/>
      <p/>
      <p>HERE</p>
      <p>some more space</p>
</div>
</body>
</html>

How can i guarantee there will be line space even for empty P tags ?  At the moment "HERE" is displayed at the very top of the page.

Thanks
LVL 9
Type25Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hongjunCommented:
use &nbsp; for empty space
0
Type25Author Commented:
I can't do that, it MUST be through CSS as the output of the html is out of my control

0
gruntarCommented:
In HTML empty paragraph should be written like this

<p>&nbsp;</p>

Cheers
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

gruntarCommented:
You coulkd use <br /> instead paragraphs.
0
DiggaCommented:
Maybe an opening and closing p tag rather than 2 closing tags and no opening:

     <p/>
     <p/>
     <p>HERE</p>
     <p>some more space</p>

0
seanpowellCommented:
Depends on the specific scenario, but this is the easiest way:

p { padding-top:20px; }

Sean
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
COBOLdinosaurCommented:
I believe if you refer to the specifications you will find that an empty paragraph may be treated as null node.  In other words the browser is permitted to ignore it, as is the case for most empty containers.  You cannot rely on an empty paragraph to render consistently, and I think even adding padding will not change that. If the browser is actually ignoring a container that does not contain any nodes.  So if you choose to use an illogical structure instead of the br tag that is in tended for the purpose I gues you just gambol that all your users will have browser that render the way you think it should.

Cd&
0
DiggaCommented:
Good point.
0
GrandSchtroumpfCommented:
> the output of the html is out of my control
then you should complain about the person (or product) responsible for the bad html.
what are those closing p tags that are not open in the first place???
0
Type25Author Commented:
www.htmlarea.com  is the culprit.

it's a richtext control written in javascript.  This is one of many annoying issues with it. I would substitue all the P tags for <br> but that screws over the bulleted lists.

0
GrandSchtroumpfCommented:
> www.htmlarea.com 
i use that too and it seems to work fine for me.
if you manipulate the generated code, you should always make sure your html is well formed.
if you have php, you can use tidy:  http://www.php.net/tidy
tidy is quite magical, you just give it some buggy html code and it knows how to fix it.
0
Type25Author Commented:
I'm using the RC1 version, the previous version does work you're right, but something changed in the latest version.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.