Having trouble getting Bootstrap CSS to work with ASP.net?

After using the bootstrap alerts class, I noticed that the view is not what I expected - https://i.sstatic.net/HqAFV.jpg

Instead of that, I tried -

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

To fix this issue, I included the reference under the head tag like so:

<script src="Scripts/bootstrap.min.js"></script>

Even after adding the reference, it's still not working. Can someone please help me out? I'm new to webpage development.

Answer №1

To include the bootstrap CSS in your stylesheet, you have a couple of options:

If using a CDN:

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

Alternatively, if you want to host the file on your own server:

<link rel="stylesheet" type="text/css" href="*PATH_TO_YOUR_STYLE_FOLDER*/bootstrap.min.css">

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

Tips for avoiding the automatic focus on text fields that occurs when utilizing the placeholder attribute in HTML5

Imagine having a form with the placeholder attribute set as follows: <input type="text" name="something" placeholder="username" /> <input type="text" name="somethingelse" placeholder="password" /> Upon visiting the page with this form, the fi ...

Creating a menu bar in jQuery that functions similarly to tabs, but without the need to change divs

Currently, I am exploring ways to create tab functionality similar to jQuery's tabs plugin but without the need to switch between DIVs. Essentially, I am looking for a jQuery plugin that solely handles rendering the tab bar and allows me to designate ...

Customize the appearance of a <label> tag when it is inside an <input> tag that is marked as invalid

In an ideal scenario, I wish for the text on a label to change color when the input value is considered invalid. For instance: <form> <label> Enter your name: <input type="text"> </label> </form> Ideall ...

Is it possible to use CSS to create a gap between the cursor and the placeholder text within an input field?

Could you please assist me with a bug I have encountered on an older version of Firefox for OSX (37.0.2)? I have included a screenshot of the issue here: https://i.sstatic.net/dzK0G.png Is there a way to use css to move the first character of the placehol ...

A 4-image panel grid featuring a central blank space, perfect for an email template design

Attempting to replicate this 4-image layout like the one shown below, but facing challenges due to email template constraints that prevent the use of negative margins. I tried floating the images to the left and using: position: relative; top: -px; but i ...

Keep label at the forefront once input field is completed

Is it possible to keep my label positioned on top of the input field even after filling in data? I attempted using the valid function in CSS, but did not achieve the desired functionality. .txt_field input { width: 100%; padding: 0 5px; height: 4 ...

Using an npm package to include CSS styles in a stylesheet

I created an NPM package that includes a CSS file that needs to be included in my main CSS file. In a typical HTML CSS website, I would need to write @import url("./node_modules/web-creative-fonts/index.css") but what I really want is to simplify ...

The Bootstrap JavaScript file is failing to integrate with Angular 8

Within my assets folder, I have a bootstrap js file located at assets/js/bootstrap.min.js. I attempted to add it to my index.HTML page using the script tag <script src="assets/js/bootstrap.min.js"></script>, but it doesn't seem to be apply ...

Prevent span/button clicks by graying them out and disabling the ability to click using HTML and JQuery

I am facing a challenge with my two spans that reveal specific information when clicked. I want to make one span appear as a disabled button (greyed out) when the other span is clicked. I tried using $("#toggle-odd").attr("disabled", tr ...

Flex container scrollable element not functioning consistently between different browsers

Today, I've spent most of my time experimenting with various solutions but I'm facing difficulty making them work consistently across different browsers. My goal is to have 2 sections within a fixed div: the first section with a set height and t ...

What is the best way to center a heading element within a section on a webpage?

I need assistance aligning the h1 element with the specific class wish to the center of its section, both horizontally and vertically. Unfortunately, I have been unable to achieve this thus far. Any guidance would be greatly appreciated. Below you will fi ...

The AngularJS dropdown menu is refusing to expand

https://i.sstatic.net/GYpNe.png I have created a dropdown select menu using AngularJS's ng-options. The selection and submission processes are functioning correctly. However, as shown in the image, the dropdown menu does not collapse as intended; it ...

Troubleshooting Issue: Bootstrap 5 Navbar Dropdown Popper Functionality Not Function

I recently updated to the latest release of Bootstrap 5.3 and encountered an issue with my dropdown menu functionality. I have the necessary Bootstrap JavaScript file saved in a folder named bootstrap.js, along with the Popper script saved as popper.js. Th ...

Error in line 36: firebase.auth function is undefined

Snippet of index.html code <html> <head> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" ...

JavaScript: Retrieve the second value from a select dropdown menu

What is the method to retrieve and display the second value of "investortype" within "exploremax"? <script type="text/javascript> function $(id) { return document.getElementById(id); } function addCommas(nStr) // adds commas f ...

I am looking to upload an image to the database using ajax or any alternative method

I need assistance in uploading an image to a Spring Boot backend via AJAX or any other method. Below is the img tag and form I have implemented, along with an AJAX request to send form data. How can I include the image in this process? AJAX request (exclu ...

The CultureInfo class and the Double.Parse method, as well as the double.ToString method, did

Is there a way to ensure that a c# application always uses the "." as the decimal separator, regardless of server culture settings? I am encountering issues with double.ToString and double.parse. An exception is thrown in cases like double.parse("1/25") a ...

The line spacing is not functioning as expected

I'm looking to vertically align my text with my logo in a seamless manner. However, whenever I adjust the line height, it affects the positioning of my logo as well. Is there a way to only modify the text position while keeping the logo centered? Chec ...

Passing information from Silverlight to an aspx webpage

Is there a way to send data from my Silverlight application to an aspx page without passing parameters in the URL? I believe using a POST method would be the most appropriate solution, but I am unsure of how to implement it. Can anyone provide guidance o ...

Error encountered during W3 CSS validation: Parsing error

Upon attempting to validate the code snippet below: .cd-stretchy-nav ul a { (line 186) position: relative; display: block; height: 50px; line-height: 50px; padding: 0 calc(1em + 60px) 0 1em; color: white; opacity: 1; fon ...