Paragraphs are only perfroming a single break

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.
 
C

Cowboy \(Gregory A. Beamer\)

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! |
********************************************************
 
S

Scott M.

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
 
K

King Coffee

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

King
 
S

Scott M.

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
 
K

King Coffee

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
 
K

King Coffee

I see the problem now, the block attribute did not change... It's the margin
and padding attributes that control the spacing.
 
S

Scott M.

Yes, margins and padding control spaces. A paragraph is already a block
element, so adding display:block wouldn't affect it.

-Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top