As soon as I integrated Bootstrap into my project, the color of the <li> tag became disordered and altered to a different hue

After integrating Bootstrap into my project, I noticed that the colors of the -li- tags became disordered and changed to a different color. How can I manage the colors while using Bootstrap in my project and also control them when hovering?

<nav>
        <ul class="nav-menu">
            <li><a href="#section-1"><span>Introduction</span></a></li>
            <li><a href="#section-2"><span>Events</span></a></li>
            <li><a href="#section-3"><span>Art Activities</span></a></li>
            <li><a href="#section-4"><span>Productions</span></a></li>
            <li><a href="#section-5"><span>Movies </span></a></li>
            <li><a href="#section-6"><span>Shows </span></a></li>
            <li><a href="#section-7"><span>Acting</span></a></li>
            <li><a href="#section-8"><span>Writing</span></a></li>
        </ul>

    </nav>


css:
nav>ul>li{
            /* width: 8%; */
            height: 100%;
            float: right;
            margin-left: 1%;
            text-align: center;
            line-height: 100px;
            font-family: sans-serif;
            font-size: 23px;
            color:white;**(not functioning with added bootstrap)**
           


        }
nav>ul>li:hover{
            background-color: rgb(214, 214, 214);
            color: black;**(not functioning with added bootstrap)**
        }

Answer №1

Could you please provide a snippet of your CSS and HTML for better assistance? Based on what you've described, here are a couple of suggestions:

1- Ensure that you are targeting the correct and specific element by giving it a unique class name in your HTML and using that class name in your CSS (avoid using generic names like 'li' as Bootstrap styling may take precedence).

2- If you are using a framework or library such as Angular, React, or Gatsby, remember to import your CSS files after importing Bootstrap. Your imports should be structured like this:

import './bootstrap.min.css'
import './layout.css'

If you are still having trouble targeting your element, please provide more details for further assistance.

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

Temporary redirection of external links page

There is a specific feature I am trying to implement on my website, but I am having trouble figuring out how to make it work seamlessly. When a user connects to my website and starts navigating through the menus, I want them to be redirected to a specific ...

Tips for generating AJAX requests directly from HTML documents

Hey there! I'm fairly new to JavaScript and have a question that might seem silly to some. How exactly can I invoke a function from a Coffeescript file within my HTML code? I'd like to give users the option to choose the language in which they v ...

Step-by-step guide on integrating node.js and MySQL to store data from an online form in a database

Currently, I am attempting to insert data into a MySQL database using node.js by clicking the submit button. However, an error message has appeared and despite understanding it somewhat, I am unsure of how to proceed. Any assistance would be greatly apprec ...

Empty Media Viewer

I am encountering an issue with setting up a code, as it only displays a blank white page. Any suggestions on what might be causing this problem in the setup and assistance in resolving it would be greatly appreciated. <script type="text/javascript ...

Steps for implementing a select all feature with jQuery

I'm currently working on a jQuery function that is acting as a select-all option. Everything is functioning correctly except that when I deselect any of the child elements from select all, the option remains enabled. My goal is to enable or disable th ...

What is the best way to create rotational movement for an object in a-frame?

Is there a way to have my entity rotate/spin on the Y-axis? I attempted the following: <a-entity position="-1 0.5 3" animation="property: rotation; to: 0 0 0 ; loop: true; elasticity:1000; dur: 10000" rotation="90 0 0"> <a-box position="1 0 ...

A white background emerges when I select md-dropdown

Lately, I've been experiencing an issue on my website where a white background pops up whenever I click on a dropdown (md-select) in my form. Initially, it only happened with forms inside a modal, but now it's affecting dropdowns across the entir ...

Placing buttons on top of a video within a div container

I am facing a challenge with implementing custom controls on a video embedded in my webpage. I have tried setting a div to absolute position for the buttons, but they are not clickable. Is there a way to achieve this without using jQuery? I need the butto ...

What is the best way to ensure a span takes up 100% of its parent li's width

Looking to create a span that spans 100% of its parent li element <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a> <span> <a href="#">One</a> ...

"Enhance text formatting by making it stand out when hovered over

I am encountering an issue where the hover action for a specific letter begins before the mouse actually touches the text. In this case, I want the letter 'P' in 'Paul' to turn white when hovered over. The image illustrates the distanc ...

Why aren't my messages showing up once I exit the textbox on my website?

After writing various functions to compare two passwords, I encountered an issue. My goal was for the message "The passwords match" or "Please enter your password again because the two passwords don't match" to be displayed when clicking out of the "v ...

Combine linear and radial background effects in CSS styling

I am trying to achieve a background design that includes both linear and radial gradients. The linear gradient should display a transition from blue to white, while the radial gradient should overlay a polka dot pattern on top of it. I have been following ...

What could be causing the Bootstrap ProgressBar to not show up?

Having an issue with the ProgressBar component from react-bootstrap: <ProgressBar now={dynamicValue} /> The value dynamicValue changes for each component. However, I am unable to get the progressBar to display in my case. ...

Modify the parent's style in CSS based on the presence of certain specified children

I'm working with an HTML element that can contain a child with the ID 'slideshow' <div id='content'> <div id='slideshow'> </div> </div> Alternatively, it could have a different child like t ...

I successfully managed to ensure that the splash screen is only displayed upon the initial page load. However, I am now encountering an issue where it fails to load again after I close the page. Is there any possible solution

After successfully implementing a splash screen that only plays once on page load, I encountered an issue. When I close the tab and revisit the page, the splash screen no longer plays. Is there a way to fix this problem? Perhaps by setting a time limit for ...

Conceal excessive content on elements set in a stationary position

How can we prevent overflow of a fixed div within a container? Initially, I attempted nesting fixed elements inside each other, but that did not solve the issue. The only solution that comes to mind is using "inverted" masks: other fixed divs that hide eve ...

Utilizing MySql in HTML Buttons Using PHP

PHP $con=mysqli_connect("localhost","root","","mmogezgini"); $menuler = mysqli_query($con,"SELECT * FROM menuler"); while($menu = mysqli_fetch_array($menuler)) { echo "<button class=\"ust_link\" onClick=\"window.location.href ...

Can media queries styles be applied to a window of random size using JavaScript?

Can JavaScript be used to apply media queries style based on random window sizes? I have 5 buttons that I want to switch styles for using JavaScript according to the media queries defined in my CSS stylesheet. Is there a method to achieve this? ...

A pop-up appears, prompting me to redirect to an external URL when clicking on a link that opens in a new tab on my WordPress website

Seeking assistance in dealing with a popup that appears when trying to open a link redirected to an external URL. The popup prompts for permission to open the link in a new tab. Upon inspecting the Element, the code snippet below is revealed: <div cla ...

What is the best way to create a scrollable nested div?

Link to Image My goal is to keep the red section fixed while allowing only the blue section to scroll when there is overflow. The red section consists of two divs. I have attempted using position: fixed to achieve this, but encountered issues such as ove ...