space between divs

G

Gernot Frisch

Hi,

why is there so much space between my divs? I want them to be on upon the
other:

<html><head>

<STYLE TYPE="text/css"><!--
pre {display:block;}
div {border:0; spacing:0;}
..error {border-color: red; border-style:solid; border-width:2px;}
..eq {background-color: #eeeeee; line-height:1em;;}
..result{background-color: #cccccc; line-height:1em; color: green;}

--></STYLE>
</head><body>
<div class="eq"><pre> 6
a=-
6</pre></div><div class="result">= -1</div>
<div class="eq"><pre>b=a</pre></div><div
t">= -1</div>
</body></html>
 
A

Ari Heino

why is there so much space between my divs?

Solution: pre {display:block; margin: 0;}

The whole code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>blah</title>
<style type="text/css"><!--
pre {display:block; margin: 0;}
div {border:0; spacing:0;}
..error {border-color: red; border-style:solid; border-width:2px;}
..eq {background-color: #eeeeee; line-height:1em;;}
..result{background-color: #cccccc; line-height:1em; color: green;}
--></style>
</head>
<body>
<div class="eq">
<pre> 6
a=-
6</pre>
</div>
<div class="result">= -1</div>
<div class="eq"><pre>b=a</pre></div>
<div class="result">= -1</div>
</body>
</html>
 
J

Jukka K. Korpela

Gernot said:
why is there so much space between my divs?

I want them to be on upon the other:

But what do you _really_ want?

Looks like you want Quirks Mode.
<STYLE TYPE="text/css"><!--

Looks like you want to use foolish constructs to please Netscape 1 users.
<div class="eq"><pre> 6
a=-
6</pre></div><div class="result">= -1</div>
<div class="eq"><pre>b=a</pre></div><div
t">= -1</div>

Looks like you are trying to use something very clumsy to simulate rendering
of mathematical expressions. Why don't you start by telling what you are
really trying to achieve?

Yucca
 

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

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top