473,398 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Positioning Text Over an Image

I'm having difficulities positioning text over an image. Specifically, I am
trying to position the text within each <div> to the topleft of each image
within that <div>.

The following works as I want it to in IE6, but the text is not properly
positioned in Mozilla 1.4.

A test page can be found here:

http://members.rogers.com/db-ls/test/textoverimage.html
CSS:

#navtabs { width: 190px; }
..navtab { position: relative; height: 19px; width: 190px; margin-bottom:
1px; }
..navtab img { cursor: pointer; }
..navtab p { position: absolute; float: left; left: 0px; top: 0px; z-index:
10; cursor: pointer; }

HTML:

<div id="navtabs">
<div class="navtab"><img src="/images/navtab_1.gif" id="navtab_1"
isrollover="yes" alt="" width="190" height="19"><p>link 1</p></div>
<div class="navtab"><img src="../images/navtab_2.gif" id="navtab_2"
isrollover="yes" alt="" width="190" height="19"><p>link 2</p></div>
<div class="navtab"><img src="../images/navtab_3.gif" id="navtab_3"
isrollover="yes" alt="" width="190" height="19"><p>link 3</p></div>
</div>

Jul 20 '05 #1
1 7468
"DB McGee" <no*****@noreply.com> wrote in
news:23******************@twister01.bloor.is.net.c able.rogers.com:
I'm having difficulities positioning text over an image. Specifically,
I am trying to position the text within each <div> to the topleft of
each image within that <div>.

The following works as I want it to in IE6, but the text is not
properly positioned in Mozilla 1.4.
Because it has a default top margin for paragraphs.
.navtab p { position: absolute; float: left; left: 0px; top: 0px;
z-index: 10; cursor: pointer; }


Add "margin: 0" (I see you've already taken out the "float: left").
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Bryan R. Meyer | last post by:
Hello Everyone, The problem of browser resizing has become an issue for me. While redesigning my webpage, I set the left and right margins to be auto so that my content would be centered. ...
4
by: Jane Withnolastname | last post by:
I am trying to re-work an old site by replacing the html with css. On the main page, I have a logo image which I needed centred on the initial screen. I found the solution here:...
4
by: salty_dogs | last post by:
i have a site that works well in ie6 for the pc. but i've also seen it (don't have a mac) with ie for mac and safari. both of these browsers produce different and unwanted results. the biggest...
6
by: Gustaf Liljegren | last post by:
Here's what I'm trying to achieve: 1. A <div>, centered on screen, 600px wide and 100px high, with a background-image (also 600 x 100). 2. Text (an <h1> element) positioned with precision inside...
4
by: TheCeej | last post by:
I'm sorry to post what is ultimately a myspace problem, but I'm sure I'd still be having this problem with any html/css document, so the answer would more than likely be able to help anyone out. I'm...
2
by: nonsensitor | last post by:
I'm just learning xhtml & css, primarily from westciv's online tutorials and css guide. I've run into a couple of problems with a page I'm developing that I can't figure out. The first problem is...
8
by: Woodchuck | last post by:
Hi:) I've been trying to position some element's on my page and I can't come up with a way to equally position 4 DIV's in another DIV without explicitly setting the width of the "child" DIV's....
2
by: TheCruelPanda | last post by:
Hey there. My name is Rowan, and it's been three weeks since I last used tables for an HTML design. Okay, I'm rather new to CSS and I have a big positioning problem here. It might not be a...
18
by: LayneMitch | last post by:
Hello. After getting great advice on positioning, I've edited my code and it's looking more stable. Now I need a little assistance with background image placement. Please click on this...
4
by: Christopera | last post by:
Hello, I have built a site that uses two divs, one verticle, and one horizontal as graphic style for the ite. The problem I am having is that if the browser is resized very small the divs are...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.