Adjust the dimensions within the class in bootstrap

Objective:
My goal is to adjust a CSS code to be 700 instead of 870, based on the second image.

Challenge:
Currently, the default value is set at 870 (as shown in picture 1), but I need to use CSS to change it to 700.

I attempted to make this adjustment but was unsuccessful.

Additional Information:
I am working with Bootstrap version 2

https://i.sstatic.net/HJaTQ.png

https://i.sstatic.net/bA1U2.png

Answer №1

To steer clear of having to use !important (which I strongly dislike unless it's absolutely necessary as it contradicts the fundamental concept and approach of Cascading Style Sheets!), consider refining the styling of span9 with more specific parent/child selectors...

Is there a particular parent class that can be utilized? Even if it's within the body tag? This will take precedence over BootStrap's default styling.

CSS:

.parentclass .span9 {
    width: 700px;
}

Additionally, it is crucial to ensure that your custom CSS file is linked AFTER your BootStrap files.

EDIT - To make sure your updated style is compatible with BootStrap's defined viewports, utilize @media queries in this manner:

@media (min-width: 1200px) {
    .parentclass .span9 {
        width: 700px;
    }
}

Keep in mind that BootStrap 2 also includes the following media query which affects span classes for the specified sizes:

@media (min-width: 768px) and (max-width: 979px)

Within this @media query, .span9 adjusts to 538px, so make any necessary adjustments... Just follow the same approach:

@media (min-width: 768px) and (max-width: 979px) {
    .parentclass .span9 {
        width: XXXpx;
    }
}

For dimensions below 767px, span classes occupy the entire width (100%), eliminating the need for further modifications...

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

How to achieve striped columns with Bootstrap 4.0 instead of striped rows

Here is how my table currently looks with the implementation in place: https://i.sstatic.net/b7onC.png Since my data is displayed vertically, I am interested in adding stripes to the columns or implementing some CSS hovering effect when the mouse is over ...

Has the submit button become inactive once it has been inserted into a collapse?

I have recently implemented a collapse feature and inserted a form into it, but unfortunately, the submit buttons are not functioning properly. They are failing to send the data to the PHP file. <div class="container"> <div class= ...

Gridview displaying varying border styles in CSS

I'm really struggling with this issue. I have a GridView and I want to ensure that the borders are consistent across all browsers. Right now, I'm experiencing different outcomes in IE, FF, and Chrome. Despite my best efforts with CSS (I'm re ...

Hiding divs toggle off when either all or only one is selected

In a certain page, there is a script that displays a div when a user selects an option. The script functions correctly, except for a scenario where if the user selects 'd' (which shows 'a', 'b', and 'c'), and then se ...

javascript with python

Currently, I'm in the process of parsing a html page. I've experimented with spynner, selenium, and mechanize, however none of them have been effective when dealing with JavaScript in this particular scenario. Is there anyone who can provide som ...

Overrides of variables are not always complete

After setting up my project with npm install to utilize sass overrides, I encountered an issue. Despite adjusting the $theme-colors, only part of the page reflects the change. https://i.sstatic.net/xjrsx.png I attempted the following: $theme-colors: ("p ...

Optional parameters in Sammy.js

Utilizing ajax for paging has led me to choose Sammy.js, which works well. However, incorporating checkboxes to filter results poses a challenge. While defining a route for Sammy to intercept is feasible, the issue arises when I wish to avoid displaying ce ...

I'm curious about how to use JQuery to pinpoint the firstName within a JSON String and retrieve its corresponding ID

Does anyone have an idea about the outcome in the alert? Is it a regular string, an object, or JSON? How can I select one of the entities and find another based on that selection? For example, I want to choose the first name and retrieve the ID from it. It ...

Is it possible to display a React Component code within a <code> tag?

I am in the process of creating a tester page that allows users to interact with a library component and document how it is being used. Here is the library component: render = () => { let component = ( <Slider onSlid ...

Find matches between elements based on their names or alt tags and retrieve the associated data

UPDATED FOR BETTER UNDERSTANDING--- I am managing a blog where I want to link images automatically to products in my store. These links will be based on an array generated by Shopify. While I don't have extensive knowledge of jQuery and JSON, I beli ...

How the Bootstrap 4 navigation bar impacts the layout of your content

I am facing an issue where the content on my page is being pushed down by the navbar, resulting in a small scroll gap at the bottom of the page. https://i.sstatic.net/6oLTY.jpg I want all the content to fill the page without having an unnecessary scrollb ...

Different Types of Buttons in HTML

As someone who is new to the world of HTML coding and JavaScript, I have a question about button types. According to the W3Schools website, there are three types of buttons: <button type="button|submit|reset"> First question: Why do we need a for ...

Can HTML5 be used to interact with a WebApi REST service?

My main query is whether it is feasible to access a WebAPI Rest services (such as a CRUD developed by myself) using HTML5? I am troubled by the fact that whenever I attempt to use an ActionResult in any WebApiController, the framework restricts me from d ...

What is the reason that the values in the select option only appear once it has been clicked on?

After loading or reloading the page, I am experiencing an issue where the select options do not appear on the first click and the values are not displayed until the second click. Any assistance would be greatly appreciated! I am still new to coding, so ple ...

"Adjusting the Width of Elements on Nexus 4 with CSS

I'm having trouble adjusting the width of my body to match the size of my Nexus 4 screen, which is supposedly 768px. However, I notice that when the phone is upright, I can still scroll to the right quite a bit... Even if I reduce the width to 384px, ...

Tips for revealing a hidden button on a modal following a successful AJAX request

I've been attempting to reveal a hidden button after a successful ajax call, but I haven't had any luck so far. Any assistance would be greatly appreciated. Thank you for your time. $.ajax({ url: URL, type: 'GET', ...

The sizing of Bootstrap Inline dropdown menus is not accurate

I want to create two dropdown menus using Bootstrap v3 that are displayed side by side with a specific width and utilizing the grid system. However, I am facing an issue where the width remains the same. Here is an example of what I mean: .menuList > ...

Create an input field that limits the user to typing only three unique characters

How can I restrict the user to input only three characters in a text field? Specifically, I want to limit it to either 3, 6, or 9. ...

What is the best way to implement responsive html within the Avada theme?

Greetings! Is there a way to apply HTML/CSS code in the Avada theme on WordPress while ensuring it is responsive? Kindly refer to this image. https://i.sstatic.net/GMmg7.jpg ...

Accessing a URL with multiple namespaces in Django

I am looking to utilize a multi-level URL structure that consists of an app name, namespace, sub-namespace, and view name. In my scenario, I have an application named portfolio_menu which includes store.urls. Inside the store.urls, there is another set of ...