Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
DIV positioning, DIV layering, images in DIVs!
Old 04-21-2009, 04:43 PM DIV positioning, DIV layering, images in DIVs!
Junior Talker

Posts: 2
Name: Taylor
Location: Mass.
Trades: 0
Hello!

So I am new to divs, and I am having a bit of trouble. In my main "header" div, I have a header image (with a menu, etc., that I will add an image map to). Right now, when I set the top margin and left margin to 0 px, I still have a few pixels of space all around the div (as in my image isn't totally flush with the top and left start of the page). Is there any way to combat this? Also, I would like to add a "main" div to "lay" on top of the header div that has my image. This will have text and display the main information. Right now the main div displays after the header div... is there any way to position on top of my header div?

link:
my problem...

Here is my code now:

CSS:

body { background-image: url('images/prelawbg.jpg');
background-repeat: repeat-y; }

p { font-family: verdana;
font-size: 12px;
color: black }

p.image { text-align: center }


#header {
background-image: url('images/sidecolors.jpg');
background-repeat: repeat-x;

top: 0px;
left: 0px;
height: 700px;
border: 0px;
padding: 0px;}

#main { left: 306px;
top: 298px;
width: 399px; }


HTML:
<html>
<head>
<title>Welcome to Wellesley's Minority Pre-Law Society!</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="header">
<img src="http://www.webmaster-talk.com/images/prelawheader.jpg" alt="header" usemap="#headermap" border="0">
<!-- image map here -->
<div id="main">
<p>Main content here.</p>
</div>
</div>
</body>
</head>


Thank you so much for your help!

Last edited by tperkins; 04-21-2009 at 04:51 PM..
tperkins is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-21-2009, 05:15 PM Re: DIV positioning, DIV layering, images in DIVs!
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Always, always start with a 'reset' for all your elements by zeroing out margins and padding, that includes body, Hx, p, a, ul, ol, li, divs (by whatever names you use) - mine will typically look like this:
Quote:
body, p, hr, img, h1, h2, h3, h4, a, ul, ol, li, #container, #wrapper, #nav, #sidebar, #content, #header{
margin: 0;
padding: 0;
}
The top and left that you have are irrelevant unless you are using absolute or relative positioning.

You really shouldn't be using an image map for navigation either, it's inacessible and search engines can't "read" images.

Quote:
I would like to add a "main" div to "lay" on top of the header div that has my image.
It would be better to put the image in as a background for your header, and that frees up the space inside the #header div to put almost anything you want inside it - ON TOP of the image.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by LadynRed; 04-21-2009 at 05:18 PM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 04-22-2009, 01:30 AM Re: DIV positioning, DIV layering, images in DIVs!
Junior Talker

Posts: 2
Name: Taylor
Location: Mass.
Trades: 0
thanks so much, ladynred! that really helped a lot.
tperkins is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to DIV positioning, DIV layering, images in DIVs!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11833 seconds with 12 queries