margin

GridLayout Removing Padding between JPanels

夙愿已清 提交于 2019-12-10 21:30:32
问题 I'm working on a Computer Science project, and I haven't been able to find any solution to my problem. I'm creating a 2D array of JPanel s containing images through a GridLayout . I want to remove the padding/margins between all the panels so that it flows seemlessly into a single image. However, the setHGap and setVGap methods don't seem to help me. I'd appreciate any response. Thank you. import java.awt.GridLayout; import java.util.Map; import javax.swing.ImageIcon; import javax.swing

Negative margin breaks float

会有一股神秘感。 提交于 2019-12-10 18:55:18
问题 While I was working on something, I noticed a very strange behaviour which I couldn't explain. The only difference between the two scenarios is that the <i> s in the second example have margin-top set to -10px instead of -9px . I use the negative margin to shift all of the boxes top with the same ammount. main, aside { width: 100%; padding: 20px 0 10px; margin-bottom: 10px; overflow: hidden; background: lightblue; } main i, aside i { float: left; display: block; width: 10px; height: 10px;

iframe body remove space

℡╲_俬逩灬. 提交于 2019-12-10 18:25:20
问题 My iframe a style of style="width:100%" , and it almost covers the page width. But it leaves a small margin on the left and right side. So I added body { margin:0px; } to remove the space. It works, but the problem is that removing the margin on <body> affects other things, for example a paragraph <p> inside <body> . Is there a way to eliminate the margin only for the <iframe> ? Code: <!DOCTYPE html> <html> <body> <p> hello </p> <iframe src="http://www.weather.com" style="width:100%; height

how to make a ul li css menu with variable space between items

☆樱花仙子☆ 提交于 2019-12-10 17:26:24
问题 The idea is to make a menu with a fixed amount of items. Each of the items must have a fixed padding on them to make them look decent when placing a border around them. (so far so good) But these items must be spread out in a div with a fixed size, spaced evenly - the items themselves won't be the same size as this is dependent on the text within these items. What I can't figure out is how to make sure that the items are on 1 line with a dynamic (more or less) evenly spacing between them

Programmatically assigning Margin and/or Padding to a Label

◇◆丶佛笑我妖孽 提交于 2019-12-10 17:21:35
问题 In trying to get some labels in a TableLayoutPanel to move from the top left of their cells to the center of the cells, I'm trying to experiment with adding padding and/or margins. However, nothing I've tried works. Here's the code I've tried and the results: // Setting the padding just cuts off the bottom part of the text //lbl.Padding = new System.Windows.Forms.Padding(1); // How to set Margin? //lbl.Margin = new System.Windows.Forms.Margin(1); <- This mimics "Padding" but is not recognized

基础梳理之 标签默认样式及css reset

冷暖自知 提交于 2019-12-10 17:11:27
一、浏览器标签的一些默认样式 部分: body { margin : 8px ; line-height : 1.12 } h1 { font-size : 2em ; margin : .67em 0 } h2 { font-size : 1.5em ; margin : .75em 0 } h3 { font-size : 1.17em ; margin : .83em 0 } h4, p, blockquote, ul, fieldset, form, ol, dl, dir, menu { margin : 1.12em 0 } h5 { font-size : .83em ; margin : 1.5em 0 } h6 { font-size : .75em ; margin : 1.67em 0 } h1, h2, h3, h4, h5, h6, b,strong { font-weight : bolder } button, textarea, input, object, select { display : inline-block ; } big { font-size : 1.17em } small, sub, sup { font-size : .83em } sub { vertical-align : sub } /*定义sub元素默认为下标显示*/

欢迎光临

杀马特。学长 韩版系。学妹 提交于 2019-12-10 16:47:47
我是红 来自石家庄一中,一只弱鸡,每天颓废在鸡房里的一只标准肥宅 曾经的艾迪叫刀与玫瑰,不过因为某些原因弃掉了 \(csp-s2019\) 靠着运气拿到了弱省 \(rk30\) ,做着中二的梦决定去省选 码力渣渣,记性差,学过的东西经常忘(所以以后会勤更博客的) \(<-flag\) 我的 \(QQ3085961625\) ,欢迎各位打扰,顺便一提,如果有人在博客或者 \(QQ\) 留言,我都会很开心 以前的博客大部分没有 \(mark down\) ,可读性极低,以后的博客会大有改观的,前面的博客我也会陆续补上 如果想要交换友链欢迎留言´ ▽ ` )ノ 友链们: Loceaner 广饶一中~ */ /*--> */ Loceaner 广饶一中~ */ /*--> */ 来源: https://www.cnblogs.com/knife-rose/p/12017371.html

CSS Absolute Positioning of one div being affected by margin in unrelated div

微笑、不失礼 提交于 2019-12-10 16:23:18
问题 Given the following I would expect a 200px red box at the top of the page followed by a white space of 100 pixels then a purple box on the bottom. This is what the WYSIWYG view in Dreamwever shows me but what I get in FF IE Chr is a red box in the middle of the page. Funny thing is if I add a border to the wrapper div I get what I expect. So what is happening is that the margin-top:300px of the #content div is pushing down the #header div. Since the #header div is positioned absolutely inside

CSS * {margin: 0;padding: 0;} override

吃可爱长大的小学妹 提交于 2019-12-10 15:36:16
问题 Hey all, i am in need of some help with figuring out how to override the "* {margin: 0;padding: 0;}" in my css. The reason why is that i have this css: .postcomments { width: 547px; padding: 5px 5px 5px 5px; margin: 0 0 5px 0;} .postcomments a { text-decoration: underline;} .postcomments ul { margin: 0; padding: 0; list-style-type: none;} .postcomments ul li { width: 547px; margin: 0 0 5px 0; padding: 0; list-style-type: none;} .postcomments .right { color: #474747; font-size: 11px;

Margin stacks on each other?

為{幸葍}努か 提交于 2019-12-10 14:43:48
问题 I have long noticed that when two block elements are put next to each other, their margin stacks on each other. Something like this: Both <div> s have margin: 1em , but when margin1 's margin-bottom collides with margin2 's margin-top , both margin just stack on each other. See on here: http://jsfiddle.net/39XmC/ What I was expecting was something like this: Both <div> s actually give spaces on each margin and doesn't stack on each other's margins. I know that this can be fixed by floating or