Differences in tabstrip appearance between FireFox on Mac and Ubuntu compared to FireFox on PC

I've encountered an issue with my simple css tabstrip. It seems to render correctly in:

  • Safari 5.0.2 on Mac
  • IE8 on PC
  • FireFox 3.8.12 on PC

However, when viewed on FireFox 3.8.12 on Mac and Ubuntu, the tabs overlap the bottom border of the container div by 1 pixel. As I'm not well-versed in css, I haven't been able to find a solution that works consistently across all platforms.

Any ideas on how to address this?

Code:

<html>
<head>
<style type="text/css">

body {
 font-family: Verdana, Arial;
}

#tabstrip {
 width:700px;
 border-bottom: 5px solid #6a8fa7;
 font-size: 12px;
 font-weight: bold;
 display: block;
 height: 21px;
 margin: 0;
 padding:  0 0 0px 0;
}

#tabstrip ul {
 margin: 0;
 padding: 1px 0 0 0;
 list-style: none;
}

#tabstrip li {
 display: inline;
 float: left;
}

#tabstrip a {
 color: #999999;
 padding: 5px 8px;
 margin-bottom: 4px;
 background-color: #d7d7d7;
 margin: 0 2px;
 text-decoration: none;
}

#tabstrip a:first-child {
 margin-left: 0;
}

#tabstrip a.selected {
 background-color: #6a8fa7;
 color: #fff;
 text-shadow: 1px 1px 2px #666;
}

#tabstrip a.done {
 background-color: #60b43f;
 color: #fff;
 text-shadow: 1px 1px 2px #666;
}


</style>
</head>
<body>

<br/><br/>

<div id="tabstrip">
 <ul>
  <li><a href="/" class="done">Item 1</a></li>
  <li><a href="/" class="selected">Item 2</a></li>
  <li><a href="/">Item 3</a></li>
  <li><a href="/">Item 4</a></li>
  <li><a href="/">Item 5</a></li>
 </ul>
</div>

</body>
</html>

Answer №1

To address the issue, I made use of this code snippet:

<script type="text/javascript>
    var csstype="inline" //Choose between "inline" or "external"
    var mac_css='#nav li a {line-height: 46px; padding-top: 14px; padding-bottom: 13px;}' //Specify Mac CSS if using inline
    var pc_css='#nav li a {line-height: 43px; padding-top: 13px; padding-bottom: 11px;}' //Specify PC/default CSS if using inline
    var mac_externalcss='/style/macstyle.css' //Specify Mac CSS file if using external 
    var pc_externalcss='/style/pcstyle.css'   //Specify PC/default CSS file if using external
    ///////Do not edit beyond this point////////////
    var mactest=navigator.userAgent.indexOf("Mac")!=-1
    if (csstype=="inline"){
        document.write('<style type="text/css">')
        if (mactest)
            document.write(mac_css)
        else
            document.write(pc_css)
        document.write('</style>')
    }
    else if (csstype=="external")
        document.write('<link rel="stylesheet" type="text/css" href="'+ (mactest? mac_externalcss : pc_externalcss) +'">')
</script>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is an alternative method for creating a horizontal line without the need for the <hr> tag?

Is there a way to create a slim horizontal line without using the <hr> tag ? This is what I attempted: .horizontal-line{ border-top: 1px solid #9E9E9E; border-bottom: 1px solid #9E9E9E; } While it does function, I am hoping for a thinner line. ...

How can I modify the color of a jQuery Mobile Select menu?

Is there a way to dynamically modify the color (background and text) of a single select menu in jQuery Mobile, without impacting other elements with the same class? I've experimented with various approaches, such as: $('#select').css({color ...

Rotate the image using the handler, not by directly manipulating the image itself

I need help rotating the image using a handler instead of directly on the image itself. I do not want to rotate the image when clicking and rotating it directly. Please do not suggest using Jquery UI rotatable because resizing the image with Jquery UI resi ...

What is the best way to horizontally align a div within a parent div?

I'm having trouble centering the red div containing three child elements (h1, h3, and button) within a green container div using CSS. I initially attempted to center the red div vertically and horizontally on its own, but after some research, I learne ...

How can I transform an HTML element into a textarea using CSS or JavaScript?

While browsing a webpage, I discovered a <div> element with the class .plainMail and I want to find a way to easily select all its text by simply pressing Ctrl+A. Currently using Firefox 22, I am considering converting the div.plainMail into a texta ...

Making a linked div with background image

I'm attempting to turn the small icons on this particular page () into clickable links. Each icon is contained within its own div, but no matter what I do: <div class="social-btn pinterest"><a href="http://www.pinterest.com/etc.etc.">&l ...

How I made my WordPress columns automatically resize with the help of Bootstrap

Currently, my Wordpress template utilizes Bootstrap 2.3.1 with two areas set up using SPAN4 and SPAN8. The resolution is fixed at 1170px, so there's no need to configure the lg component of Bootstrap. I'm looking for assistance in properly confi ...

Expand Bootstrap navbar search box outside collapse menu

Currently, I am working on designing a navigation bar that showcases my brand on the left side, a full-width search bar in the center, and additional pages on the right. I am facing challenges in maintaining the full-width of the search bar without causing ...

Conversation panel text slipping out of <div>

I am currently working on creating a mock "chat" feature. The issue I am facing is that when I repeatedly click the "send" button, the text overflows from the div. Is there a way to prevent this by stopping the text near the border of the div or adding a s ...

Adjustable width columns in Flexbox design

I need assistance with creating a responsive three-column grid layout using Flex in CSS. I have achieved a fairly responsive design by following the CSS provided in the fiddle link below. However, I am facing an issue where the second column (the blue one) ...

Toggle the slide when you hit submit

I'm considering the functionality of my code. I am interested in creating a slide toggle effect on a div or span when hovering over an input submit button. Here is an example: https://i.sstatic.net/pBSK8.png What is the best approach to achieve thi ...

Adding a gradient to enhance an SVG chart

Hey there! I'm currently experimenting with Plotly to create some awesome charts, and I've been trying to figure out how to give my area-charts a gradient instead of the usual fill with opacity. This is how I typically build my graph: Plotly.ne ...

What is the solution for aligning <grid> containers to match the height of the tallest container in the row?

I've been grappling with a CSS issue. I'm attempting to ensure that my accordion containers within my layout all have the same height as the tallest item on their respective rows. This would create a sleek and responsive layout where all items ar ...

Removing the rows that do not contain a table - nested div elements within other div elements

I am trying to create stripped rows with "complex" children, but I'm having trouble figuring out how to do it. I am using bootstrap, although I'm not sure if that makes any difference! This is what I have attempted so far: https://jsfiddle.net/ ...

Looking to modify the styling of links in an unordered list?

Let me explain what I attempted to accomplish CSS: li:nth-child(2n) { background-color:gray; } HTML: <ul> <li><a></a></li> <li><a></a></li> <li><a></a></li> ...

Tips for aligning website content (including the body and navigation bar) at the center in rtd sphinx

Trying to create documentation with the Read the Docs theme for Sphinx documentation. Want to center the entire webpage, including both the body and left navigation bar so that as the window width increases, the margins on both sides increase equally. Righ ...

Varied spacing between horizontal and vertical items in a list

The issue with the spacing between horizontal and vertical list items is perplexing. Despite having identical margin, padding, height, and width, they seem to display differently. While manual adjustment of margins or paddings can resolve this, I am curiou ...

Is there a way to utilize jQuery to redirect to the href included in the HTML attachment?

I am looking to add a redirection feature to my website using the href provided in the code by jQuery. This will be done after playing an animation for better user experience. $(document).ready(function(){ $("a").click(function(event){ event.prev ...

Creating a seamless top border that remains unaffected by border radius

I'm currently working on mimicking the style of Google Calendar, and I've encountered an issue with the text input box. When clicked, it should look like this: https://ibb.co/6Hqrnt4 However, what I've created ends up looking like this: htt ...

I am seeking a way to conceal list elements according to a specified string input using JavaScript

Looking at the list items inside this div: <div class="container"> <h2>Vanishing Act Game</h2> <div> <li class="list-group-item go" id="item">Door#1</li> <li class="list-group-item go" id="it ...