Exploring the depths of navigation: Tier three

I'm struggling to get the third level of my navigation to function properly. I've managed to make the first and second levels work perfectly, but the third level isn't behaving as intended. I would like the third level to expand from right to left.

Any help is greatly appreciated.

nav ul {
  list-style: none;
}
a {
  margin: 0;
  padding: 0;
  font-size: 11px;
  vertical-align: baseline;
  background: transparent;
  text-decoration: none;
}
.nav ul {
  *zoom: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-top:4px;
}
.nav ul:before,
.nav ul:after {
  content: "";
  display: table;
}
.nav ul:after {
  clear: both;
}
.nav ul > li {
  float: left;
  position: relative;
}
.nav a {
  display: block;
  padding: 10px 20px;
  line-height: 1.2em;
  color: #042e79;
}
.nav a.sub{
  display: block;
  padding: 10px 20px;
  line-height: 1.2em;
  color: #FFF;
}
.nav a.secondsub{
  display: block;
  padding: 10px 20px;
  line-height: 1.2em;
  color: #FFF;
}
.nav a:hover {
  text-decoration: none;
  background: #042e79;
  color: #FFF;
}
.nav ul li:hover > a {
    background-color: #042e79;
    color: #FFF;
}
.nav li.active {
  text-decoration: none;
  background: #042e79;
}
.nav li.active a {
  color: #FFF;
}
.nav li ul {
  background: #042e79;
  color: #FFF;
}
.nav li ul li {
  width: 200px;
}
.nav li ul a {
  border: none;
}
.nav li ul a:hover {
  background: rgba(0, 0, 0, 0.2);
}
.nav5 ul > li:hover ul {
  max-height: 1000px;
  -webkit-transform: perspective(400) rotate3d(0, 0, 0, 0);
}
.nav5 li ul {
  position: absolute;
  right: 0;
  text-align: right;
  top: 29px;
  z-index: 1000;
  max-height: 0;
  overflow: hidden;
  -webkit-transform: perspective(400) rotate3d(1, 0, 0, -90deg);
  -webkit-transform-origin: 50% 0;
  -webkit-transition: 350ms;
  -moz-transition: 350ms;
  -o-transition: 350ms;
  transition: 350ms;
}
.arrow {
    background: url("../images/content/arrow-down.png") no-repeat;
    display: inline-block;
    height: 8px;
    width: 12px;
    margin-right: 4px;
}
        <nav class="nav nav5">
            <ul>
              <li>
                  <a class="wow fadeInDownBig scroll" data-wow-delay="1.3s" href="#lunch">Exit</a>
              </li>
              <li>
                  <a class="wow fadeInDownBig scroll" data-wow-delay="1.3s" href="#lunch">Phone Book</a>
              </li>
              <li>
                  <a class="wow fadeInDownBig scroll" data-wow-delay="1.1s" href="#lunch">Training</a></li>
              <li>
                  <a class="wow fadeInDownBig scroll" data-wow-delay="0.9s" href="#lunch">Weekly Menu Selection</a></li>
              <li>
                  <a class="wow fadeInDownBig scroll" data-wow-delay="0.7s" href="#about">Quick Access</a></li>
              <li>
                  <a class="wow fadeInDownBig scroll" data-wow-delay="0.5s" href="#products"><span class="arrow"></span>Integrated Management System</a>
                  <ul class="subs">
                      <li><a class="sub" href="#">Organizational Chart</a></li>
                      <li><a class="sub" href="#">Vision and Mission</a></li>
                      <li><a class="sub" href="#" dir="rtl">IMS Organization Policy</a></li>
                      <li><a class="sub" href="#">Job Descriptions</a></li>
                      <li><a class="sub" href="#" dir="rtl">IMS Regulations</a></li>
                      <li><a class="sub" href="#">Processes</a></li>
                      <li>
                          <a class="sub" href="#">Executive Methods / Guidelines</a>
                          <ul class="secondsubs">
                            <li><a class="secondsub" href="#">1</a></li>
                            <li><a class="secondsub" href="#">2</a></li>
                          </ul>
                      </li>
                  </ul>
              </li>
              <li>
                  <a class="wow fadeInDownBig scroll" data-wow-delay="0.3s" href="#cooking"><span class="arrow"></span>Units</a>
                  <ul class="subs">
                      <li><a class="sub" href="#">DPA</a></li>
                      <li><a class="sub" href="#">HSEQ</a></li>
                      <li><a class="sub" href="#">ICT</a></li>
                      <li><a class="sub" href="#">Legal Affairs and Contracts</a></li>
                      <li><a class="sub" href="#">Financial Affairs</a></li>
                      <li><a class="sub" href="#">Planning and Systems</a></li>
                      <li><a class="sub" href="#">Procurement and Supply</a></li>
                      <li><a class="sub" href="#">Maintenance and Repair</a></li>
                      <li><a class="sub" href="#">Operations</a></li>
                      <li><a class="sub" href="#">Human Resources</a></li>
                  </ul>
              </li>
              <li class="wow fadeInDownBig active"><a data-wow-delay="0.1s" href="#stores">Homepage</a></li>
            </ul>
       </nav>

Answer №1

  1. When dealing with a right-to-left language, remember to use direction: rtl.

  2. To maintain consistency in right-to-left layouts, opt for float: right instead of float: left for li elements.

  3. If you want to display a third level ul element, ensure to remove overflow: hidden from the parent .nav5 li ul.

  4. To make the third-level block appear from the right side, apply top: 0; right: 100%.

Here's the final code snippet for your reference:

html {direction: rtl;}

nav ul {
  list-style: none;
}

/* Additional CSS rules here */

For the complete code and implementation, you can access the jsFiddle link: https://jsfiddle.net/azizn/bkm1f4gw/

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

Assigning the CSS class "active" to the navigation menu in ASP Classic

Seeking assistance with setting a CSS class for the current page in an include file that contains the primary navigation menu. Here is my current progress: public function GetFileName() Dim files, url, segments, current 'obtain c ...

Having trouble implementing a transition on a dropdown menu in React

Can anyone help me troubleshoot an issue with adding a transition to a select box that appears when clicking on an input field arrow? I have tried implementing a CSS transition property, but it doesn't seem to be working. Any suggestions on what might ...

Store user input as cookies and showcase it to the user upon their return visit

I'm looking for some assistance in saving user input to cookies and displaying it to the user. The goal is to have the text entered in the input field change into a div and be displayed to the user every time they revisit the page. Currently, I only ...

Initiating a horizontal scroll menu at the center of the screen: Step-by

I need assistance setting up a horizontal scrolling menu for my project. The requirement is to position the middle button in the center of the .scrollmenu div. Currently, I am working with HTML and CSS, but open to suggestions involving javascript as well ...

What is the best way to align the navbar items in the center?

Is there a way to center the navigation bar elements using Bootstrap? HTML <body> <nav class="navbar navbar-inverse navbar-fixed-top " role="navigation"> <div> <ul class="nav navbar-nav"> ...

Scrolling horizontally in ng-grid version 2.0.11

In my application, I am utilizing a ng-grid with auto height and width. The challenge arises when dynamically adding columns to the grid. If there are too many columns to display, instead of showing a horizontal scrollbar, the columns shrink in size and ap ...

Incorporating header and footer elements into the design

I am facing an issue while editing a layout. Currently, when clicking on some side of the layout, a header and footer appear in a certain way. However, I would like to change this so that the header and footer appear differently, similar to the example s ...

Issue with JavaScript ScrollTop

Simply put, I am trying to determine the total scroll size for a text area in a unit that scrollTop can align with. However, I am at a loss on how to do so. I've tried scrollHeight and various other methods without success. Any advice or suggestions ...

The margin of the parent container is influencing the margin of the child element

Purple Working on displaying a rectangle shape in a browser using divs in my React project. Everything works fine, but when I add margin to the parent base and then draw the boxes, there's some space between the mouse cursor and the actual box. The ...

"(PHP)WordPress produces a dynamic menu that adapts to different screen sizes

I recently created a menu on my WordPress site [ and I'm facing an issue with making it display vertically in a responsive way. The code in header.php is as follows: <!-- header --> <header> <div class="overNavPanel"> ...

What could be causing the span tag to not have CSS applied and the background image to not be displaying

The header I have created, shown in the image, is facing two issues. Firstly, I am unable to add ellipsis to the span tag even though I used it. I want the ellipsis to appear when the screen resolution is small. Secondly, the image uploaded is not displayi ...

Achieve full parent width with floated divs

My goal is to arrange 10 boxes horizontally on a webpage. Each box must have a minimum width of 150px and a maximum width of 299px. The challenge is to fit as many boxes as possible across the page without any gaps, ensuring that each box has an equal widt ...

Restricting Horizontal Scrolling in Dash DataTable with multi-tiered header (without any additional empty gaps)

I'm currently developing a Dash application using Plotly that showcases two tables, specifically dash_table.DataTable, each with multiple columns. The initial table features a multi-level header. For both tables, the first few columns are fixed while ...

Picture hidden beyond the words

I am trying to achieve a layout where an image is displayed behind an H1 tag, with the width of the image matching the width of the text. Here is my code: <div style="display: inline;"> <img src="http://img585.imageshack.us/img585/3989/m744. ...

"Sliding through pictures with Bootstrap carousel placed beneath the

Currently, I am working on a website that requires a background image, although I personally do not prefer it. The client's preference is to have the navbar transparent so that the background image shows through it. Now, I would like to incorporate a ...

stop cascading style sheets from being overwritten

In my ASP.NET web forms project, I am utilizing Telerik controls. The Problem In one instance, I need to retrieve HTML data from the database, which includes a lot of CSS, images, and HTML content. Here is an excerpt of my code: <telerik:RadLabel ...

When importing data from a jQuery AJAX load, the system inadvertently generates duplicate div tags

Currently, I am utilizing a script that fetches data from another page and imports it into the current page by using the .load() ajax function. Here is the important line of code: $('#content').load(toLoad,'',showNewContent()) The issu ...

Using Google Fonts in a Typescript React application with JSS: A step-by-step guide

How can I add Google fonts to my JSS for use in styling? const styles = ({palette, typography}: Theme) => createStyles({ time: { flexBasis: '10%', flexShrink: 0, fontSize: typography.pxToRem(20) }, guestname: ...

javascript show and hide navigation bar

I am currently working on a HTML menu that includes a button to open it and an unordered list : <nav class="menu"> <button> <h1>Menu</h1> </button> <ul class="mylist" ...

Adjust the top margin of content to account for the height of a fixed header

When dealing with a fixed header that has been removed from the HTML flow, it can be tricky to adjust the content below it. The challenge arises because the height of the header can vary based on screen size. How can we dynamically adjust the margin-top fo ...