margin

CSS margin quirks - please help me understand

When using margin on the child element (h2) why does it give margin to the parent(#box) instead? If I change margin to padding it works as expected. Did something change or am I missing something? here is my sample code <html> <head> <style> #box{ border-radius:10px; -moz-border-radius:10px; -webkit-border-radius:10px; height:200px; wi...

Floats and Margin Collapse

Hi, so I'm having a hard time understanding the circumstances under which a float can have margins collapse through it and how that affects the position of the float. I've included a page that seems to show two different behaviors in the same page. The red float seems to be positioned before the margins that collapsed through it, where...

Dreamweaver CS4; space to right of page

White space problem in Dreamweaver CS4 this time. I designed a page with a background image of 1024 x 1024. The page looks fine in the design window. When I preview in browser or upload to server the page has about 200 px of white space to the right. I've set the margins to '0' for the top, left, right and bottom. The space remains. N...

Margin on child element moves parent element

I have a div (parent) that contains another div (child). Parent is the first element in body with no particular CSS style. When I set .child { margin-top: 10px; } The end result is that top of my child is still aligned with parent. Instead of child being shifted for 10px downwards, my parent moves 10px down. My DOCTYPE is set to ...

Can't get rid of margin beneath CSS sticky footer

I'm using the CSS Sticky Footer technique described here, and have it sort of working. Problem is, in most of my pages it ads an extra 20px margin or padding at the very bottom, and I can't locate where that comes from. Here it is without the margin. Here it is with the margin. In the how-to it says that some extra margins might ge...

Get position of element by javascript

I've seen a dozen of script that can catch the x and y position of an element/object within the page. But i am always having trouble with catching the x and y when the webpage is using margins at the body, or other elements, absolute/relative elements, such like that. Is there a solution wich provides the exact position, no matter what ...

from where this unexpected bottom margin appears ?

hi! if you'll look here http://clients.ventu.co.il/getapp/ in IE7 there is a strange extra gap between the footer and the content above which isnt supposed to be there anyone can help me remove it? ...

CSS: how to make margin: 0px auto work

Hi! I am trying to center images inside another block: The html code looks like this: <ul> <li> <a href="/article/japanese-culture-one/"> <img src="/site_media/upload/fushimi-inari-fox_jpg_200x200_q85.jpg" alt="Лисица Инари - один из мифических персонажей культа синто"/> </a> <br /> <a href="/article/jap...

Mysterious problem with CSS and Internet Explorer 7

I think the myth that IE is a nightmare for web designers its true. IE7 is adding me some mysterious padding or margin on the left and right side of my div#image (the gray div) and the paragraph in the div#content is suffering from the CSS propieties of the h2 tag. Thanks in advance! edit: I even tried Eric Meyer's CSS Reset but it didn...

How do I uncollapse a margin?

Collapsing margins in CSS: http://www.w3.org/TR/CSS21/box.html#collapsing-margins I understand the purpose of the feature, but I'm trying to do layout, and I can't figure out how to turn it off. The way usually explained in CSS tutorials is to either: Add a border Add a padding All of these have side effects that become obvious whe...

Legendary Annoyance of IE6's margin and padding "behaviour" (Help!)

Everything is OK in Chrome, FF and IE8. But in IE6 there's a strange margin right below the div "middle-column" (inside it there are 3 divs called featured1, 2 and 3.) which is above the divs "left-column" and "right-column"). I already tried everything to get rid of that problem. I tried the "display: inline technique" and CSS resets. P...

Can I make Swing JButtons have smaller margins?

I prefer buttons with minimal margins, about as wide as their text caption. Is there a way to achieve that in a JButton in Swing? What I am seeing in practice now is that even if I try to use setMaximumSize() and similar, it just ends up eating the text caption, cutting it off to the right. But it does not reduce the margins. ...

iText(sharp) side margins width

Hello. It looks like I can't set left margin to be less then 42pt width. I am setting it to 0f but it always ends as 42pt. If I set margin to any number greater then 0 it just adds it to initial margin of 42pt. I am setting margin of document object: iTextSharp.text.Rectangle docRect = new iTextSharp.text.Rectangle(pageWidth, pageHeight...

CSS Top margin shrinks when window shrinks

Hello, I want a top margin for my webpage of say 100px when the window is maximised, but if the user resizes the window to shrink it I want this margin to shrink. The margin should have a minimum size of say 10px and should shrink in proportion to the window height. An example if what I am trying to emulate is http://www.bing.com/ Ho...

How can I change the margins on a PDF document created by Doxygen?

Hello, I am using Doxygen to generate a PDF of my code documentation. The PDF has very big margins when using PAPER_TYPE = letter. It looks ok when using a4wide but I would like to have more control over it. I want to use a package called geometry but can't figure out where to add code like this: \usepackage[top=2.9cm,left=2in,bottom...

Margin Problem with Chrome and Firefox 2

Have been searching for a solution to this problem for a while now. I'm creating a Wordpress based site: http://alturl.com/jw2i IE8 and Firefox 3.5 display everything correctly, but Chrome and Firefox 2 is ignoring my margin (margin-right:300px) on the scrolling div. Is there something that can be done to resolve this? Any help will be...

Window.Margin & Window.Padding don't work

hello. I am setting peroperty Margin and Padding of a window and it doesn't take effect: Here is an example: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" SizeToContent="WidthAndHeight" ResizeMode="NoResize" Padding="22" Margin="...

WPF: Why shouldn't I use {TemplateBinding Margin} in ControlTemplate - is Margin meant only for element's containers?

I have created my own ControlTemplate for Button, like this: <Style x:Key="LightButtonStyle" TargetType="{x:Type ButtonBase}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ButtonBase}"> <Border x:Name="WrappingBorder" Marg...

CSS - Margins a bad thing?

Hi, I've noticed that some browsers have trouble with margins, especially when an element is floated. For example, this website I'm doing looks fine in Firefox, but IE7 screws up the margins completely it seems. I also testet it on several Linux browsers as well and some of the make similar mistakes. The site is http://w3box.com/mat T...

Why would margin not be contained by parent element?

When an element with a margin is contained within another element, the parent does not consistently wrap that margin. Many things will cause the parent to wrap the child's margin: border:solid; position:absolute; display:inline-block; overflow:auto (And this just from small testing, no doubt there is more.) I would assume this has ...