Stripes

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Ree
Forum Regular
Posts: 592
Joined: Fri Jun 10, 2005 1:43 am
Location: LT

Stripes

Post by Ree »

Have a look at this:

Code: Select all

<?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>
<head>
<title>Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>

body, html
{
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body
{
  background-color: #F9F6EF;
  color: #000000;
}

#bottom-stripe-2
{
  background-color: #3C4982;
  height: 4px;
  line-height: 4px;
}

#bottom-stripe-3
{
  background-color: #7C8E98;
  height: 10px;
  line-height: 10px;
}

</style>
</head>
<body>
<div id="bottom-stripe-2">&nbsp;</div>
<div id="bottom-stripe-3">&nbsp;</div>
</body>
</html>
You can see that there is no space between the two divs. But IE still puts it there. How could I avoid this? I wouldn't want to use images/tables for this purpose...
User avatar
wtf
Forum Contributor
Posts: 331
Joined: Thu Nov 03, 2005 5:27 pm

Post by wtf »

I believe DIV add's line break at the end of content wrapped withing DIV. <SPAN> is same as div without the line break .
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

There is a space - there's a carraige return (which sometimes IE displays on the page). Put your div declarations on the same line.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply