472,119 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

How to remove page break?

Hello,

I have the following fragment in my html document:

<h2>Text 1</h2>
<small>Text 2</small>

If I see this fragment with browser I see empty line between text1 and
text2. Do you know how one can remove it?

Jul 24 '05 #1
9 11779
In our last episode,
<11*********************@g49g2000cwa.googlegroups. com>,
the lovely and talented op*********@yahoo.com
broadcast on comp.infosystems.www.authoring.html:
Hello, I have the following fragment in my html document: <h2>Text 1</h2>
<small>Text 2</small> If I see this fragment with browser I see empty line between text1 and
text2. Do you know how one can remove it?


You don't have an html document. There is no element SMALL in
html.

You have a line break after Text 1 because H2 is a block
element. Browsers are supposed to ignore tags they do not
understand, so this would look like a block element followed by
raw text to most of them.

--
Lars Eighner ei*****@io.com http://www.larseighner.com/
War on Terrorism: Bad News from the Sanity Front
"In this autumn of anger, even a liberal can find his thoughts turning to ...
torture." --Jonathan Alter,_Newsweek_
Jul 24 '05 #2
Lars Eighner wrote:
There is no element SMALL in html.


http://www.w3.org/TR/html4/present/g....html#h-15.2.1
Jul 24 '05 #3
op*********@yahoo.com wrote:
I have the following fragment in my html document: <h2>Text 1</h2>
<small>Text 2</small>
Its generally a poor idea to have inline elements outside a suitable block.
Perhaps the second line should be marked up as a paragraph? Or maybe a
generic block (div)?
If I see this fragment with browser I see empty line between text1 and
text2. Do you know how one can remove it?


That isn't a page break (as your subject suggests). A page break is a point
where when displayed on paged media (such as a hardcopy print out to sheets
of A4) one page ends and the next begins.

This would appear to be the default margin that comes after headings. You
can alter that with the CSS margin-bottom property.

http://css.nu/pointers/index.html#Tutorials might be of help if that means
little to you.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 24 '05 #4
Ok. It was my mistake. <small> is not an html tag. However it works,
i.e. if I put this tag into <h2></h2> tags (<h2> Text 1 <br> <small>
Text 2 </small></h2>) I get what I want. Text2 is smaller than Text1
and distance between lines is smaller than in example what I put above.
What I do not like in this solution is that I use the unknown tag (I
though that it have been defined in css but it is not the case). Do you
know how the same result can be reached with the usage of html tags?

Jul 24 '05 #5
Els
op*********@yahoo.com wrote:
Ok. It was my mistake. <small> is not an html tag. However it works,


http://www.w3.org/TR/html401/present...tml#edef-SMALL

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Don McLean - Vincent
Jul 24 '05 #6
op*********@yahoo.com wrote:
Ok. It was my mistake. <small> is not an html tag. However it works,
i.e. if I put this tag into <h2></h2> tags (<h2> Text 1 <br> <small>
Text 2 </small></h2>) I get what I want. Text2 is smaller than Text1
and distance between lines is smaller than in example what I put above.
What I do not like in this solution is that I use the unknown tag (I
though that it have been defined in css but it is not the case). Do you
know how the same result can be reached with the usage of html tags?


The best way is to use CSS's page break before pseudo element. For example:

h2.sect2 {
font-family: Arial,Palatino,sans-serif;
font-size: 1.2em;
text-align: center;
page-break-before: always;
}

Jim
Jul 24 '05 #7
Jim Jaworski wrote:
The best way is to use CSS's page break before pseudo element.


page-break-before is a property, not a pseudo element.

Pseudo-elements in CSS 2.1 are :first-line, :first-letter, :before
and :after

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 24 '05 #8
Thank you,

It works. It also works with forms:
form {
margin-bottom:0mm;
}

However, it does not work with textarea:
textarea {
margin-bottom:0mm;
}

Anybody know why?

Jul 24 '05 #9
op*********@yahoo.com wrote:

It works.
form {
margin-bottom:0mm;
}

However, it does not work with textarea:
textarea {
margin-bottom:0mm;
}


textarea is an inline element, so margins don't apply.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 24 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Roland Dalmulder | last post: by
3 posts views Thread by Vivek Mehta | last post: by
1 post views Thread by Scanner2001 | last post: by
3 posts views Thread by opt_inf_env | last post: by
7 posts views Thread by =?Utf-8?B?aXdlYg==?= | last post: by
11 posts views Thread by Richard Maher | last post: by

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.