HighDots Forums  

orphans / widows

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss orphans / widows in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
m@mdessen.com
 
Posts: n/a

Default orphans / widows - 08-23-2007 , 07:17 PM






Hello,

I have been trying to use orphan and widow control to prevent page
breaks immediately after h1 elements (on a CV). I have validated the
css and html, and used the following hoping this would work:

h1 {
orphans: 4;
widows: 1;
}

Because it's a resume, all the h1 elements are one line only, so I
assumed this would prevent any h1's from appearing as the last thing
on a page, with nothing following it below.

I was hoping this would work in Opera so I could print from that
browser, because it supposedly supports this feature. But it doesn't
seem to work. When I try to print from Opera, there is an h1 on the
third page that is at the very bottom, with nothing beneath it

The page is here: http://www.mdessen.com/mdcv.html

If anyone were to take the time to figure out what is wrong here, I
offer many kind thanks in advance.

michael dessen


Reply With Quote
  #2  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: orphans / widows - 08-23-2007 , 07:31 PM






m (AT) mdessen (DOT) com wrote:
Quote:
Hello,

I have been trying to use orphan and widow control to prevent page
breaks immediately after h1 elements (on a CV). I have validated the
css and html, and used the following hoping this would work:

h1 {
orphans: 4;
widows: 1;
}

Because it's a resume, all the h1 elements are one line only, so I
assumed this would prevent any h1's from appearing as the last thing
on a page, with nothing following it below.
How many level one heading do you have on a document? Should be only
one. Also I don't think you know what this property does. It does not
prevent page breaks before or after the specified block element bit
*within*. Usually applied to a paragraph not a heading. Not too many
headings a long enough for multiple lines, I think the properties that
you are looking for is page-break-before and page-break-after


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #3  
Old   
m@mdessen.com
 
Posts: n/a

Default Re: orphans / widows - 08-23-2007 , 09:15 PM



Thank you for the help!!
I will change it to h2 so as to use the header tags properly.
And I see now what you are saying about within the block element,
which explains my problem.
But now I am wondering if there is a way to achieve the effect I
originally intended, which is to not have a header element (section
title) sitting at the bottom of a printed page without anything
following it. I don't want to put a page break before every section
header since that would just break up the document into way too many
pages with tons of wasted space. Is there any way to prevent a browser
(when printing) from placing a particular element just before a page
break, aside from manually forcing particular page breaks?
Thanks again for any help anyone can offer.

michael dessen


Reply With Quote
  #4  
Old   
m@mdessen.com
 
Posts: n/a

Default Re: orphans / widows - 08-23-2007 , 09:50 PM



I just re-read the page-break specs and now see what you mean. THANK
YOU for the help!

michael dessen


Reply With Quote
  #5  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: orphans / widows - 08-24-2007 , 05:03 AM



Scripsit m (AT) mdessen (DOT) com:

Quote:
I just re-read the page-break specs and now see what you mean.
Unfortunately, that's not the end of the story.

Although page-break-after: always and page-break-before: before are
well-supported, the same does not apply to settings that _prevent_ page
breaks or, to put it better, suggest that a page break should _not_ occur.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #6  
Old   
Lauri Raittila
 
Posts: n/a

Default Re: orphans / widows - 08-24-2007 , 05:38 AM



in comp.infosystems.www.authoring.stylesheets, Jukka K. Korpela wrote:
Quote:
Scripsit m (AT) mdessen (DOT) com:

I just re-read the page-break specs and now see what you mean.

Unfortunately, that's not the end of the story.

Although page-break-after: always and page-break-before: before are
well-supported, the same does not apply to settings that _prevent_ page
breaks or, to put it better, suggest that a page break should _not_ occur.
Actually, page-break-before: avoid is often more likely cause page-break
than prevent it on some browser I tested about 2-3 years ago.

--
Lauri Raittila <http://www.iki.fi/lr>


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.