HighDots Forums  

Unexpected bottom border with images in Opera 7

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


Discuss Unexpected bottom border with images in Opera 7 in the Cascading Style Sheets forum.



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

Default Unexpected bottom border with images in Opera 7 - 11-19-2003 , 09:24 PM






I have the familiar 'thumbnail' scenario. I want to place a small
border around the image when the cursor hovers above it. I use a 1
pixel, solid border around the image that changes between normal and
hover.

This works fine in Internet Explorer, but in Opera 7.22, the bottom
border is 3 pixels thick. If I expand all borders to 3 pixels, this
bottom border is still 2 pixels thicker than the others, which
suggests that padding or a margin exists on the bottom (text links
use the same background colour as the border). However, during
previous attempts to correct this, I explicitly removed all margins
and padding from any related element that didn't need it. To add even
more confusion, at one point, the first image had uniform borders,
but all the others displayed the usual results. Unfortunately, I
can't seem to repeat this.

Can anyone explain this, or is it a browser bug? I am certain that no
other style sheets are affecting this page.


This is the HTML template:

<DIV class="image-container">
<DIV class="image-item">
<A href="big1.jpg"><IMG src="small1.jpg"></A>
<P><A href="big1.jpg">Image 1</A></P>
</DIV>
<DIV class="image-item">
<A href="big2.jpg"><IMG src="small2.jpg"></A>
<P><A href="big2.jpg">Image 2</A></P>
</DIV>
<DIV class="image-item">
<A href="big3.jpg"><IMG src="small3.jpg"></A>
<P><A href="big3.jpg">Image 3</A></P>
</DIV>
<DIV class="image-item">
<A href="big4.jpg"><IMG src="small4.jpg"></A>
<P><A href="big4.jpg">Image 4</A></P>
</DIV>
</DIV>
<DIV style="clear: both">&nbsp;</DIV>


....and the related CSS (less specific selectors have also been
included):

BODY {
background-color: #ffe8c3;
color: #cd6b01;
font-family: Arial, serif;
font-size: small;
}

A {
background-color: #ffe8c3;
color: #00173c;
text-decoration: none;
}

A:hover {
background-color: #00173c;
color: #ffe8c3;
text-decoration: none;
/*
************************************************** ******************

An aside: does text-decoration need to be specified explicitly here?

************************************************** ******************
*/
}

/*
All paragraphs have a 30 pixel left and right margin - this container
just keeps everything aligned
*/
DIV.image-container {
margin: 0 30px;
}

DIV.image-container DIV.image-item {
float: left;
margin: 5px;
}

DIV.image-container DIV.image-item A IMG {
border: 1px solid #ffe8c3;
}

DIV.image-container DIV.image-item A:hover IMG {
border: 1px solid #00173c;
}

DIV.image-container DIV.image-item P {
margin: 3px 0 0;
text-align: center;
}

The only missing selectors that are in the original style sheet are
for headers and paragraph elements, and a "header" class DIV.

Any help would be greatly appreciated.

Mike

--
Michael Winter
M.Winter (AT) blueyonder (DOT) co.uk.invalid (remove ".invalid" to reply)

Reply With Quote
  #2  
Old   
Michael Winter
 
Posts: n/a

Default Re: Unexpected bottom border with images in Opera 7 - 11-20-2003 , 07:45 AM






Brian wrote on 20 Nov 2003:

It did: a vertical alignment of either 'text-bottom' or 'middle' does
the trick. I'm glad that the difference was due to the non-conforming
nature of Internet Explorer*. That's much more comforting than a
"buggy" Opera.

Thank you,
Mike

* Does Microsoft ever intend to honour any standards that are not
their own?

--
Michael Winter
M.Winter (AT) blueyonder (DOT) co.uk.invalid (remove ".invalid" to reply)


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.