What is the best way to show a dropdown menu on the right side of the

I developed a demo that functions properly on both desktop and mobile devices. However, I am facing an issue where the dropdown menu is not displayed when switching to the mobile version. Here is my code snippet: http://codepen.io/anon/pen/OyNLqa

#menubar li {
    display: inline;
    padding:0.5em;
    font-size:1.5em;
    color :red
}
#menubar li:last-child{
    color: black;
}
@media screen and (max-width: 400px) {
    .large {
        display: none;
    }
}

@media screen and (min-width: 400px) {
    .small {
        display: none;
    }
}
#menubar{
    float:right;
    position:relative;
}

#menubarCont {
    width: 100%;
    right:5em;
    position:relative;
}
  

https://i.sstatic.net/9HvIA.png

https://i.sstatic.net/H9trB.png The program runs fine on desktop but does not display the dropdown on smaller screens. How can I make the dropdown appear on the right side as shown in the image?

Answer №1

  #navBar {
        width: 100%;
        right:2em;
        position:relative;
    }

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

The jQuery event for clicking is not functioning as expected when trying to display particular data from a JSON array

Three dummy users were created with a JSON array structured like this: var userArray = {"users":[ {"Name":"User1","Email":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5a2f293f286b1a2935373f2e3233343d74393537">[email& ...

Does Vue3 support importing an HTML file containing components into a single file component (SFC)?

I am working on a Form-Component (SFC) that is supposed to import an HTML file containing Vue components. Form-Component <template src="../../../views/form-settings.html"></template> <script setup> import Button from "./. ...

The JsHelper::domReady function is malfunctioning!

While developing a website with CakePHP, I have encountered an issue... Utilizing the latest version of jQuery... and using JsHelper to accomplish something like this: $this->Js->domReady ( $this->Js->alert ('Page loaded !') ); ...

Using AngularJS to pass authorization headers during redirection using the $window.open method

In the title, I mentioned my intention to redirect from an angularJs application located in localhost:port1 to another angularJs application in localhost:port2. Both applications are secured using a openid-connect server and the angualrjs directive foun ...

Is it possible to resize a Div using pure CSS?

Here is the HTML structure I am working with: <div class="outer"> <div class="inner"> <a href="#"/> <a href="#"/> <a href="#"/> </div> </div> This is the corresponding CSS: div.outer{ position:relative; ...

Can someone please explain how to apply various fonts to the text in a `<p>` paragraph using CSS and HTML?

Take a look at this image Can you provide guidance on how to incorporate various fonts within a paragraph, like the example shown in the image above? I am experimenting with the "Creative Corner" section. ...

The placement of text appears to be incorrect when applying the float:left property in CSS

My issue is that I want #text1 to display on the right side of #video1, and #text2 to be positioned next to #video2. However, currently #text2 is also appearing beside #video1. Can someone please explain why this is happening and provide a solution to fi ...

"Troubleshooting issue in Django 1.6.2 where CSS styles are not being applied to

I am encountering an issue with this code and would greatly appreciate some assistance. The base.html file contains a {% block content %}{% endblock %}. I have created a Signup.html file structured like this: {%extends 'base.html'%} {% block co ...

How do I add a "Switch to Desktop Site" link on a mobile site that redirects to the desktop version without redirecting back to the mobile version once it loads?

After creating a custom mobile skin for a website, I faced an issue with looping back to the mobile version when trying to add a "view desktop version" link. The code snippet below detects the screen size and redirects accordingly: <script type="text/j ...

Having a problem with file uploads in node.js using multer. The variables req.file and req.files are always coming

I am encountering an issue with uploading a file to my server, as both req.file and req.files are consistently undefined on my POST REST endpoint. The file I'm attempting to upload is a ".dat" file, and my expectation is to receive a JSON response. ...

How can I implement a location tracking system in my Rails website?

Upon clicking the 'Punch In' button, I would like to retrieve the location of where the user made the click. ...

I am looking to preload a separate webpage prior to the HTML loading in AngularJS

I am looking to implement a feature in my AngularJS app where a different webpage (e.g. google.com) will be loaded based on the response of a REST API before any default HTML content is displayed. I have attempted to make a REST service call within a fact ...

The image is failing to display in the CSS

As a beginner in the world of CSS and HTML, I encountered an issue where my background image is not showing up. Here's the code snippet that I have: ... <style type="text/css"> #header_contain{ width:935px; height: 135px; ...

Having trouble with your jQuery slideDown menu?

I am facing the exact same issue I had last week. Here is an example of my HTML code: <article class="tickets"> <div class="grid_12 left"> <div class="header"> <i class="ico ...

Angular Resolve is functioning as expected, however, the view is not being displayed. No errors have been reported in

$routeProvider.when( '/view2', { templateurl:'view2.html', resolve:{ getController: function($q) { console.log('Resolving...'); var defer = $q.defer(); ...

Generate a random word using Typed.js

Can Typed.js generate a random word for output? $(function(){ $(".element").typed({ strings: ["Lorem", "Ipsum", "Dolor"], typeSpeed: 0 }); }); The output should be one of the following words. (Lorem / Ipsum / Dolor) ...

Obtain the node identifier within the Angular UI Tree component [angular-ui-tree]

Utilizing Angular UI tree to create a relationship between items and categories has been successful in the default setup. However, a new requirement has emerged to incorporate node/section numbering within the tree for managing hierarchy. I attempted to i ...

AngularJS seems to be failing to display the initial option in the input select field

When using Angularjs, binding an input select to the model results in a new empty option being created <option value="? undefined:undefined ?"></option> Here is an example of the code: <select name="category" ng-model="hotspot.category"&g ...

Exploring Laravel 4: Controlling AJAX data manipulation via the controller

I am a beginner in using Laravel and ajax. Currently, I am working on retrieving data from a form through ajax and calling a controller method using ajax as well. The controller method searches the database and returns a json response to be handled by ajax ...

Updating the value of an Angular select on change is not being reflected

If the select element is changed, the value should be set to something different from what was selected. There's a feature in place that only allows 4 item types to be selected at a time; if more than 4 are chosen, the value reverts back to its origin ...