What is the best way to ensure that display block functions properly on mobile devices and outdated versions of Firefox?

I'm experiencing an issue with my HTML menu. It appears correctly on Chrome, the latest Firefox, and IE, but it looks terrible on my iPad and older versions of Firefox. Is there a way to ensure it works consistently across all platforms?

HTML:

<div id="navbar">
    <ul>
        <a href=/interpreters.php><li> Interpreters</li></a>
        <li>Onsite
            <ul>
                <a href=/displayappointments.php?lookup=todayScheduled><li>Appointment Manager</li></a>
                <a href =/newapp.php><li>New Appointment</li></a>
            </ul></li>
        <li>Telephonic
            <ul>
                <a href =/otp.php><li>New Call</li></a>
                <a href =/otplog.php><li>OTP Log</li></a>
                <a href =/otpraw.php><li>OTP Raw</li></a>
            </ul></li>    
        <a href=/translation.php><li>Translation</li></a>
        <li>Tools
            <ul>
                <a href=/teammessage.php><li>Team Message</li></a>
                <a href=massemail.php><li>Mass Email</li></a>
                <a href=uofuparser.php><li>U of U</li></a>
                <a href=/incidenttracker/submitincident.php><li>Issue Tracker <? echo $count; ?></li></a>
                <a href=medicaid.php><li>Medicaid<? echo $medcount; ?></li></a>
             </ul></li>       
        <a href=sms.php><li>TXT<? echo $smscount; ?></li></a>
    </div>

CSS:

#navbar {
    width: 100%;
    height: 30px;
    background-color: #FFFFFF;
    text-align: center; 
}

#navbar ul {      
    margin: 0 auto 0 auto;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    text-align: center; 
}

#navbar ul li {
    float: left;
    color: #333366;
    padding: 0 8px 0 8px;
    border-right: 1px solid #0099FF;
    border-left: 1px solid #0099FF;
    height: 30px;
    list-style: none;
    display: block;
    line-height: 30px;
    text-align: center;
    cursor:pointer;
    border-radius: 9px;
    border-top-right-radius: 9px;
}

#navbar ul li:hover {
    background-color: #e8edff;
}

#navbar ul li ul{
    display:none;
    position:absolute;
    background-color:transparent;
    padding:10px;
    opacity:0.95;
}

#navbar ul li ul li{
    float:none;
    padding:0;
    margin:0;
    width:150px;
    color:#333366;
    background-color:#FFFFFF;
    text-decoration:none;
    z-index:100;
}

#navbar ul li ul li a{
    color:#333366;
    text-decoration:none;
}

#navbar ul li ul li a:hover{
    color:#333366;
}   

#navbar ul li:hover > ul{
    display:block;
}

JS Fiddle: http://jsfiddle.net/n9TGH/

When displayed correctly it looks like this: On my iPad and older versions of firefox it looks like this:

Answer №1

Upon reviewing your HTML code, I noticed that it lacks proper formatting. The <li> tags should be outside of your HREF tags, and you also forgot to include the closing </ul> tag. Fortunately, modern browsers are more forgiving than older versions. Give this revised code a try and see if it resolves the issues.

  <div id="navbar">
    <ul>
        <li><a href=/interpreters.php>Interpreters</a></li>
        <li>Onsite
            <ul>
                <li><a href=/displayappointments.php?lookup=todayScheduled>Appointment Manager</a></li>
                <li><a href=/newapp.php>New Appointment</a></li>
            </ul>
        </li>
        <li>Telephonic
            <ul>
                <li><a href =/otp.php>New Call</a></li>
                <li><a href =/otplog.php>OTP Log</a></li>
                <li><a href =/otpraw.php>OTP Raw</a></li>
            </ul>
        </li>
        <li><a href=/translation.php>Translation</a></li>
        <li>Tools
            <ul>
                <li><a href=/teammessage.php>Team Message</a></li>
                <li><a href=massemail.php>Mass Email</a></li>
                <li><a href=uofuparser.php>U of U</a></li>
                <li><a href=/incidenttracker/submitincident.php>Issue Tracker <? echo $count; ?></a></li>
                <li><a href=medicaid.php>Medicaid<? echo $medcount; ?></a></li>
             </ul>
        </li>
        <li><a href=sms.php><li>TXT<? echo $smscount; ?></a></li>
    </ul>
  </div>

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

Implementing the Fixed Header feature in DataTables - A Step-by-Step Guide

I'm encountering an issue with implementing a fixed header for my table using the DataTables plugin. Despite previously asked questions addressing similar problems, I am still unable to resolve it. I suspect that conflicting CSS or missing CDN links c ...

Can you use "or" or "not" syntax with CSS input type selectors?

In the world of programming, if they actually exist, Suppose I have created an HTML form with the following input fields: <input type="text" /> <input type="password" /> <input type="checkbox" /> I wish to style all input fields that a ...

CSS - Text and dropdown misalignment due to spacing issue

I'm looking to decrease the spacing between the text "Allow type of Compartment Option" and the dropdown box. Here is the code snippet being used: .cl-checkbox { padding-left: 20px; padding-bottom: 10px; padding-top: 20px; ...

CSS: Dynamically adjusting height based on parent element's current height

I'm seeking clarification on the topic at hand. Why am I unable to simply use the following code: <div style="min-height: 100vh"> <div style="height: 100%"> </div> </div> When I implement this code, ...

Is it possible to generate a triangular attachment below a div element?

My designer sent me a unique design and I'm wondering if it's possible to replicate using HTML, CSS, or JavaScript? https://i.stack.imgur.com/spB71.png I believe it can be done with CSS by creating a separate div positioned absolutely under the ...

Stacking of div tags on top of each other

Looking for assistance with some CSS challenges. I am attempting to design a group of buttons using div tags, but they are all merging into one another. You can find the code at http://codepen.io/CliffTam/pen/gadEaq Could someone review the code and pro ...

Finding your way to a <div data-role="page"> sans the use of an anchor tag

I need assistance with a specific HTML setup. The first div tag in the code below contains a form with a table that has two columns labeled A and B, along with a button. The second div tag holds a text box, dropdown menu, and submit button. When the button ...

What is the best way to extract the delta from audio.currentTime?

I'm looking to synchronize my Three.js skeletal animation with an audio track. Typically, for animating the model, I would use the following code: var clock = new THREE.Clock(); function animate(){ var delta = clock.getDelta(); THREE.Animati ...

Switch up the position of the background with onmouseover interactions

I'm currently seeking assistance with a problem I've encountered while attempting to change the backgroundPosition of a block element when a specific link from a list is hovered over. I am looking for a solution that can be implemented in an exte ...

Angular Markdown Styling: A Guide

Currently, I am using Angular and Scully. I would like to add style to the image in a markdown file within Angular, but I am unsure of how to accomplish this task. The image is currently displaying too large. Can anyone provide me with useful advice on how ...

How about "Can I use JavaScript with wget?"

I recently developed a webpage that leverages client-side JavaScript to manipulate data on the page prior to being presented to the user. I am curious if there is a way to utilize the wget command to retrieve the page and apply a client-side JavaScript en ...

Troubleshooting Issue: Google Map not resizing correctly when window size changes

Utilizing media queries, I have implemented an adaptive layout on my website. However, when I adjust the size of the browser window beyond a specific media query, the google map begins to malfunction (refer to the image) My Solution: CSS: #googleMap2{d ...

Display or conceal the login form based on JavaScript availability

I have a small login form that I want to display if JavaScript is disabled. The form has a similar structure: <a ...href="#"...>Login</a> <div class="dropdown-menu" style="padding-left:17px; left:-70px; width:200px;"> <form action="/l ...

Maintaining header and footer while calling a PHP form on the same page

I have a straightforward PHP form, named home.php, that submits to itself: <form action="home.php" method="post" enctype="multipart/form-data" id="AddImageForm"> The issue arises when home.php is accessed from the index.php file (located below). Up ...

Load External HTML content into webpage along with executing JavaScript code and triggering JS functions upon loading

I'm in search of a super lightweight solution that can effectively load an external HTML file into a page using only vanilla JavaScript. The external file contains HTML, CSS, and JS. Essentially, I want to create a concise JS snippet that loads a butt ...

Customizing the backdrop photo on a jade-themed template

I'm running a node js application (without express) and encountering an issue with the background image url in my .jade file. extends ../node_modules/pug-bootstrap/_bootstrap block body style include style.css In my style.css file, I have the ...

Is there an h1 heading on this page?

Trying to enhance the accessibility of a website by properly setting up the headers. Running into issues with ensuring they are in the correct order. If there is code that could be applied across all pages to set h1 if it doesn't exist (promoting h2, ...

Utilize React's Bootstrap NavBar Container and automatically adjust its width

I am struggling with implementing a NavBar from react bootstrap. There seems to be a <div class="container"> that is causing the width to be fixed. How can I adjust this width to be set as auto? https://i.sstatic.net/g1uSG.png I have attempted the ...

Utilizing an Angular service/config to dynamically inject text content into a component, with the added functionality of including HTML markup

service/config file: import { Injectable } from "@angular/core"; import { SafeHtml } from "@angular/platform-browser"; @Injectable() export class xxxxxConfig { xxxVaultLink: SafeHtml; whatHappensNextItemsForEmailxxx: string[]; wha ...

How come this javascript/jQuery code is unable to properly submit the HTML form?

Having some trouble with submitting an HTML form using Javascript/jQuery. It doesn't seem to be working as expected. Here is my HTML form: <form class="navbar-form navbar-right" role="form" id="loginForm" action="login.php"> <div class= ...