Different Vertical Spacing among Divs in Chrome Versus IE

Here's an interesting issue I'm facing - my layout works fine in Internet Explorer but not in Chrome! In Chrome, I'm seeing some extra vertical spaces between divs which is not the intended behavior. The divs are supposed to sit flush against each other.

I had originally set a min-height attribute that caused some width errors, so I removed it. However, I'm still unsure about what is causing this spacing problem.

Any suggestions or help would be greatly appreciated! Thank you all, -BR

CSS

#container {
    width: 100%;
}

#headerout {
    width: 100%;
    height: 100px;
    background: #1240AB;
}

#header {
    width: 1000px;
    margin: auto;
}

.splitout {
    width: 100%;
    height: 225px;
}

.split {
    width: 1000px;
    margin: auto;
}

.content {
    width: 750px;
    margin: auto;
}

.white {background-color: #DDE3F0;}
.lightblue {background-color: #C9D5F0;}

#footerout {
    width: 100%;
    height: 30px;
    background: #1240AB;
}

#footer {
    width: 1000px;
    margin-left: 25px;
}

Markup

<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<meta charset='utf-8'>


</head>
<body>
<div id="container">
    <header>
        <div id="headerout">
            <div id="header">
                <p>Content<p>
            </div>
        </div>
    </header>

    <div class="splitout white">
        <div class="split">
            <div class="content">
                <p>content</p>
            </div>
        </div>
    </div>

    <div class="splitout lightblue">
        <div class="split">
            <div class="content">
                <p>content</p>
            </div>
    </div>
</div>

<div class="splitout white">
    <div class="split">
        <div class="content">
            <p>content</p>
        </div>
    </div>
</div>

</div>
<div id="footerout">
<div id="footer">
    <p>foot</p>
</div>
</div>

</body>
</html>

Answer №1

Avoid using css-reset.

It is recommended to use normalize.css for better styling consistency:

For more information, refer to this link:

This can help in resolving various "bugs".

Answer №2

To resolve the issue with paragraph margins, it is recommended to implement a css-reset.

http://example.com/cssreset

An easy-to-follow example of a css reset:

* {
  margin: 0;
  padding: 0;
}

By default, Chrome includes margins for paragraphs which can be adjusted with a css reset.

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

Why does the col-sm-* class affect the appearance on extra small screens?

For a current project, I have incorporated bootstrap into my design and have set up varying column widths for xs, sm, and md screens. Initially, I utilized col-xs-* and col-md-* to ensure the columns resized appropriately for xs, md, and lg screens. Howeve ...

Pair of input fields consolidated under a single label

Take a look at the scenario below: <label>Range from <input name='min_value'/> to <input name='max_value' /> </label> Is this structurally correct according to the W3C guidelines which specify that a l ...

What is the best way to ensure that an image fills the entire page in Bootstrap 4 by setting a maximum height for both the column and container

I am facing an issue with displaying two columns in a row using Bootstrap 4. I want the image to take up the entire screen space. Here is my code snippet: <div class="container-fluid" style="padding-left:0px;"> <div class="row"> ...

Create a randomly generated value in a JSON format

{ "description": "AppName", "name": "appName", "partnerProfile": { "email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f19090b1969c90989ddf929e9c">[email protected]</a>", "firstName": "John", ...

How to fetch select element within a table by using jQuery

I encountered a situation where I have a table element with a select element inside its td. The id of the table (in this example, it is "table1") could potentially change. So my query is, how can I retrieve the selected option using the table ID in JQuer ...

Joomla CSS styling malfunctioning

I've been exploring the creation of an in line menu using Joomla 1.6 and CSS. The issue arises when Joomla removes <span class="dmenu"> from the document before saving, despite having all cleanup options turned off. This led me to try a couple ...

Maintain Open State of Toggle Drop Down Menu

Having an issue with the toggle down menu or list on my webpage. The problem is that the menu is constantly open (the #text_box) when the page loads. My intention was for it to be closed initially, and then open only when the user clicks on the 'Ope ...

Sending an ID from an array within a *ngFor loop to a different component in Angular: a step-by-step guide

I have a collection of items that I loop through using ngFor. My goal is to pass all its attributes to another component. I attempted to accomplish this with the following code: *ngFor='let item of postList [routerLink]="['/detailed-post&ap ...

Remove Bootstrap-Table's box-shadow on the search bar's delete button

Is there a way to eliminate the box-shadow from the search box upon clicking on it? I am familiar with removing box-shadows from classes in CSS, but I am unsure of how to remove the box-shadow from a specific property like "data-search" within the tag. ...

Having trouble displaying images in Express JS

Here are the lines of code that I wrote in Express: res.write("The current temperature is "+temp+". "); res.write("Weather is currently "+weatherDes); res.write("<img src=" +imageURL+ ">"); res.send() ...

Guide on showcasing a dynamic variable in the title of an HTML page

Recently, I've been dedicating my time to designing an HTML page and now I'm interested in showcasing the dynamic value of a JavaScript variable following some text in the title. For instance: ___/TEXT :: TEXT: var \ _________ I&apos ...

Track the number of HTML5 drag and drop operations by adding a counter to your HTML form

I've implemented a cool feature on my web page where users can drag list items into a dustbin, and the item gets eaten up by the dustbin. The interaction works perfectly thanks to the code I already have in place. Now, I'm looking to add a counte ...

Switch between the table data elements in an .hta document

The response provided by Dr.Molle in a previous post here was accurate, but it only functioned with <div>. I am required to utilize <table>. Though I found a script that works flawlessly outside of my VBScript, it does not work when embedded in ...

What is the best way to align content at the center on mobile using Bootstrap 5?

I'm struggling to center elements on mobile devices, even though they look fine on desktop. Desktop: https://i.sstatic.net/I6Rtf.png Mobile: https://i.sstatic.net/4a1zS.png Desired mobile: https://i.sstatic.net/uMrEa.png I am using Bootstrap 5.3 ...

Engage in a conversation with a specific individual on the internet using node.js

Looking to implement a chat feature with specific online users similar to Facebook or Gmail using node.js and socket.io. Can anyone assist me with this? Thanks in advance! Client.html <html> <head> <title>My Chat App</title> <d ...

Unable to get Bootstrap 4 overflow hidden to function properly within card layouts during animated transitions

In my project, I have an image inside a card layout and I am working on implementing a zoom effect on mouseover. However, I am facing an issue where during the animation, the image overflows from its parent wrapper. After the animation is completed, the ov ...

Hover effect on nested divs with the same structure

Check out this link: http://jsfiddle.net/2hDB9/ I'm trying to achieve the following effect: When hovering over Line 1, only the border of Line 1 should show. If you hover over Line 2, only the border of Line 2 should be displayed, not both at the s ...

Choosing between using a style tag or style attribute for jQuery scrollbar customization can depend

In this dilemma, I encountered an issue where setting the width and height in the style attribute of a div resulted in the dimensions being automatically adjusted to fit the content size. However, when I specified the width and height in the style tag, i ...

What is the best way to make AngularJS acknowledge invalid input that has already been identified by the browser?

Encountering an issue (specifically in Chrome) where a number input is deemed invalid by the browser, but valid as per Angular. <form name="form_name"> <input type="number" step="any" id="a_number" name="a_number" min="0" ng:model="aN ...

What could be causing the nth-child selector to malfunction in CSS?

I am having an issue with my CSS code using the nth-child selector to assign border colors to different social media links within a list group. Can you help me find out what I'm doing wrong? .list-group-item:nth-child(1) { border-right: 3px ...