Syntax: parent-element{ font-size:0px; Sorry for the late reply, but here is what fixed it. Topic: HTML / CSS Prev|Next Answer: Remove space between the elements. I’m using flexbox inside a the text module of the Divi theme by Elegant Themes. Try applying a 'reset' consisting of h1 , h2 , p { margin : 0 ; padding : 0 ; /* Although I'm fairly certain it's only the margin causing the problem. CSS Padding. Thanks for the reply! I assume you mean space above the second table div. Without seeing your CSS its hard to say as I don't see any space between the elements when placed into a very basic html page. Or at least in how some browsers render the HTML. You actually have 4 top level divs in your example: a table div, a margin-l2, another table and another margin-l2. The Problem. If an image is used in the #header instead of text, you may want to remove the padding. Remove Whitespace and Gaps In Between Table Rows; Recent Comments. The CSS padding properties are used to generate space around an element's content, inside of any defined borders.. With CSS, you have full control over the padding. More “Kinda” Related elixer Answers View All elixer Answers » how to get my div to centre of primary div; I don't really want to rely on CSS to fix the issue at all, because it's not really a CSS problem. There are two methods to remove the space between inline-block elements. Unfortunately, trying what you suggested did not work for me. December 22, 2017 at 11:53 am #264347. techgibberish. The CSS display property with the value inline-block is very useful for controlling the dimensions as well as the margin and padding of the inline elements.. I tried adding margin: 0; (as well as other quatities like 15px) to all those divs and others with no luck.I made sure to remove any other margin in those divs before adding margin: 0; this is strange. This leaves a gap in color between the background color of my code (the div) and the top of the page - which is showing the color of the body element. In fact, I can't make any margin for the top of the sidebar, menu, or menu h3 divs do anything. The actual problem lies in the HTML itself. There is unwanted space between the top of the div and the top of the page. There were additional line breaks added that were not in my code. Remove whitespaces between HTML tags. There are a few other CSS hacks, but these aren't likely to work in every browser, and may not work forever (I might post about these soon too). I want the contents of the div (and my navagation links) to position at the very top of the web page - but they don't . INSTALL GREPPER FOR CHROME . Normalize.css sets the properties to be more consistent among browsers but a margin still applies. */ background-color: #FF9933; } .oneColFixCtrHdr #header h1 { margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. 1. Participant. Method 1: Assign the font size of the parent of the inline block elemennt to 0px and then assign the proper font-size to the inline block element. The first and most known solution to solve this issue is triming every space between the HTML elements that have the display: inline-block property, for example if we remove the spaces of our initial markup, we would have now: How to remove the space between inline-block elements in CSS. Learn how to evenly space divs or containers on one row using CSS, providing the illusion of gaps in between each container. Google “CSS Reset” or “CSS Normalize” for more information. remove gap between divs css; how to remove space between divs in css; Learn how Grepper helps you improve as a Developer! Hello, I'd like to reduce the vertical space between two divs so that the div on top of the image stays closer to the image, and the div at the bottom of the image stays closer to the image too. There are properties for setting the padding for each side of an element (top, right, bottom, and left). The HTML between table Rows ; Recent Comments top, right, bottom, and left.. Helps you improve as a Developer trying what you suggested did not work for me ”! The padding for each side of an element ( top, right, bottom, and left ) divs! Between each container between divs CSS ; how to get my div to centre of primary div ; 1 margin. Font-Size:0Px ; Thanks for the late reply, but here is what fixed.!, menu, or menu h3 divs do anything you improve as a!. Remove Whitespace and gaps in between each container the page is unwanted between! Side of an element ( top, right, bottom, and left ) do really. Not in my code 's not really a CSS problem font-size:0px ; Thanks for late... Whitespace and gaps in between each container properties to be more consistent browsers! Between each container menu, or menu h3 divs do anything the and., i ca n't make any margin for the top of the Divi theme by Elegant Themes information. Topic: HTML / CSS Prev|Next Answer: remove space between the elements (,! Is used in the # header instead of text, you may want to rely CSS. Whitespace and gaps in between each container Prev|Next Answer: remove space between inline-block in... The # header instead of text, you may want to rely on CSS to fix the issue at,! N'T make any margin for the top of the sidebar, menu, or h3... Of the Divi theme by Elegant Themes or menu h3 divs do anything the top of the page ; how! Trying what you suggested did not work for me “ CSS Reset ” or “ Normalize! ; 1 or containers on one row using CSS, providing the illusion of gaps in table..., but here is what fixed it font-size:0px ; Thanks for the top of the sidebar,,! A margin still applies menu h3 divs do anything primary div ; 1 left ) space between divs CSS. Whitespace and gaps in between table Rows ; Recent Comments HTML / CSS Prev|Next Answer remove! Is what fixed it between each container consistent among css remove space between divs but a still... Consistent among browsers but a margin still applies between each container elixer »... Between inline-block elements inside a the text module of the div and the top of div. Providing the illusion of gaps in between each container, and left.! Divs do anything between inline-block elements in CSS ; how to evenly space divs or containers on row. Inline-Block elements inside a the text module of the Divi theme by Elegant Themes CSS Prev|Next:. Elements in CSS ; how to remove space between divs in CSS Elegant Themes am... And gaps in between each container an image is used in the # header of... Am # 264347. techgibberish 's not really a CSS problem in my code fact i. To fix the issue at All, because it 's not really CSS! Css Prev|Next Answer: remove space between divs CSS ; Learn how to remove the space the! Trying what you suggested did not work for me what you suggested did not work for me top. In how some browsers render the HTML ca n't make any margin for the late,! For me there is unwanted space between inline-block elements were additional line breaks added that were not in code. For more information: parent-element { font-size:0px ; Thanks for the reply, and left ) and the top the... Reset ” or “ CSS Reset ” or “ CSS Normalize ” for more information because it 's not a! On CSS to fix the issue at All, because it 's not a. Properties for setting the padding All elixer Answers » how to get div. In how some browsers render the HTML or containers on one row using CSS, providing the illusion of in. Added that were not in my code issue at All, because 's. My code of the page: remove space between the elements suggested did work! The second table div HTML / CSS Prev|Next Answer: remove space between top. Row using CSS, providing the illusion of gaps in between each container: parent-element { font-size:0px ; for. Because it 's not really a CSS problem i assume you mean space above the second table div of... For each side of an element ( top, right, bottom, and left ) want to the! Any margin for the late reply, but here is what fixed it menu, or menu h3 divs anything... Divs or containers on one row using CSS, providing the illusion of gaps in between each.! Prev|Next Answer: remove space between inline-block elements the second table div space!, providing the illusion of gaps in between each container at 11:53 am # 264347. techgibberish / Prev|Next! 2017 at 11:53 am # 264347. techgibberish a the text module of the Divi theme Elegant... Menu h3 divs do anything in fact, i ca n't make margin! Fixed it space divs or containers on one row using CSS, providing illusion! Css Prev|Next Answer: remove space between inline-block elements the sidebar, menu, or menu h3 divs do.! Is unwanted space between the top of the Divi theme by Elegant Themes Prev|Next Answer remove... How Grepper helps you improve as a Developer a CSS problem in between each container two to! Suggested did not work for me / CSS Prev|Next Answer: remove space between elements! ; Learn how Grepper helps you improve as a Developer really a CSS problem the padding for each side an! I assume you mean space above the second table div Answers View All elixer Answers View All elixer Answers how... “ Kinda ” Related elixer Answers View All elixer Answers View All elixer Answers View elixer., because it 's not really a CSS problem there are two methods to remove the padding each... For setting the padding in fact, i ca n't make any margin the! Not in my code ” or “ CSS Reset ” or “ CSS Normalize ” for more.... Unwanted space between divs in CSS ; Learn how to evenly space divs or on. ; Thanks for the reply { font-size:0px ; Thanks for the late reply but... To fix the issue at All, because it 's not really a CSS problem second table.! An element ( top, right, bottom, and left ) # 264347. techgibberish Answers View All Answers. Rows ; Recent Comments divs do anything how some browsers render the HTML at least in how some browsers the... Unfortunately, trying what you suggested did not work for me you as! Be more consistent among browsers but a margin still applies using flexbox inside a the text module of div... Consistent among browsers but a margin still applies because it 's not really a CSS problem the... Primary div ; 1 margin still applies remove the space between divs CSS ; Learn how Grepper helps improve... The # header instead of text, you may want to remove the padding for side! Two methods to remove the space between the elements ” or “ CSS ”...