Host is overwhelmed by the out-of-control workings of bootstrap

Recently, I created a webpage with just one navbar. Everything seemed to be working perfectly when I tested it on my computer using PHPStorm. However, once I uploaded it to my hosting server, the navbar started acting up.

It began changing the colors I had assigned to it and mixing them together.

Additionally, the flexbox alignment that I set up to have the menu centered while still aligning to the right was not being maintained.

Even the hover effect that I carefully designed kept getting overridden by the default settings.

Most frustratingly, many of the CSS styles I applied were being ignored altogether, and the ones that did work appeared broken or incomplete. Strangely, none of these issues occurred when running the website on my local server with XAMPP or through PHPStorm.

Below is a snippet of the code I used:

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #e8e8e8;
  color: #242424;
}

.wrapper {
  width: 100%;
}

/*****navbar****/

ul {
  direction: rtl;
}

ul li {
  padding: 0 10px;
}

.bg-dark {
  background-color: #242424 !important;
}

.nav-a {
  text-decoration: none;
  direction: rtl;
  justify-content: right;
  border-bottom: solid transparent 3px;
  transition: all ease-in 0.3s;
  color: #e8e8e8;
}

.nav-a:hover {
  border-bottom: solid rgb(80, 80, 80) 3px;
}

.navbar-me {
  color: #e8e8e8;
  justify-content: space-between;
  text-align: center;
  min-height: 10vh;
  height: auto;
}
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <!--STYLE LINKS-->
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  <link href="https://fonts.googleapis.com/css?family=Monoton&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="main.css">
  <title style="direction: rtl"> </title>
</head>

<body>
  <!--start Wrapper-->
  <div class="wrapper">
    <!--navbar START-->
    <nav class="navbar navbar-expand-md navbar-dark bg-dark navbar-me">
      <!------------------n--------NAVToglle---------------------------------------->
      <a class="navbar-brand" style="font-family:monoton,sans-serif; font-size: 1.6rem; color: #e8e8e8;">Technotron</a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
      <div class="collapse navbar-collapse m-auto" id="navbarSupportedContent">
        <!--Unordered list----->
        <ul class="navbar-nav m-auto " style="justify-content: right; text-align: right;">
          <li class="nav-item active"><a class="nav-link nav-a" href="#">خانه</a></li>
          <li class="nav-item"><a class="nav-link nav-a" href="#">محصولات</a></li>
          <li class="nav-item"><a class="nav-link nav-a" href="#">خدمات</a></li>
          <li class="nav-item"><a class="nav-link nav-a" href="#">تماس با ما</a></li>
        </ul>
        <a style=" display: inline-block; padding: 10px; background: #e8e8e8; color: #242424; text-decoration: none;" href="#"><span> فروشگاه <img src="Mainpage/pic/cart.jpg" style="width: 30px;" alt=""></span></a>
      </div>
    </nav>
    <!--navbar STOP-->
  </div>
  <!--END Wrapper-->
  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>

</html>

Answer №1

Before proceeding, make sure that your CSS file is accessible on [www.your-theme-assets.com]/main.css. Then use browser inspect element tools to confirm if your theme is reading your CSS class file correctly. For example, in Firefox:

https://i.sstatic.net/sP6rb.jpg

If your CSS file is not being read properly or if it is being cached for testing purposes, you can add a version number at the end of the CSS file address. This way, every time you make changes to the CSS file, you can see the new changes without any caching issues by simply updating the version number in the source like this:

themeaddress/css/style-min.css?v=2.0.4

?v=2.0.4 doesn't change anything, it just forces the browser to read the new CSS file.

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

Incorporate additional form element functionalities using radio inputs

Recently, I created code that allows a user to duplicate form elements and add values by clicking on "add more". Everything is functioning properly except for the radio inputs. I am currently stuck on this issue. Does anyone have any suggestions on how I c ...

Utilize AJAX in JavaScript file

I am encountering an issue with the following code: function inicioConsultar(){ $(function(){ $('#serviciosU').change(function(){ if ($('#serviciosU').val()!= "-1") { $.ajax({ url: "@Url. ...

Saving Images in HTML 5 Web SQL Database

Is it possible to save images offline using HTML 5 Web SQL Database? ...

The present user who is currently logged into the stackmob platform

I am currently working on retrieving a list of contacts for the logged-in user, but I am struggling to identify the current user. In Parse.com, you would use Parse.User.current(), but I am unsure if Stackmob offers a similar functionality. Below is the co ...

Encountering issues with implementing useStyles in Material-UI components

Currently, I am working on a project utilizing Material-UI's library and encountering styling issues. This project marks my initial venture into ReactJS and JavaScript in general. Therefore, any assistance would be greatly appreciated! I am struggli ...

Guide to implementing proportional height for an element using JQuery 3.3.1

I am currently working on dynamically setting the heights of elements with a specific class using JQuery in order to achieve a 16:10 ratio based on their width. However, I'm encountering an issue where the height doesn't seem to be applied and re ...

Tips for incorporating a value within the AngularJS select function

Having an issue with passing a list value in the html select method using AngularJS. Here is my code: app.js $scope.subcategory = function() { var query = "SELECT unit FROM Length;"; $cordovaSQLite.execute(db, query).then(function(res) { ...

The submit button appears as grey on IOS when using the input[type="submit"]

Why does the submit input look different on IOS only, and how can this be resolved? https://i.sstatic.net/UVlKB.png Thank you in advance For HTML: <input class="btn" type="submit" [disabled]="" ...

Accelerate the JavaScript photo gallery

My JavaScript gallery seems to be slowing down when I have more than 3 or 4 images. It's not just transitioning to the next image slowly, it's also jagged and not smooth. Is there a way to optimize the code for smoother performance? Are there bet ...

Looking for assistance with CSS positioning techniques

Creating a dropdown list with a caret icon for each item is my goal, but I'm facing some challenges. Here's the code snippet of the div structure: <div class="class-to-div1" id="{{ div.id }}" data-cardsnum="{{ div.num }}"> <div clas ...

Exploring a website's HTML structure with Beautiful Soup in Python to pinpoint and extract certain tags

Here is the HTML code for reference: https://i.sstatic.net/Bs2DW.png I am attempting to extract specific information using Python code from the tags following "product-card__title" and "product-card__price". In this case, I need it to return the name and ...

The PHP header redirect to "url.php" fails to function correctly on GoDaddy's hosting platform

Hello everyone, I am facing an issue with the header ("Location: url.php") in PHP. I wrote the code using Macromedia Dreamweaver MX 2004. Everything works fine on my localhost server, but when I upload it to the godaddy server, the redirection gets stuck o ...

FullCalendar, showcasing real-time event creation as you select dates

I am currently utilizing fullcalendar 4 on my website and I am attempting to incorporate an indicator for when a user selects a date on the calendar. While the background color changes, it's not very visible. My aim is to replicate the functionality ...

Some websites are not displaying the CSS code for the inspector

In my experience, I have always relied on Firefox Inspector to troubleshoot CSS issues without any problems. However, when I attempted to analyze the CSS of a specific webpage (only encountering difficulties while logged in), I noticed that the inspector ...

What is the reason for the varying display of absolute sizes on mobile browsers?

I am currently in the process of developing a user-friendly web application that needs to work seamlessly on both desktop and tablet browsers. While everything functions perfectly on desktop, I am encountering an issue on tablets where elements are being d ...

Concealing the appearance of radio buttons with Bootstrap styling

I am struggling to display a form using a modal class. The radio toggle button is causing an issue, resulting in: https://i.sstatic.net/IPhC1.png What I actually get is the radio button appearing at the top and messing up the alignment. This is the une ...

`How can I dynamically alter the text color of a CSS class using code?`

Currently, I am incorporating Bootstrap.css into my project and utilizing the "form-control" class to style my aspx controls. However, I have encountered an issue where the font color of the textbox is appearing as grey when I desire it to be black. Unfo ...

The response contains a JSON object with the values [object, Object]

I am attempting to showcase JSON data in an HTML table. Here is the code I have been using: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){ ...

Website experiencing issues with moderating Facebook comments

I recently added a Facebook comments box to my website in the footer. Although it is visible, I am unable to moderate it. Furthermore, the comments are not showing up in the comments queue panel at https://developers.facebook.com/tools/comments. I am us ...

Efficiently styling table Spans with styled components in React

Can anyone help me with a frustrating CSS problem I'm facing? I am trying to render these tags as spans, but they are not separating properly as shown in the image below. They appear stuck together and I can't figure out why. I am using styled co ...