HighDots Forums  

image nested in <div> appear to be 10px below the corresponding <div>-box

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss image nested in <div> appear to be 10px below the corresponding <div>-box in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tomasio
 
Posts: n/a

Default image nested in <div> appear to be 10px below the corresponding <div>-box - 06-09-2006 , 11:55 AM






Dear NG-Readers,

I forgot to post the URL to the html-file and the linked CSS. Here
they are:
html: http://tomasio.at/temp/Unterseite_Templ2.html
CSS: http://tomasio.at/temp/stylesheet.css
correct display: http://tomasio.at/temp/Unterseite_Templ2a.jpg

First I want to apologize for crossposting this, but I got no idea
where this topic really belongs to. I have built a html-page with some
CSS. Anything behaves as expected, just the two images inside the
<div> with the class attributes "schraffur-bottom" and
"content-bottom" appear 10px below their corresponding containers. As
the two pics are 10px high in total, I think it has something to do
with the images. Anybody got an idea what I did wrong?
--
kind regards,
tomasio
"describing an issue reveals the way to solve it"

Reply With Quote
  #2  
Old   
NikitaTheSpider@gmail.com
 
Posts: n/a

Default Re: image nested in <div> appear to be 10px below the corresponding <div>-box - 06-09-2006 , 05:00 PM






tomasio wrote:
Quote:
Dear NG-Readers,

I forgot to post the URL to the html-file and the linked CSS. Here
they are:
html: http://tomasio.at/temp/Unterseite_Templ2.html
CSS: http://tomasio.at/temp/stylesheet.css
correct display: http://tomasio.at/temp/Unterseite_Templ2a.jpg

First I want to apologize for crossposting this, but I got no idea
where this topic really belongs to. I have built a html-page with some
CSS. Anything behaves as expected, just the two images inside the
div> with the class attributes "schraffur-bottom" and
"content-bottom" appear 10px below their corresponding containers. As
the two pics are 10px high in total, I think it has something to do
with the images. Anybody got an idea what I did wrong?
Hi Tomasio,
The images in question are absolutely positioned, so if you don't like
where they are, just change their positions:
#schraffur-bottom {
position: absolute;
left: 305px;
top: 570px; /* changed from 582px */
width: 302px;
height: 6px;
}
#cont-bottom {
position: absolute;
left: 0px;
top: 576px; /* changed from 588px */
width: 802px;
height: 4px;
}

This resolves the problem for me in Firefox 1.5.

Cheers
Philip



Reply With Quote
  #3  
Old   
tomasio
 
Posts: n/a

Default Re: image nested in <div> appear to be 10px below the corresponding <div>-box - 06-10-2006 , 05:12 AM



On 9 Jun 2006 14:00:38 -0700, NikitaTheSpider (AT) gmail (DOT) com wrote:

Quote:
tomasio wrote:
Dear NG-Readers,

I forgot to post the URL to the html-file and the linked CSS. Here
they are:
html: http://tomasio.at/temp/Unterseite_Templ2.html
CSS: http://tomasio.at/temp/stylesheet.css
correct display: http://tomasio.at/temp/Unterseite_Templ2a.jpg

First I want to apologize for crossposting this, but I got no idea
where this topic really belongs to. I have built a html-page with some
CSS. Anything behaves as expected, just the two images inside the
div> with the class attributes "schraffur-bottom" and
"content-bottom" appear 10px below their corresponding containers. As
the two pics are 10px high in total, I think it has something to do
with the images. Anybody got an idea what I did wrong?

Hi Tomasio,
The images in question are absolutely positioned, so if you don't like
where they are, just change their positions:
#schraffur-bottom {
position: absolute;
left: 305px;
top: 570px; /* changed from 582px */
width: 302px;
height: 6px;
}
#cont-bottom {
position: absolute;
left: 0px;
top: 576px; /* changed from 588px */
width: 802px;
height: 4px;
}

This resolves the problem for me in Firefox 1.5.

Cheers
Philip
Thank you Philip,

I already tried this solution but it still does not explain _why_ this
two images are in the wrong position while the others in the site are
not. Anybody got an idea?


Reply With Quote
  #4  
Old   
tomasio
 
Posts: n/a

Default Re: image nested in <div> appear to be 10px below the corresponding <div>-box - 06-11-2006 , 07:34 AM



On Sat, 10 Jun 2006 20:49:19 -0400, Neredbojias
<http://www.neredbojias.com/fliam.php?cat=alt.html> wrote:

Quote:
To further the education of mankind, tomasio <frognsnedso (AT) bled (DOT) de
vouchsafed:

I have built a html-page with some
CSS. Anything behaves as expected, just the two images inside the
div> with the class attributes "schraffur-bottom" and
"content-bottom" appear 10px below their corresponding containers. As
the two pics are 10px high in total, I think it has something to do
with the images. Anybody got an idea what I did wrong?

Hi Tomasio,
The images in question are absolutely positioned, so if you don't like
where they are, just change their positions:
#schraffur-bottom {
position: absolute;
left: 305px;
top: 570px; /* changed from 582px */
width: 302px;
height: 6px;
}
#cont-bottom {
position: absolute;
left: 0px;
top: 576px; /* changed from 588px */
width: 802px;
height: 4px;
}

This resolves the problem for me in Firefox 1.5.

Cheers
Philip
Thank you Philip,

I already tried this solution but it still does not explain _why_ this
two images are in the wrong position while the others in the site are
not. Anybody got an idea?

For starters, try setting font-size:0; in the relevant divs.
Thanx a lot!

So there is a default font size in the css boxes, which influences the
height of the boxes? Strange.


Reply With Quote
  #5  
Old   
NikitaTheSpider@gmail.com
 
Posts: n/a

Default Re: image nested in <div> appear to be 10px below the corresponding <div>-box - 06-11-2006 , 03:52 PM



tomasio wrote:
Quote:
On Sat, 10 Jun 2006 20:49:19 -0400, Neredbojias
http://www.neredbojias.com/fliam.php?cat=alt.html> wrote:
To further the education of mankind, tomasio <frognsnedso (AT) bled (DOT) de
vouchsafed:
I already tried this solution but it still does not explain _why_ this
two images are in the wrong position while the others in the site are
not. Anybody got an idea?

For starters, try setting font-size:0; in the relevant divs.
Thanx a lot!

So there is a default font size in the css boxes, which influences the
height of the boxes? Strange.
Tomasio,
It's not so strange. They use the default font size specified in your
browser. That's what it is there for, no?

Cheers
Philip



Reply With Quote
  #6  
Old   
boclair
 
Posts: n/a

Default Re: image nested in <div> appear to be 10px below the corresponding<div>-box - 06-12-2006 , 01:26 AM



tomasio wrote:
Quote:
On Sat, 10 Jun 2006 20:49:19 -0400, Neredbojias
http://www.neredbojias.com/fliam.php?cat=alt.html> wrote:

To further the education of mankind, tomasio <frognsnedso (AT) bled (DOT) de
vouchsafed:

I have built a html-page with some
CSS. Anything behaves as expected, just the two images inside the
div> with the class attributes "schraffur-bottom" and
"content-bottom" appear 10px below their corresponding containers.
For starters, try setting font-size:0; in the relevant divs.
Thanx a lot!

So there is a default font size in the css boxes, which influences the
height of the boxes? Strange.
Not strange.

img is in-line element, as is font. The in-line box allows for
descenders, such as for g, j, p, q, y, etc. Hence the font-size=0; setting.

However declaring display:block; on the img element negates the need.

Louise


Reply With Quote
  #7  
Old   
tomasio
 
Posts: n/a

Default Re: image nested in <div> appear to be 10px below the corresponding <div>-box - 06-12-2006 , 04:15 AM



On Mon, 12 Jun 2006 05:26:39 GMT, boclair <boclair (AT) bigpond (DOT) net.au>
wrote:

Quote:
tomasio wrote:
On Sat, 10 Jun 2006 20:49:19 -0400, Neredbojias
http://www.neredbojias.com/fliam.php?cat=alt.html> wrote:

To further the education of mankind, tomasio <frognsnedso (AT) bled (DOT) de
vouchsafed:

I have built a html-page with some
CSS. Anything behaves as expected, just the two images inside the
div> with the class attributes "schraffur-bottom" and
"content-bottom" appear 10px below their corresponding containers.
For starters, try setting font-size:0; in the relevant divs.
Thanx a lot!

So there is a default font size in the css boxes, which influences the
height of the boxes? Strange.

Not strange.

img is in-line element, as is font. The in-line box allows for
descenders, such as for g, j, p, q, y, etc. Hence the font-size=0; setting.

However declaring display:block; on the img element negates the need.

Louise
Thanx Louise, with your help I found an elegant solution. And thanks
everyone else for explaining me the reason for this behaviour.



Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.