Forever Zero
04-15-2005, 01:16 AM
I'm pretty new to CSS and am trying to learn it so I can start using it as the base to any future websites I make.
I was trying to re-create a simple HTML element I had used a table for with CSS, and ran into two big problems that I can't figure out. Doing something like this with CSS should be pretty easy (or I thought :\).
What I am doing is re-creating a table that holds the title for each page. The old table had 3 colums, two held the images for the side tabs of the table, and the middle held the actual text.
I am using what it comes out to look like (you'll see in the attached images) as the background image for the text. Here is the code I am using...
<html>
<head>
<style type="text/css">
<!--
body {color: #FFFFFF; background: #222222;}
.title {width: 518; height: 16; background: url(topbg.jpg);}
.title div {margin: 2px 5px 2px 20px; font-size: 7pt; font-family: verdana;}
-->
</style>
</head>
<body>
<div class="title"><div>Testing....</div></div>
</body>
</html>
"topbg.jpg" is the entire thing as a background instead of using seperate images in a table to get the tabs. I need to use padding for the text which is held in "title.div" to make it go down and to the left so it is where it is supposed to be.
Here is the problem. When I run it in IE, it looks perfect except the entire thing gets pished down (see attached image). When I run it in Firefox, it doesn't get pushed down, but the top margin doesn't appear at all.
Any help in a way to code this with CSS is appreciated. Thanks.
http://www.roschmuck.com/personal/problem.jpg
I was trying to re-create a simple HTML element I had used a table for with CSS, and ran into two big problems that I can't figure out. Doing something like this with CSS should be pretty easy (or I thought :\).
What I am doing is re-creating a table that holds the title for each page. The old table had 3 colums, two held the images for the side tabs of the table, and the middle held the actual text.
I am using what it comes out to look like (you'll see in the attached images) as the background image for the text. Here is the code I am using...
<html>
<head>
<style type="text/css">
<!--
body {color: #FFFFFF; background: #222222;}
.title {width: 518; height: 16; background: url(topbg.jpg);}
.title div {margin: 2px 5px 2px 20px; font-size: 7pt; font-family: verdana;}
-->
</style>
</head>
<body>
<div class="title"><div>Testing....</div></div>
</body>
</html>
"topbg.jpg" is the entire thing as a background instead of using seperate images in a table to get the tabs. I need to use padding for the text which is held in "title.div" to make it go down and to the left so it is where it is supposed to be.
Here is the problem. When I run it in IE, it looks perfect except the entire thing gets pished down (see attached image). When I run it in Firefox, it doesn't get pushed down, but the top margin doesn't appear at all.
Any help in a way to code this with CSS is appreciated. Thanks.
http://www.roschmuck.com/personal/problem.jpg