473,503 Members | 12,175 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

position of text on image

Hi,

I guess I am missing something. I tried to put a caption on my photo (on
the bottom) but the caption appears to be a bit higher and overshooting
the area of the image with a few pix.

You can see it on:
http://www.roderik.net/caption.php
Any idea btw. whether some standard JS framework provides a function for
slide in caption as you can see on the images of:
http://www.guardian.co.uk/
--
http://www.archytas.nl/
webdesign, internet applicaties, internetgestuurde elektronica
Aug 26 '08 #1
5 2402
In article <48**********@mk-nntp-2.news.uk.tiscali.com>,
Roderik <r.********@tiscali.co.ukwrote:
>
I guess I am missing something. I tried to put a caption on my photo (on
the bottom) but the caption appears to be a bit higher and overshooting
the area of the image with a few pix.

You can see it on:
http://www.roderik.net/caption.php
You could try:

<div class="richimage"><img alt="photo"
src="/lib/img/latest/chaekith-brighton-shore.jpg" title="This is the
title">
Some text on the image
</div>

instead of your HTML.

And

..richimage img {display: block;}

instead of your

..richimage {
position:relative;
}

.richimage p {
position: absolute;
left: 0;
bottom: 0;
padding: 7px;
background:#000;
color:#fff;
opacity:0.7;
}

--
dorayme
Aug 26 '08 #2
dorayme schreef:
In article <48**********@mk-nntp-2.news.uk.tiscali.com>,
Roderik <r.********@tiscali.co.ukwrote:
>I guess I am missing something. I tried to put a caption on my photo (on
the bottom) but the caption appears to be a bit higher and overshooting
the area of the image with a few pix.

You can see it on:
http://www.roderik.net/caption.php

You could try:

<div class="richimage"><img alt="photo"
src="/lib/img/latest/chaekith-brighton-shore.jpg" title="This is the
title">
Some text on the image
</div>

instead of your HTML.

And

..richimage img {display: block;}

instead of your

..richimage {
position:relative;
}

.richimage p {
position: absolute;
left: 0;
bottom: 0;
padding: 7px;
background:#000;
color:#fff;
opacity:0.7;
}
I tried that now but then the caption comes under the image instead of
on the image. I guess some people will favour that but it was not my
intention.

--
http://www.archytas.nl/
webdesign, internet applicaties, internetgestuurde elektronica
Aug 27 '08 #3
In article <48********@mk-nntp-2.news.uk.tiscali.com>,
Roderik <r.********@tiscali.co.ukwrote:
dorayme schreef:
In article <48**********@mk-nntp-2.news.uk.tiscali.com>,
Roderik <r.********@tiscali.co.ukwrote:
I guess I am missing something. I tried to put a caption on my photo (on
the bottom) but the caption appears to be a bit higher and overshooting
the area of the image with a few pix.

You can see it on:
http://www.roderik.net/caption.php
You could try:

<div class="richimage"><img alt="photo"
src="/lib/img/latest/chaekith-brighton-shore.jpg" title="This is the
title">
Some text on the image
</div>

instead of your HTML.

And

..richimage img {display: block;}

instead of your
>
I tried that now but then the caption comes under the image instead of
on the image. I guess some people will favour that but it was not my
intention.
Ah, you actually want it on the image! It will be less readable but I
won't go into that. Perhaps you can explain your original words:

" but the caption appears to be a bit higher and overshooting the area
of the image with a few pix". What browsers are we talking and what
quite are you saying, bit higher than what? Overshooting what exactly?

--
dorayme
Aug 27 '08 #4
Jonathan N. Little schreef:
Roderik wrote:
>Hi,

I guess I am missing something. I tried to put a caption on my photo
(on the bottom) but the caption appears to be a bit higher and
overshooting the area of the image with a few pix.

You can see it on:
http://www.roderik.net/caption.php
Any idea btw. whether some standard JS framework provides a function
for slide in caption as you can see on the images of:
http://www.guardian.co.uk/

[...] .richimage img {
/* else img inline and will have descender space */
display: block;
} [...]
Thanks that did it. I was suppossing that there wouldn't be descender
space after setting margins and paddings to 0. Or has it to do with
line-height?

--
http://www.archytas.nl/
webdesign, internet applicaties, internetgestuurde elektronica
Aug 28 '08 #5
Roderik wrote:
Jonathan N. Little schreef:
>Roderik wrote:
>>Hi,

I guess I am missing something. I tried to put a caption on my photo
(on the bottom) but the caption appears to be a bit higher and
overshooting the area of the image with a few pix.

You can see it on:
http://www.roderik.net/caption.php
Any idea btw. whether some standard JS framework provides a function
for slide in caption as you can see on the images of:
http://www.guardian.co.uk/

[...] .richimage img {
/* else img inline and will have descender space */
display: block;
} [...]

Thanks that did it. I was suppossing that there wouldn't be descender
space after setting margins and paddings to 0. Or has it to do with
line-height?
No it has to do with an inline element has space reserved for ascenders
and descenders and diacritic marks.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Aug 28 '08 #6

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

Similar topics

7
7975
by: Doc | last post by:
I've read in a couple of different places including the archives of this forum that html doesn't allow you to precisely dictate the position of an image, but I found this command (again in the...
14
3603
by: Schraalhans Keukenmeester | last post by:
I am building a default sheet for my linux-related pages. Since many linux users still rely on/prefer viewing textmode and unstyled content I try to stick to the correct html tags to pertain good...
2
4537
by: Steve Macleod | last post by:
Hi, I am attempting to write a generic class for a warning box. The class looks like this: ..warningBox { background-image:url(images/co_images/warning_flag.gif); background-repeat:no-repeat;...
5
2259
by: Roderik | last post by:
Hi, My logo images are positioned some more to the right in IE6 than in FF1.5. I like them to be as shown in FF1.5. Does anyone have a clue, why they are positioned differently in IE? Problem...
2
4240
by: Dale | last post by:
This seems like it should be simple and I am pretty sure I've done similar things a hundred times before but I sure can't seem to get it right this time. I have a GridView with a column of text...
2
2439
by: agbee1 | last post by:
Hello: I've finally made the effort to ween myself from overly using tables and use CSS for my positioning. However, I am having a problem with my navigational menu properly aligning in Firefox,...
4
1870
by: sarika | last post by:
Hi all I want to create an online stamp making site. In my site a user select a template from number of templates for making his stamp. The template is and image with some graphics and text. Now...
1
5649
by: empiresolutions | last post by:
Im trying to get an image to center in a div. It works as long as one part of my CSS is commented out. The issues is the part that is breaking it, is required for another script to run that I have...
10
5735
by: VividWeb | last post by:
Hi. I am relatively new to CSS and HTML but have a basic understanding of most things. One of my backgrounds is not positioning correctly in IE 7 or AOL. The background behind the content...
0
7193
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
7067
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
7264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6975
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
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5562
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,...
1
4992
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...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.