Paragraphs are only perfroming a single break

  • Thread starter Thread starter King Coffee
  • Start date Start date
K

King Coffee

Hi,

The paragraph tabs <p></p> are not working properly when displaying a page
via F5. I have several consecutive paragraphs blocks. When I view the page
via design window mode the paragraphs perform a double break as expected.
But when I press F5, the paragraphs only perform a single break. What's the
problem?


Thanks,
King

PS: I using VS 2008 Standard.
 
King Coffee said:
Hi,

The paragraph tabs <p></p> are not working properly when displaying a page
via F5. I have several consecutive paragraphs blocks. When I view the page
via design window mode the paragraphs perform a double break as expected.
But when I press F5, the paragraphs only perform a single break. What's
the problem?


Add a non breaking space in the paragraphs (&nbsp;).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

********************************************************
| Think outside the box! |
********************************************************
 
This is because of white space stripping which is done by all browsers. The
browser sees that you have nothing in the paragrap and so it does not treat
it as a paragraph. The simplest (and suggested) way to solve the problem is
to put a space in the paragraph, but again, browsers will strip that out, so
we put the code for a space (&nbsp;), which is case-sensitive in the
paragraph like this:

<p>&nbsp;</p>

That will do the trick.

-Scott
 
Actually, the paragraphs contain text. It just doesn't work in the browser.
It does work in the designer mode.

King
 
Your message does not show the code you are using, can you post that? The
only other thing that could cause this is Cascading Style Sheet rules that
are setting the line spacing and/or height of the paragraph.

Please post the whole page's code.

-Scott
 
Thanks, the problem is in the Cascading Style Sheet rules. I modified the
"p" tab to read:

p
{
font-size: 9pt;
font-family: Verdana;
margin: 0pt 5pt 0pt 5pt;
}

So, can I fix the problem by adding something like: display: block; ?

King
 
I see the problem now, the block attribute did not change... It's the margin
and padding attributes that control the spacing.
 
Yes, margins and padding control spaces. A paragraph is already a block
element, so adding display:block wouldn't affect it.

-Scott
 
Back
Top