margin

How to remember in CSS that margin is outside the border, and padding inside

I don't edit CSS very often, and almost every time I need to go and google the CSS box model to check whether padding is inside the border and margin outside, or vice versa. (Just checked again and padding is inside). Does anyone have a good way of remembering this? A little mnemonic, a good explanation as to why the names are that wa...

What is the .NET Control.Margin property for?

i assumed that the C# margin property had a meaning like in CSS - the spacing around the outside of the control. But Margin values seem to be ignored to matter what values i enter. Then i read on the SDK: Setting the Margin property on a docked control has no effect on the distance of the control from the the edges of its con...

CSS Margin Collapsing

Hi, So essentially does margin collapsing occur when you don't set any margin or padding or border to a given div element? ...

Where do you put your CSS Margins?

When you want to add whitespace between HTML elements (using CSS), to which element do you attach it? I'm regularly in situations along these lines: <body> <h1>This is the heading</h1> <p>This is a paragraph</p> <h1>Here's another heading</h1> <div>This is a footer</div> </body> Now, say I wanted 1em of space between each of ...

detecting true border, padding and margin from Javascript

Is there a way to detect the true border, padding and margin of elements from Javascript code? If you look at the following code: <html> <head> <style> <!-- .some_class { padding-left: 2px; border: 2px solid green; } --> </style> <script> <!-- function showDetails() { ...

What is wrong with this simple CSS in IE?

There is a div that has inner content, a div with a border that's inside a div. Somehow, this div is expanded to encompass the next div. It blows my mind. <div style="background: yellow;"> <div> <div style="border: 1px solid black; background: green">green background</div> </div> </div> <div style="margin-top: 100px;"> IE gi...

IE background display problem

Hello, I'm creating a website for my church and I'm having problems making it display right in IE. It seems that my div "sidebox" is having its background position overridden by the "margin: 0 auto;" as the background displays centered rather than on the right, which is shifting the site to the right. Here's the code: .sidebox { marg...

Are Margin and Padding implemented by ContentControl?

Hi, I am developing a custom control derived from System.Windows.Controls.ContentControl. In the controls default template (themes\generic.xaml), I use a Border element that wraps the actual content. Does my custom control already implement margin and padding (i.e., shrink the border according to the padding set on the custom control) ...

CSS margin-bottom collapsed - but why?

Hello, I have this simple xhtml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" style="height: 100%;"> <head> </head> <body style="height: 100%;"> <div style="height: 100%; overflow: a...

Why does XAML Margin not follow CSS norm?

In CSS the margin order is: top right bottom left In XAML the margin order is: left top right bottom Is there a reason why the WPF team didn't align this to the CSS norm? ...

IE7 : an excessive margin in form for textarea

I am trying to deal with an IE7 bug in my application. Here is the HTML/CSS code <div style="margin-left: 320px"> <form method="post" action=""><fieldset> <textarea name="prj_comment" id="prj_comment" rows="5" cols="50" style="margin: 0; padding: 0"></textarea> </fieldset></form> </div> In Firefox/Op...

CSS box model (margins and padding) for vertical spacing between paragraphs

How should CSS 'margin' and 'padding' be used for vertical inter-paragraph spacing: Can the vertical space between paragraphs be defined using padding and/or using margins? If it can be done with either, then which is the better or more normal one to use? Do you tend to define non-zero padding and non-zero margins, and if so then how m...

margin and padding are causing issues calculating layout

I am having this issue where I am not getting the true offset in IE6. I am using the offset to position a pop-in. The CSS is something like this: .container50-50-right-border { } .container50-50-right-border .title {padding: 0px; margin: 0px; clear: both;} .container50-50-ri...

Why does IE7 display my webpage incorrectly?

If you look at www.kwikhousesale.co.uk in any FF, Google Chrome, Opera, IE8 etc. it displays fine. However, when using IE7 all the text shifts to the right resulting in much of the text appearing off the page. Please could somebody help me to resolve this issue? ...

margin-top property in CSS

Why does margin-top value not work in IE? Works fine in FF and Safari. Here's the link Thanks ...

CSS: How can I overcome negative margin and absolute position issues in IE6?

I'm using absolute positioning and negative margins (with top: and left:) to position logos and other such things in my website. I'm aware that IE6 has problems with negative margins and absolute positioning, how can I overcome these issues to ensure they work correctly in IE6? ...

CSS Cell Margin

In my HTML document, I have a table with two columns and multiple rows. How can I increase the space in between the first and second column with css? I've tried applying "margin-right: 10px;" to each of the cells on the left hand side, but to no effect. ...

footnote spacing in LaTeX

I'm writing my dissertation and the grad school says I need a space between multiple footnotes and also the space between the text and the start of the footnotes is too small. Is there a way to do this? Any help is greatly appreciated. ...

CSS : Margin Auto

Hi folks, how to fix the margin spaces on IE? Here the code. IF you open this file on modern browser all working great and will have a space for 20px on the bottom. But in IE nothing space. Let me know the trick to fix this thing. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-tr...

Margins to shift boxes evenly

I have this code: <style type="text/css"> body > div { height: 260px; overflow: hidden; } div div { float: left; height: 250px; width: 250px; margin: 1px; background: #ccc; } </style> <div> <div>first 1</div> <div>first 2</div> <div>first 3</div> <div>first 4</div> <div>first 5</div> </div> I wonna give ma...