Forum Moderators: not2easy

Message Too Old, No Replies

positioning a vertical border / background image

pulling my hair out

         

ewokian

10:36 pm on Feb 11, 2005 (gmt 0)

10+ Year Member



How can i make the vertical lines stay in the middle in both ie and firefox?
--------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>test case</title>

<style type="text/css">

* { margin:0; padding:0; }

body
{
margin: 0;
padding: 0;
}

#bg {

background-image: url(imgs/vert.jpg);
background-position: center center;
background-repeat:repeat-y;
margin-left: 195px;
}

#col1{
width: 47%;
float: left;
display:inline;

}

#col2{

margin-left:53%!important;
margin-left:42%;

}

</style>
</head>

<body>
<h1></h1>

<div id="bg">

<div id="col1">
<h2>Latest Project</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
</p>
</div>

<div id="col2">
<h2>Featured Client</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
</p>
</div>

</div>

</body>
</html>

SuzyUK

12:56 pm on Feb 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ewokian

are you trying to center the vertical line betwwen your two columns as per this thread [webmasterworld.com]..

try "centering" the position of the background image itself using percentages to match your column widths rather than margining the div it's on, i.e. leave the #bg div at 100% wide in the background just move the image..

e.g.
#bg {
background-image: url(imgs/vert.jpg);
background-position: 48% 0; /* adjust to fit between your columns */
background-repeat:repeat-y;
/* margin-left: 195px; */
}

#col1{
width: 47%;
float: left;
}

#col2{
margin-left: 50%;
}

any help?

Suzy