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.

HTML Forum


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



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
DIV positioning related to image
Old 10-08-2010, 10:24 AM DIV positioning related to image
Junior Talker

Posts: 2
Name: cucu
Trades: 0
Hi all! I am newbei to this forum and also webdesigning. I trying to position a DIV related to an image. Here is my code without any success.

Code:
<html>
<head>
<title>Design</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
<style type="text/css">
body {
	background-color: #666;
}
#apDiv1 {
	position:absolute;
	width:200px;
	height:115px;
	z-index:1;
	left: 683px;
	top: 335px;
}
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" valign="middle"> 
<tr> 
<td > 
<center>
  <div>
    <div id="apDiv1"><img src="images/ide/ide_menu_item_2.png" style="opacity:0.4;filter:alpha(opacity=40)"
onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100"
onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" /></div>
    <img src="images/typ_bg.jpg" alt="" name="GoodBad" width="815" height="514" id="GoodBad">
  </div>
</center> 
</td> 
</tr> 
</table>
</body>
</html>
I am trying to overlay ide_menu_item_2png over typ_bg.jpg and I am not allowed to use typ_bg.jpg as background image because of a 3rd party script.

This is very annoying because I cant go further.
My website on construction
http://cun8.net/gb.html
secured-nor1 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-08-2010, 01:44 PM Re: DIV positioning related to image
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Good grief - 1 - get rid of the tables for layout, they were meant for data and that's not the modern way to build a layout. 2 - get rid of the horrid deprecated <center> tag and use CSS to position things as needed. 3 - you can't position the div relative to the image inside it - it's works the other way around, the image gets positioned relative to it's parent - the div. Why do you need absolute positioning anyway? It's not really the best way to build a layout.

You also don't need all that javascript junk to do a simple image rollover, use CSS.
__________________
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

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 10-08-2010, 06:17 PM Re: DIV positioning related to image
Junior Talker

Posts: 2
Name: cucu
Trades: 0
Ok thanks.
1. tables be gone!
2. I'll get rid of <center> but tell me how with CSS?
3. Any example code that I can see and steal?

I just want to center the typ_bg.jpg and overlay the the ide_menu_item_2.png over it. Thats it. I'm not a fan of absolute or smirnoff =)
secured-nor1 is offline
Reply With Quote
View Public Profile
 
Old 10-12-2010, 08:19 AM Re: DIV positioning related to image
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
To center your site - http://www.webmaster-talk.com/css-fo...r-website.html

To center the background it would be something like this applied to the div to have the bg image;
background: url(images/typ_bg.jpg) center top;

Then you put your menu in.
__________________
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

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to DIV positioning related to image
 

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.34875 seconds with 12 queries