Bootstrap link causing alterations to my CSS code

After incorporating Bootstrap into my HTML, I noticed that it caused some unexpected changes to my CSS code.

Original CSS:

https://i.stack.imgur.com/EsE6J.jpg

Modified CSS after applying Bootstrap:

https://i.stack.imgur.com/yH1r9.jpg

Link to Bootstrap: Updated CSS:

#bannerRodap{
    background-color: black;
    position: fixed;    
    width: 100%;
    height:80px;
    top: 88%;
}
#bannerRodap p{
    position: relative;
    top: 25%;
    color: white;
    text-align: center;
    font-family: 'Helvetica',sans-serif;
    font-size:0.8em; 
}

In addition to the CSS changes, Bootstrap also introduced a small blue element under my flex-box container.

Answer №1

Indeed, the changes in CSS that occur when using Bootstrap are to be expected and are considered one of the common drawbacks of relying on this framework. As the name implies, the entire set of CSS from "Bootstrap" is integrated into your project. The issue lies with the extensive code within the bootstrap.css file, which includes over 3000 lines that may not all be necessary for your project. To illustrate, let's take a small excerpt from the bootstrap.css file:

a {
  color: #337ab7;
  text-decoration: none;
}
a:hover,
a:focus {
  color: #23527c;
  text-decoration: underline;
} 

This snippet means that all anchor tags (<a>) in your project will default to the color

#337ab7</code unless you override this style in your own stylesheet. Problems arise when other elements in your project start behaving according to the Bootstrap CSS, even if that was not your intention - in such cases, overriding styles from <code>bootstrap.css
becomes necessary in order to cancel out unwanted effects.

It's no surprise that seasoned UI developers often express disdain towards Bootstrap due to various reasons:

  • Your custom stylesheet can become cluttered.
  • The HTML can become messy, especially when utilizing Bootstrap's grid system.
  • You end up with a surplus of unnecessary code from Bootstrap's CSS/JS files that may never be utilized.

Interestingly, the order in which stylesheets are included doesn't always have a significant impact. In situations where you need to identify and eliminate an undesired element (like a blue shadow possibly originating from Bootstrap), overriding styles in your own stylesheet after including bootstrap.css can help resolve the issue.

In my opinion, Bootstrap is best suited for those who require a comprehensive solution for the appearance and layout of their project without much customization needed. However, if extensive customization is necessary, starting from scratch with your own CSS may be more beneficial than incorporating Bootstrap.

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 HTML header is not displaying at the proper width as intended

Let me lay out the blueprint I had in mind for my webpage: The body will have a width and height of 600 x 800 pixels with no padding, allowing elements to snugly align without any margin. Inside the body, there will be 3 key elements - a header, main c ...

Diagonal-left ending div in cascading style sheets

Looking to achieve a div with a diagonal side similar to the image in the link below: I'm trying to figure out the best way to do this. One idea is to position 2 divs closely together and rotate one of them. Alternatively, I could use a background im ...

Mobile site experiencing owl.carousel responsiveness issues after refreshing the page

I am currently working on a website located at . On the homepage, right after the slider, there is a carousel of three info boxes. However, in mobile view (developer mode), after a hard refresh or viewing the link on an actual mobile device, it displays a ...

Ways to adjust the position of a DIV based on its index value

I'm currently working on a unique project that involves creating a triangular grid using HTML and CSS. The challenge I am facing is offsetting each triangle in the grid to the left by increasing amounts so they fit seamlessly next to one another. Righ ...

Clicking on the mail icon will open the mail with the associated mail id

When the mail icon is clicked, the mail will open with this email address. I am currently working on a project where clicking the mail icon will redirect to the mail signup page with the corresponding email address. In the image below, the red border ind ...

The appearance of Recaptcha buttons is unattractive and seemingly impossible to

Let me start by saying that I have already looked into the issue of "Recaptcha is broken" where adjusting the line-height was suggested as a solution. Unfortunately, that did not work for me. After implementing Google's impressive Recaptcha on my web ...

Incorporating SCSS into HTML files when they are situated at the same hierarchy

I have <h1 class='title home'> My Title </h1>, and to apply styles I can use the following CSS: .title { font-size: 1.95em; } .title .home { color: black; } While this method works, I a ...

What is the reason behind div elements shifting when hovering over a particular element?

Currently, I have floated all my div elements (icons) to the left and margin-lefted them to create space in between. I've displayed them inline as well. However, when I hover over one element (icon), the rest of the elements move. Can you please help ...

Display the div when scrolling downwards beyond 800px

Is there a way to display a hidden section when scrolling down the page, specifically after reaching a point 800px from the top? I currently have an example code that may need some modifications to achieve this desired effect. UPDATE: [Additionally, when ...

Toggle the visibility of the search Div using Angular UI

When using angular UI buttons, users can select search criteria by choosing between Patient, ID, or Date. If Patient or ID is selected, the searchByText div will be shown. If Date is selected, the searchByText will be hidden and the SearchBydateRange wil ...

How jQuery stops the submission of a form

Sample HTML Code <p><select name="status" class="form-control" id="showThisItem"> <option value=""> Select Status </option> <option value="Paid"> Paid </option> <option value="Unpa ...

Troubleshooting CSS Issues in ASP.NET Boilerplate

I am attempting to apply a CSS style to a text input similar to the one found on the CreateUser default page. However, I am encountering an issue where the blue line under the textbox does not appear when I navigate away from and then return to the page. ...

Aligning a div within another div with an image

My current setup looks like this: HTML: <div class="wrapper"> <img src="image.jpg" /> <div class="circle"> X </div> </div> CSS: .circle { width:50px; height:50px; border-radius:50%; background: #FF0000; } ...

Unique phrase: "Personalized text emphasized by a patterned backdrop

I'm facing a challenge and struggling to find a way to highlight text using CSS or jQuery. My goal is to have an image on the left, another one on the right, and a repeated image in between. Since there are some long words involved, I need a dynamic s ...

Modifying an HTML list item to become 'active' in a navigation bar

One way I've been implementing my navbar on each page is by using the following code at the bottom of the page within script tags: $("#navbar-partial").load("navbar.html). The code for the navbar list looks like this: <ul id="main-nav" class="nav ...

The background gently fades away, directing all attention to the popup form/element

After extensive searching, I have yet to find a straightforward solution that seems to be a standard practice on the web. My goal is to create a form that appears in the center of the screen when a button is clicked using CSS or jQuery. I would like the ...

Is there a way for me to personalize the background of the mui-material datagrid header?

I am looking to update the background design of Mui Datagrid from this image to this image However, I am encountering an issue where the background color does not fully cover the header. I have attempted using "cellClassName:" in the columns but it has n ...

Next JS and the power of media queries

I've been searching for a while now, but I just can't seem to find a solution to my problem. I'm attempting to utilize different files for my media query breakpoints in Next JS, but they don't appear to be working. I created the files ...

Issues with connecting static files in express.js

Hey there! I'm having an issue with the redirect not working when I click the "Submit" button on the login page. The code in my index.js file looks like this: app.use(bodyParser.urlencoded({ extended: true })); app.use(express.static(path.join(__dir ...

Setting the minimum and maximum width of a div using Bootstrap, not based on the number of columns

I want to adjust the number of columns based on the width of the screen rather than choosing a specific value like 3, 4, 5, or 6. ...