Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

enforcing display:block-defined background color to fill table cells

Status
Not open for further replies.

retrositelover

Programmer
Oct 20, 2004
35
0
0
Hello,

on my sitemap, I use CSS to highlight cells (a:hover); display:block is dedicated to ensure the full cell colored on mouseover.

However, if I resize the browser to extreme levels (smallscreens) some cells have line breaks, and the one-word cells will then only color the background of this particular line, not the complete cell. Couldn't find a workaround in CSS/HTML for this problem; the line-height value doesn't seem to be decisive as this also occurs when not set.

thanks for reading :)
Joerg
 
It's only at extreme window sizes like ~300px width in cells with just one word, like in the middle column of the first table; tested this in Opera 10.10 (build 4742) and Epiphany 2.26.1 (gecko-1.9) / Ubuntu 9.04.
 
Sounds like a browser bug.

You could try applying the same background colour to td:hover (in addition to a:hover). Most modern browsers will apply it, and those that don't will still have the link styling to fall back on.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
The old problem if one would define a 100% width/height -> that browsers wouldn't highlight ending exactly at the table border, and fail to center vertically?

In the above link/first posting, I tried to use that method, and it worked so far, but I guess having hundreds such table cells underneath, some browsers could have issues.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top