View Full Version : Multiple Div Tags in Fixed Layout Epub


verydeepwater
01-23-2013, 07:15 AM
I seem to have trouble when I include multiple div tags on one page of a fixed layout epub. I am using a div class to select and format all the items on one page, and then other div tags to format particular sections of that page. Often things seem to break down with the third div tag. Is there some rule about using classes or IDs to distinguish different divs inside another div?

mzmm
01-23-2013, 02:19 PM
as long as your html/css is in order you shouldn't have any problems with the number of elements on a page. if you can post your code without violating copyright you'd have a better chance of someone being able to help you diagnose the problem, though.

verydeepwater
01-24-2013, 06:18 AM
If I use the third div tag the page does not format as wanted. The caption appears at the top of the page instead of lower down and I can't control the large para of text in the middle of the page. If instead of using the third dive tag, I use the html 5 tag - article - for the large para - everything appears as wanted. Any help would be greatly appreciated.

Here is the code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta name="viewport" content="width=857,height=1241"></meta>
<meta content="text/html; charset=UTF-8"></meta>
<title>PlaceholderText</title>
<link href="css/styles.css" type="text/css" rel="stylesheet"></link>
</head>

<body>
<div class="page01">
<img src='images/page01.jpg' alt='water-balanced clift lift'/>
<h1>PlaceholderText</h1>

<div class="left">
<p>Lorem Ipsu</p>
<p>Lorem Ipsu</p>
<p>Lorem Ipsu</p>
<p>Lorem Ipsu</p>
<p> Lorem Ipsu</p>
<p>Lorem Ipsu</p>
</div>

<div class="right">
<p>Lorem Ipsum</p>
<p><span class="redcolour"> 1bbbbbb</span> <span class="bluecolour">(Lorem Ipsum</span></p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p>
<p>Lorem Ipsu Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the </p>
</div>

<div class="article">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem IpsumLorem Ipsum is simply dummy </div>

<p id="caption"> Lorem Ipsum is simply dummy text of the printing</p>

</div>
</body>

</html>

Here is the CSS
}
.page01 .left {
position: absolute;
top: 105px;
left: 65px;
height: auto;
width: 110px;
height: auto;
}
.page01 .left p {
color: #1d57eb;
font-size: 16px;
font-weight: bold;
line-height: 19px;
font-style: normal;
text-align: right;
margin-bottom: -10px;
}
.page01 .right {
position: absolute;
top: 105px;
left: 190px;
height: auto;
width: 597px;
}
.page01 .right p {
font-size: 16px;
font-weight:normal;
line-height: 19px;
font-style: normal;
text-align: left;
margin-bottom: -10px;
}
.page01 .article {
position: absolute;
top: 420px;
left: 90px;
width: 708px;
}
.page01 .article p {
font-size:18px;
font-weight: normal;
height: auto;
line-height: 28px;
font-style: italic;
}
.page01 #caption {
position: absolute;
top: 620px;
left: 470px;
width: 360px;
color: #000000;
font-size: 16px;
font-weight: normal;
height: auto;
line-height: 28px;
font-style: italic;
}

verydeepwater
01-24-2013, 06:19 AM
If I use the third div tag the page does not format as wanted. The caption appears at the top of the page instead of lower down and I can't control the large para of text in the middle of the page. If instead of using the third dive tag, I use the html 5 tag - article - for the large para - everything appears as wanted. Any help would be greatly appreciated.

Here is the code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta name="viewport" content="width=857,height=1241"></meta>
<meta content="text/html; charset=UTF-8"></meta>
<title>PlaceholderText</title>
<link href="css/styles.css" type="text/css" rel="stylesheet"></link>
</head>

<body>
<div class="page01">
<img src='images/page01.jpg' alt='water-balanced clift lift'/>
<h1>PlaceholderText</h1>

<div class="left">
<p>Lorem Ipsu</p>
<p>Lorem Ipsu</p>
<p>Lorem Ipsu</p>
<p>Lorem Ipsu</p>
<p> Lorem Ipsu</p>
<p>Lorem Ipsu</p>
</div>

<div class="right">
<p>Lorem Ipsum</p>
<p><span class="redcolour"> 1bbbbbb</span> <span class="bluecolour">(Lorem Ipsum</span></p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p>
<p>Lorem Ipsu Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the </p>
</div>

<div class="article">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem IpsumLorem Ipsum is simply dummy </div>

<p id="caption"> Lorem Ipsum is simply dummy text of the printing</p>

</div>
</body>

</html>

Here is the CSS
}
.page01 .left {
position: absolute;
top: 105px;
left: 65px;
height: auto;
width: 110px;
height: auto;
}
.page01 .left p {
color: #1d57eb;
font-size: 16px;
font-weight: bold;
line-height: 19px;
font-style: normal;
text-align: right;
margin-bottom: -10px;
}
.page01 .right {
position: absolute;
top: 105px;
left: 190px;
height: auto;
width: 597px;
}
.page01 .right p {
font-size: 16px;
font-weight:normal;
line-height: 19px;
font-style: normal;
text-align: left;
margin-bottom: -10px;
}
.page01 .article {
position: absolute;
top: 420px;
left: 90px;
width: 708px;
}
.page01 .article p {
font-size:18px;
font-weight: normal;
height: auto;
line-height: 28px;
font-style: italic;
}
.page01 #caption {
position: absolute;
top: 620px;
left: 470px;
width: 360px;
color: #000000;
font-size: 16px;
font-weight: normal;
height: auto;
line-height: 28px;
font-style: italic;
}

verydeepwater
01-24-2013, 07:11 AM
My apologies for posting the same post twice. Actually, I think I have answered my own question. I missed out a <p> tag here in the third div. It now seems to be working OK. I had some problems before with multiple div tags, but it looks as though it was probably simple errors in the code.