[QUOTE=michaelk;6398715]
Quote:
width: 210mm;
height: 297mm;[/code]
As posted your css code needs to be within style tags similarly to the posted examples. For the entire page not just a table I believe the following should work.
Code:
<style>
html, body {
width: 210mm;
height: 297mm;
}
</style>
|
Thank you, your idea works very well as it makes the text automatically wrap. Now I can start with an html file that doesn't
look so dumb - it looks more like a book or article should. Below is the code so far and I've also shown you a snippet that
represents the actual beginning of the file I want to put your idea into. Where do I put the code in that file which references
some style sheets but otherwise is just an XHTML file. Are they different (XHTMLs?)?
[code]
<!DOCTYPE html>
<html>
<style>
html, body {
width: 210mm;
height: 297mm;
}
</style>
<h1>This div element has a height of 100px and a width of 500px. These words word-wrap in the element nicely.</h1>
</html>
Output in browser:
This div element has a height of 100px and a
width of 500px. These words word-wrap in the
element nicely.
Now, when I put it into my xhtml document, do I simply put the style right after the html tag - I'm not sure where
to put your code as I tried it once and I had troubles - not sure why?
Here's the beginning of the actual file I will apply your changes to:
<!--?xml version="1.0" encoding="iso-8859-1" ?-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>The Title</title>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="generator" content="TeX4ht (https://tug.org/tex4ht/)">
<meta name="originator" content="TeX4ht (https://tug.org/tex4ht/)">
<!-- xhtml,mathml,html -->
<meta name="src" content="TheTexFile.tex">
<link rel="stylesheet" type="text/css" href="TheTitle.css">
</head>
<body>
<div class="maketitle">
<h2 class="titleHead">The Title As Heading</h2>
<div class="author"><span class="cmr-12">The Author,
United States</span><span class="cmr-12"> </span><br
class="and">
<span class="cmr-12">The Other Author</span></div>
<div class="date"><span class="cmr-12">February 24, 2019</span></div>
</div>
I would venture a guess that I can simply replace the </body /body> section with your code with the word style.
This below code preamble works beautifully, the output of the file is gorgeously book-afied now. Thank you so much!
I am not giving you the actual file just a proxy of what it was - in the actual file, the text lines are hundreds of characters
long and wrap beautifully now. Wow! It really works to add only one tiny piece of code and I can leave the body closing
brace untouched. Beautiful, you can claim the solution if you want to.
<!--?xml version="1.0" encoding="iso-8859-1" ?-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>The Title</title>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="generator" content="TeX4ht (https://tug.org/tex4ht/)">
<meta name="originator" content="TeX4ht (https://tug.org/tex4ht/)">
<!-- xhtml,mathml,html -->
<meta name="src" content="TheTitleFile.tex">
<link rel="stylesheet" type="text/css" href="TheTitle.css">
</head>
<style>
html, body {
width: 210mm;
height: 297mm;
</style>
It's a shame, because of copyrighting, I cannot show you the actual file, but you just have to imagine a document with many paragraphs
all laid out in the html file as long lines of text that are now transmogrified by your A4 code into being many shorter lines rather
than a few longer lines which looked incredibly dumb. It looks great now. So you've proven that an html file CAN look like a book
or article. It really looks very nice now. The other posters who are supposedly gurus or whatever don't have any idea, that's all.
And this means that I don't have to do something weird just because it's an xhtml file rather than a simple html file - it's still
behaving like an html file as far as the programming language (the layout language) goes. I don't know html very well yet.