Excess padding and margin issues in Bootstrap version 3.3

Currently, I am utilizing Bootstrap 3.3 to create a straightforward layout, following this structure:

For the body and html elements:

html,body{
    background: #fff;
    height: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
}

Additionally, on each child section, I have implemented the code below:

.section-name{
    height:100%;
}

This ensures that every section occupies 100% of the device screen size. However, I am encountering an issue where there is a noticeable gap between each section, as illustrated in the screenshots below:

Take note of the spacing between sections, shown in another screenshot:

To troubleshoot, I inspected the development tools in both Mozilla and Chrome, looking for any excessive padding or margin problems, but found none.

I also considered whether whitespace within my HTML could be causing the problem, eliminated the whitespaces, and still encountered the same issue.

I removed all Bootstrap CDNs temporarily to rule out any potential Bootstrap-related issues, only to discover that it was not caused by Bootstrap, as the problem persisted even with custom CSS.

Furthermore, I attempted the following:

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

However, even this adjustment did not resolve the padding issue.

Edit

View my issue on JsFiddle

Answer №1

It appears that I have identified the solution - there was a h2 inside your .section name that had a margin-top of 20px.

Here is the link to the js fiddle:

.section-title {margin-top:0px;}

http://jsfiddle.net/u2ttpkhg/1/

Answer №2

It would be helpful if you could provide a fiddle, but here are some tasks that I often need to address:

Make sure to check the parent elements as well.

Are you using a jumbotron? If so, it includes top and bottom padding of 48px (via media query), so make sure to take that into consideration. Bootstrap comes with default classes that sometimes add unwanted paddings and margins.

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

Deactivate the attribute in the media query

I made some website with pure html/css. I defined overflow-y: scroll to some element when browser is full screen. But when screen's width is less than 400px, I want to disable that. (like, overflow-y: none. But overflow-y doesn't have none) Is ...

Stop specific words from being entered on a website

Is there a way to block a specific word from being saved in my database? For example, if I want to prevent the term 'fast car' from being stored, what kind of code should I implement using HTML, JavaScript, or PHP on my website? ...

How can I filter a list using a checkbox form with PHP and SQL?

My task involves filtering the search results of a form on another page, based on the jobtype variable in a MySQL table using checkboxes and a sorting form. Even though the table contains multiple submissions with jobtype variables, selecting those option ...

There seems to be a display issue with the DataTables tables

Utilizing Bootstrap 4, I followed the example provided by DataTables on their website: link. The specific code that was implemented can be found here: link Take a look at how it appears: http://pastebin.com/HxSNUnLq Any suggestions on how to resolve th ...

Selenium failing to input text into field

My goal is to extract data from the following URL: There are three key components to this extraction: Choosing the correct game type under "Valitse peli" I want to select "Eurojackpot" for this. Setting the date range using variables. Currently, I hav ...

Loading a Div Element on the Fly

I have a variety of checkboxes that are generated through iteration from a collection using the foreach loop of the core tags in JSP with parameters ID (which represents the ID of the checkbox) and key. Both the ID and key are dynamically populated based o ...

Vuejs responsive navbar with collapsible sidebar using Bootstrap or Bootstrap-Vue libraries

Vue.js is the framework I'm utilizing for my current project. In creating a dashboard section, I am seeking to implement a responsive design using either bootstrap, bootstrap-vue, or plain HTML and CSS. Below are the images of the desired dashboard -& ...

The AddClass function does not work properly in the Kendo Tree View after the RemoveClass function, especially when selecting the same node

Hey there, I am currently working with a kendoTreeView and trying to set up an action triggered by clicking on the same selected node. To achieve this, I incorporated the following code in the change event: change : function(e) { $ ...

Looking to extract latitude and longitude data using an Autocomplete Address Form

I am currently attempting to utilize Google Maps autocomplete feature in order to save latitude and longitude. Unfortunately, I am encountering difficulties in making this functionality work as intended. Given that I am unfamiliar with the Google Maps API, ...

The functionality of Bootstrap toggle ceases to operate properly following an AJAX content update

I am currently using AJAX load to fetch some content on my webpage. I am working with Bootstrap 3 and Bootstrap toggle. When the content is loaded, the Bootstrap 3 content functions properly (the panel-primary panel is clearly visible). However, the Bootst ...

What could be causing the unexpected behavior of the flex property?

Check out the code snippet below: @import url("https://fonts.googleapis.com/css2?family=Inter&display=swap"); @import url("https://fonts.googleapis.com/css2?family=Lexend+Deca&display=swap"); * { box-sizing: border-box; margin: 0; padding: ...

Updating dropdown menu selection after successful form submission validation

I'm currently working on a PHP sign up/registration form that retains and resubmits user input if validation fails. Although I have successfully implemented text boxes, password inputs, and radio buttons, I am encountering some challenges with the dro ...

When a link has text-transform set to uppercase, the LinkText function may not work properly

While working on a project with Selenium, I encountered an issue where a test case created using the Selenium IDE and converted to WebDriver did not run as expected when executed using NUnit. Upon further investigation, I discovered that on the webpage be ...

Decrease the size of the mat-flat-button

I have a message board where I am trying to incorporate delete buttons. However, when using the mat-flat-button feature, it appears to be increasing the height of the message items. If I adjust the button's height to 50%, then the button becomes half ...

After applying sorting, jqGrid displays an empty space below the final row

Having an unusual problem with sorting in the jqGrid. When I sort in descending order, there is extra space below the last row, but when I sort in ascending order, the table ends abruptly at the bottom without allowing any further scrolling. I have includ ...

Ways to conceal table rows depending on their content

I am currently developing a project using Angular 2. One of the features includes a summary section that consolidates all the data from other sections. The summary is presented in a table format, with each row displaying the field name in the first colum ...

Error message displayed: "The timer function encountered an issue as second_input is found to be null."

var idinterval; var second_input_value = document.getElementById("Seconds"); var minute_input_value = document.getElementById("Minutes"); var second_val = second_input_value.value; var minute_val = minute_input_value.value; var total_time = parseInt(minut ...

Customize the appearance of every other column in an asp gridview

Looking for help with formatting rows and columns in an ASP GridView. The rows are automatically colored alternating, and I want to make the content in every first column bold and every second column normal. I have heard about using CSS nth-child() to achi ...

Is it possible to determine if a web page is designed for a personal computer or a

Is there a way to identify whether a given URL is intended for PC or mobile devices? I have a collection of URLs, and I need to determine if each one corresponds to a PC or mobile version. Is there any specific HTML element or marker within the page sour ...

What could be the reason my HTML5 application is not working offline on my android device?

Hello, I am encountering a problem and I could really use your assistance in figuring out what I am missing. There is a webpage that showcases numerous HTML5 mobile/web applications which can be found at For instance, let's look at this app where yo ...