Safari Inline Elements Bug?
March 28th, 2008
I was debugging css today, and I ran across some strange behavior with our pagination links. Occasionally the number of pages would wrap around, which is normal, but I noticed that in Safari the right side of the last element in each row was getting chopped off.
Here’s a picture in Safari (and Webkit):
Here’s the same page (what it’s supposed to look like) in Firefox:
Here’s the HTML:
<div id="pagination-links"><strong>Pages: </strong>
<ul>
<li class="selected"><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#">5</a></li>
<li><a href="#">6</a></li>
<li><a href="#">7</a></li>
<li><a href="#">8</a></li>
<li><a href="#">9</a></li>
<li><a href="#">10</a></li>
<li><a href="#">11</a></li>
<li><a href="#">12</a></li>
<li><a href="#">13</a></li>
<li><a href="#">14</a></li>
<li><a href="#">15</a></li>
<li><a href="#">16</a></li>
<li><a href="#">17</a></li>
<li><a href="#">18</a></li>
<li><a href="#">19</a></li>
<li><a href="#">20</a></li>
<li><a href="#">21</a></li>
<li><a href="#">→</a></li>
</ul> of 21 total pages
</div>
And the CSS:
#pagination-links {
color: #404040;
line-height: 25px;
margin: 0 15px 15px 15px;
font-size: 12px;
width: 300px;
}
#pagination-links strong {
padding-right: 10px;
}
#pagination-links ul {
display: inline;
}
#pagination-links ul li {
display: inline;
}
#pagination-links ul li a {
background-color: #fff;
border: #c5c0c0 1px solid;
color: #5b969f;
padding: 2px 6px;
text-decoration: none;
}
#pagination-links ul li a:hover {
border-color: #404040;
color: #404040;
}
#pagination-links ul li.selected a {
background-color: transparent;
border: 0;
}
This display behavior only appears in Safari. It looks correct in Firefox (2 and 3), as well as IE 6.
Safari version: 3.1 (5525.13) Webkit revision: r31388
At first blush, this looks like a browser bug. But before I get too much farther in tracking this down, has anyone else encountered this? Any insight would be appreciated!
Update:
Here’s a zipped file with everything you need to reproduce the bug: cut-off-test.zip (86k)
Subscribe
Network
Archives
- July 2009 (1)
- May 2009 (4)
- March 2009 (1)
- February 2009 (1)
- December 2008 (2)
- November 2008 (1)
- October 2008 (7)
- September 2008 (4)
- August 2008 (4)
- June 2008 (2)
- April 2008 (1)
- March 2008 (1)
- February 2008 (5)
- January 2008 (1)
- December 2007 (1)
- November 2007 (4)
- October 2007 (1)
- September 2007 (1)
- August 2007 (3)
- July 2007 (2)
- June 2007 (5)
- May 2007 (6)
- April 2007 (3)
- March 2007 (4)
- February 2007 (5)
- January 2007 (5)
- December 2006 (6)
- November 2006 (1)
- October 2006 (8)
- September 2006 (12)
- August 2006 (7)
- July 2006 (6)
- June 2006 (6)
- May 2006 (2)
- April 2006 (17)
- March 2006 (15)
- February 2006 (7)
- January 2006 (12)
- December 2005 (25)
- November 2005 (11)
- October 2005 (3)
- September 2005 (2)
- August 2005 (4)
- July 2005 (5)
- June 2005 (1)