margins

Cross-browser Issue: Min-height and collapsing margins

戏子无情 提交于 2019-11-28 11:35:34
As you can see in this simple example: <div id="minheight"> <p id="margin">Paragraph with a margin</p> </div> <div id="sibling">Sibling div</div> #minheight { min-height: 100px; background: red; } #sibling { background: blue; } http://jsfiddle.net/peterbriers/B43th There is a difference between Chrome (35) and Firefox (29) in how it handles the collapsing margins on a block with a min-height that is larger than the child's margin . I tried to fully understand the specifications: http://www.w3.org/TR/CSS2/box.html#collapsing-margins , but I'm still unsure which browser handles this correctly. I

How to set a top margin only in XAML?

China☆狼群 提交于 2019-11-28 07:58:00
I can set margins individually in code but how do I do it in XAML, e.g. how do I do this: PSEUDO-CODE: <StackPanel Margin.Top="{Binding TopMargin}"> Kent Boogaart The key is to realize that setting it in code like this: sp2.Margin = new System.Windows.Thickness{ Left = 5 }; is equivalent to: sp2.Margin = new System.Windows.Thickness{ Left = 5, Top = 0, Right = 0, Bottom = 0 }; You can't set just a single value in a Thickness instance through either code or XAML . If you don't set some of the values, they will be implicitly zero. Therefore, you can just do this to convert the accepted code

Java Swing - setting margins on TextArea with Line Border

痞子三分冷 提交于 2019-11-28 07:50:24
问题 As the title says, I am simply trying to set the margins (provide some padding) on a TextArea with a LineBorder set. Without setting the Border, .setMargins works fine. Here is the specific chunk of code. aboutArea = new JTextArea("program info etc....."); Border border = BorderFactory.createLineBorder(Color.BLACK); aboutArea.setSize(400, 200); aboutArea.setBorder(border); aboutArea.setEditable(false); aboutArea.setFont(new Font("Verdana", Font.BOLD, 12)); add(aboutArea); I have tried each of

Automatic adjustment of margins in horizontal bar chart

半腔热情 提交于 2019-11-28 07:42:57
I need to produce a series of horizontal grouped bar charts. The barplot function does not automatically adjust the margins of the plot, therefore the text gets cut off. graphics.off() # close graphics windows test <- matrix(c(55,65,30, 40,70,55,75,6,49,45,34,20), nrow =3 , ncol=4, byrow=TRUE, dimnames = list(c("Subgroup 1", "Subgroup 2", "Subgroup 3"), c( "Category 1 Long text", "Category 2 very Long text", "Category 3 short text", "Category 4 very short text" ))) barplot(test, las=2, beside = TRUE, legend=T, horiz=T) I can't find an option to automatically move the plot further to the right,

CSS margin pushing the body element

心不动则不痛 提交于 2019-11-28 01:59:25
I'm setting a margin for a div element, however the body element also gets that margin. Consider this code: <!-- HTML --> <body> <div> </div> </body> <!-- CSS --> <style> html,body { height:100%; margin:0; padding:0; outline:1px solid blue; } div { margin:20px; outline:1px solid red; } </style> This is the result and the problem: So far I've solved the problem by adding a border:1px solid transparent; property to the body element. This ruins the 100% height because scrollbars appear due to the 1px border. Why does this happen? POSSIBLE SOLUTION (thanks for the help): Add a padding-top:1px and

Vertical margins disappear when parent is set to overflow:visible

僤鯓⒐⒋嵵緔 提交于 2019-11-28 01:17:36
问题 Why do vertical margins disappear when the parent is set to overflow:visible? If it's set to overflow:hidden margins are visible again. It seems counterintuitive. I think I understand how overflow is supposed to work when content of an element can't fit into it, but I don't understand what is happening with the margins. Here's an example: ( http://jsfiddle.net/VrVc7/ ) #outer { background-color:#EEE; overflow:hidden; } #inner { margin: 30px; padding: 5px; background-color:#ABE; } <div id=

Increase distance between title and plot in matplolib? [duplicate]

对着背影说爱祢 提交于 2019-11-27 21:10:38
问题 This question already has answers here : Python Matplotlib figure title overlaps axes label when using twiny (5 answers) Closed 5 months ago . I have a simple plot in matplotlib and I would like to increase the distance between the title and the plot (without using suptitle because it does not work on the version I use on a server). How to do that ? 回答1: There doesn't seem to be a clean way to set this directly (but might be worth a feature request to add that), however the title is just a

Increase distance between title and plot in matplolib? [duplicate]

纵然是瞬间 提交于 2019-11-27 21:05:50
This question already has an answer here: Python Matplotlib figure title overlaps axes label when using twiny 5 answers I have a simple plot in matplotlib and I would like to increase the distance between the title and the plot (without using suptitle because it does not work on the version I use on a server). How to do that ? tacaswell There doesn't seem to be a clean way to set this directly (but might be worth a feature request to add that), however the title is just a text artist, so you can reach in and change it. #ax = plt.gca() ttl = ax.title ttl.set_position([.5, 1.05]) #plt.draw()

CSS page headers - how to use print margins?

时间秒杀一切 提交于 2019-11-27 16:30:45
问题 I can get a header to print on each page, but I'm new to print margins. I thought the @page css would work, but it does not seem to affect page margins. If I set the margins on the body, it works on page one, but subsequent pages start the top margin at the default, putting the header over top of the text. <style> .header { position: fixed; top: 0; } @page { size: 11in 17in; margin-left: 1in; margin-right: 1in; margin-top: 1in; margin-bottom: 1in; } </style> <body> <span class=header>This is

Error in plot.new() : figure margins too large, Scatter plot

孤街浪徒 提交于 2019-11-27 06:06:24
I've looked in different questions for a solution and I've tried what was suggested but I have not found a solution to make it work. Everytime I want to run this code it always says: Error in plot.new() : figure margins too large and I don't know how to fix it. Here is my code: par(mfcol=c(5,3)) hist(RtBio, main="Histograma de Bio Pappel") boxplot(RtBio, main="Diagrama de Caja de Bio Pappel") stem(RtBio) plot(RtBio, main="Gráfica de Dispersión") hist(RtAlsea, main="Histograma de Alsea") boxplot(Alsea, main="Diagrama de caja de Alsea") stem(RtAlsea) plot(RtTelev, main="Gráfica de distribución