English 中文(简体)
StackLayout小组在圆角显示白端
原标题:StackLayoutPanel Shows white ends at the rounded corners

我使用GWT s StackLayoutPanel ,试图通过在以下CSS规则中应用 边界-radius 属性绕过信头的角:

.mm-StackPanelHeader {
  padding-left: 7px;
  font-weight: bold;
  font-size: 1.4em;
  width: 200px;
  border-radius: 5px 5px 0px 0px;
  background: #d3def6;
  border: 0.5px solid #bbbbdd;
}

当信头项目倒塌时, 边界不会完全覆盖对方, 显示丑陋的白色角落的尽头。

如何解决这个问题?

s 这里的""http://imageshack.us/photo/my-images/805/stackoverflow.jpg/"rel=“nofollow”>outputs short ,供参考。

最佳回答

StackLayootPanel 绝对是比 StackPanel 更新的版本。

但我用后一种方法来对付这个案子 是因为没有其他办法 而且它就像一个魅力!

感谢大家!

问题回答

假设你将前往", http://gwt.google.com/samples/Showcase/showcase.html#!CwStackPanel" rel=“nofollow noreferrer”> 旧部件看起来感觉 , 实现同样的结果将不可避免地涉及替换图像和乱动部件布局属性(例如应用负差、改变偏移) 。

尽管如此,我还是设法找到一个快速的基于CSS(CSS)的解决方案,该解决方案似乎针对你的需要,并且不受进一步操纵。 我相信有一个更准确的解决方案可以找到,因为这一尝试远非完美,但它应该为您提供一个良好的起点。

Abstract

要模拟旧部件外观 :

  • Round up the top corners for the item headers.
  • Apply a background color to the underling container, to avoid those ugly white corners.
  • Use top round corners on that container as well, to avoid ugly blue corners on it as a result of the background color applied.
  • Reset the bottom padding of the header items to re-center their content.

Implementation

在您的样式表中添加以下规则 :

.gwt-StackLayoutPanel,
.gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader {
    background-color: #D3DEF6;
    border-radius: 5px 5px 0 0;
}
.gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader {
    padding-bottom: 0;
}

Illustration

以下为GWT展示的现场例子, 通过操控 CSS 属性所生成的最终结果简况:

"https://i.sstatic.net/jNwb4.png" alt="修改过的斯塔克布局面板"/ >





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签