Ignored CSS Style Class

Recently, I've taken on the task of developing a website that utilizes uikit features that are new to me. I'm slowly getting the hang of it.

One specific part of the website is a drop-down menu containing links and headers. I have successfully styled the links, but for some reason, I'm struggling to get the header style to work despite numerous attempts.

The section of code giving me trouble looks like this:

.acp_dd_menu {
    background-color: #FFF;
    color: #000;
    padding: 0;
    width: 200px;
    height: auto;
    line-height: auto;
    /*min-height: 30px;*/
    overflow: hidden;
  }

  .acp_dd_menu a {
    text-decoration: none;
  }

  .acp_dd_menu ul {
    list-style-type: none;
    display: block;
    padding: 0;
    margin: 0;
    text-align: left;
    overflow: hidden;
    width: 200px;
  }


  .acp_dd_menu li {
    display: block;
    text-align: left;
    /* height: 30px; */
    padding: 0;
    border: 0;
    margin: 0;
    padding-left: 5px;
    cursor: pointer;
    overflow: hidden;
    width: 200px;
  }

  .acp_dd_menu li:hover, .acp_dd_menu_item_hovered {
    background-color: #bbc4e8;
    color: #000;
    width: 200px;
  }

  .acp_dd_menu_hdr li {
      text-transform: uppercase;
      font-weight: bold;
      text-decoration: underline;
      cursor: auto;
      margin-top: 5px;
  }

  .acp_dd_menu_hdr li:hover{
      text-transform: uppercase;
      font-weight: bold;
      text-decoration: underline;
      cursor: auto;
      margin-top: 5px;
  }
<div class='acp_dd_menu' data-uk-dropdown='{justify:'Corps'}'>
  <ul>
    <li class='acp_dd_menu_hdr'>Structure</li>
    <li>
      <a href='http://www.webcadets.org/dev_index.php/admin_cp/unit_divisions/'>Divisions</a>     </li>
    <li class='acp_dd_menu_hdr'>Positions</li>
    <li>
      <a href='http://www.webcadets.org/dev_index.php/admin_cp/position_manager/'>Manage Positions</a>
     </li>
     <li>
       <a href='http://www.webcadets.org/dev_index.php/admin_cp/position_holders/'>Position Holders</a>
     </li>
   </ul>
</div>
<li id='System'>System</li>
<div class='acp_dd_menu' data-uk-dropdown='{justify:'System'}'>
  <ul>
    <li>
      <a href='http://www.webcadets.org/dev_index.php/admin_cp/page_manager/'>Page Manager</a>
    </li>
  </ul>
</div>

Upon debugging the output, I've noticed that the .acp_dd_menu_hdr elements within the li tags are not picking up the specified class and defaulting to .acp_dd_menu li. I've attempted different variations, including using it as a subclass of .acp_dd_menu .hdr li, without success.

It's probably a simple fix, but after spending so much time on it, I feel like I'm going code-blind.

Answer №1

The css selector .acp_dd_menu_hdr li you are using is incorrect. The class belongs to the li itself, so the correct selector should be li.acp_dd_menu_hdr (your current selector refers to a child of .acp_dd_menu_hdr that is an li).

Answer №2

li.acp_dd_menu_hdr {
    text-transform: uppercase;
    font-weight: bold;
    text-decoration: underline;
    cursor: auto;
    margin-top: 5px;
}

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 the proper way to incorporate quotation marks within other quotation marks?

Is there a way to generate an ID within the myFunction() function in JavaScript? I need a single string to call an HTML script as a variable. Any corrections or suggestions are welcome. Here is a sample code snippet: <button class="tablinks" onclick=" ...

What is the best way to adjust the size of an SVG image using the :before pseudo-class?

Is there a way to display an image in a CSS :before element? .withimage:before { content: url(path/to/image.svg); display: block; height: 20px; width: 20px; } I'm facing an issue where the height and width properties are applied to the eleme ...

What is the best way to create a flexible grid that automatically adjusts to either two columns or one column depending on the width of the

My challenge lies in arranging items into two columns or one, with a specific layout for mobile devices. The order of the items changes between the two column and single column layouts. The number and size of items vary dynamically. For example, in a tw ...

What could be causing my customized UITableViewCell not to appear on the screen?

Recently, I created a custom cell for a UITableView in my project. However, when I finally ran the Playground, the table displayed as a standard one. As someone who is relatively new to UIKit and still learning Swift, I suspect it's a simple mistake o ...

Struggling with setting up a search bar for infinite scrolling content

After dedicating a significant amount of time to solving the puzzle of integrating infinite scroll with a search bar in Angular, I encountered an issue. I am currently using Angular 9 and ngx-infinite-scroll for achieving infinity scrolling functionality. ...

What are the best ways to position elements within a div?

In my small information div, I am looking to align the content on the right side. Specifically, 065 31 323 323, <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a5d4c4c1c0cbdfc4e5c2c8c4ccc98bc6cac8">[email protected]</ ...

How can I adjust the width of a handle/thumb for NoUiSlider?

Looking to adjust the width of a NoUiSlider using CSS: .noUi-horizontal .noUi-handle { width:8px; height:25px; left: 0px; top: -8px; border: 0px solid #000000; border-radius: 0px; background: #000; cursor: default; box- ...

Trouble Viewing Images on Website

I am currently dealing with a critical issue in my project. I am using the MVC model and have my CSS stylesheet located in the view folder. In this stylesheet, I have included the following code for the body element: body{ margin-left:250px; backg ...

Having trouble generating an image with JavaScript

I am currently working on incorporating an image onto a webpage using JavaScript. Surprisingly, even the alert('This function works!') is not displaying anything! What could be causing this issue? Please assist! <!DOCTYPE html> <html> ...

Tap to navigate to queued sections on click

Greetings, community members! Despite my extensive research, I have been unable to find a solution to my query. Just a heads up - I am a novice when it comes to javascript and jQuery. My question pertains to incorporating two image buttons that, upon cli ...

Can you explain the distinction between ' &:hover' and ' & :hover' pseudoclass selectors?

While styling a Material-UI Button, I encountered an unexpected behavior when adding hover effects. When using & :hover, only the inner span of the button was affected. However, when using &:hover, the desired style was achieved. What is the diff ...

What steps should I take to generate a 2-Dimension Input Array from scratch?

I am working on a project that involves creating a 2-Dimensional array of text-based numerical inputs. I aim to use the standard HTML input type box for this purpose: <input type="text"> The number of rows and columns in the array will depend o ...

Failure to load a picture does not trigger onError in the onLoad function

Is there a way to ensure that an image always loads, even if the initial load fails? I have tried using the following code snippet: <img class="small" src="VTVFile4.jpg" onload="this.onload=null; this.src='VTVFile4.jpg?' + new Date();" alt=" ...

Having trouble with the image resizing in Bootstrap 5 on Safari?

I am facing an issue with a website: There are four images under the section "Serviceangebote" that appear as square icons representing circles. I have no trouble viewing them correctly on Windows (Chrome, Firefox, Edge) and Android devices. The images ar ...

AngularJS options for selecting items: radio buttons and checkboxes

I am currently working on creating a concatenated string based on the selection of radio buttons and checkboxes. There are two radio button groups and one checkbox group. One of the radio button groups is functioning correctly, but the other automatically ...

Fluidity in CSS Video

I'm currently working on developing a dynamic video display component for my personal portfolio website. The main concept involves showcasing a mobile application video placed on top of a phone mockup within a designated container. My challenge lies ...

When a table cell is hovered over, a left border will be added

I've been working on adding a left border to the text in a way that highlights the first cell's border when hovering over a row, providing a clear indication of the current row for users. Feel free to check out my progress so far on this fiddle: ...

Exploring BreakPoints using gridlisttiles

Can Grid List Tile components be configured to occupy the entire screen on small devices using sm={12} lg={6}, but only half of the screen on larger devices? If not, is there a way to adjust the grid list layout to display fewer tiles per row on smaller ...

Automatically adjust height directive to fill up the remaining space

Is there a way to dynamically adjust the height of an element to fill the remaining space within its container? In my current layout, I have a fixed-height header (or menu) in pixels, a content area that may overflow the window height and require scroll b ...

Assign a background image to a button using an element that is already present on the page

Is there a way to set the background-image of a button without using an image URL? I am hoping to use an element already in the DOM as the background-image to avoid fetching it again when the button is clicked. For example, caching a loading gif within the ...