首页 \ 问答 \ CSS - 显示动态高度浮动DIV - 缺少背景图像(CSS - displaying a dynamic height floated DIV - missing background image)

CSS - 显示动态高度浮动DIV - 缺少背景图像(CSS - displaying a dynamic height floated DIV - missing background image)

我的目标:

这是我想要完成的。 我们有一个显示在页面上的类别列表。 类别数量未知。 描述可以是几乎任何尺寸......但我们想要一个统一的外观。 所以,我们使用dotdotdot插件将椭圆放在段落上。 将鼠标悬停在项目上时,应展开说明并显示全文。

我希望悬停浮动或覆盖它下面的任何东西。 由于我的一些布局项目(请参阅下面的注释),我的sccontainer元素没有设置高度。 它基于内容动态...具有最大高度设置。

当我在悬停事件中将该高度更改为AUTO(导致文本向下流动并显示所有内容)时,我将丢失sccontainer元素上的背景。

一些相关的CSS:

  .sccontainer { width: 280px; zoom: 1; float: left; margin: 5px 10px; padding: 0; border: 1px solid #8697a1; -moz-border-radius: 5px; border-radius: 5px; -moz-box-shadow: 0 0 6px #777; -webkit-box-shadow: 0 0 6px #777; box-shadow: 0 0 6px #777; -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=6, Direction=90, Color='#777777')"; filter: progid:DXImageTransform.Microsoft.Shadow(Strength=6, Direction=90, Color='#777777'); position: relative; background: #fff url(http://imagecss.com/images/background.jpg) repeat-x left top; }
  .sccontainer .parent { position: absolute; width: 270px; }
  .sccontainer .image { margin: 5px; float: left; }
    .sccontainer .image img { width: 48px; }
  .sccontainer .icon { margin: 0; }
  .sccontainer p { margin: 8px; padding: 0; max-height: 145px; }
  .sccontainer h1 { line-height: 24px; display: inline-block; vertical-align: middle; width: 200px; height: 48px; padding: 0; margin: 5px 0 0 0; overflow: hidden; }
    .sccontainer h1 a { padding: 0; font-size: 24px; color: #fff; font-weight: normal; }
  .sccontainer .content { position: relative; height: 210px; padding: 0 5px; font-size: 15px; line-height: 22px; width: 270px; }
  .sccontainer a:hover { text-decoration: underline; }

.sccontainer.hover { height: 250px; }
  .sccontainer.hover .content { height: auto; }
    .sccontainer.hover .content p { min-height: 135px; max-height: none; }

的jsfiddle:

这是我现在拥有的jsFiddle版本。 如果将鼠标悬停在蓝色框中的文本上,则可以看到此操作。 它有点大,所以我使用jsFiddle而不是把所有的位都放在这里代码标签...

http://jsfiddle.net/ztMM5/1/

这是我想看到的模型。 方法5a略微扩展以显示完整内容.... yets与红线重叠。 没有其他项目移动或受到影响。

服务目录的模型

注意:抱歉的东西大小。 我尽可能地减少了它。 此外,我正在修改现有的Intranet网站......它是第三方,所以我对源代码的控制有限 - 因此表的用法。 :(

我尝试/研究的内容:

我认为问题源于我的sccontainer项目是浮动的,并且没有指定高度。 这就是图像消失的原因。

我有一个保留背景的版本......但是sccontainer框没有像我们需要的那样重新调整......文本刚刚溢出来......相当难看。

我不知道足够的CSS来使这一切正常。 如果需要,我并不反对使用jQuery做更多事情。

我确实使用了一个处理大部分悬停的版本:使用:hover stuff ...但它的效果不如jQuery方法。


My Goal:

Here is what I'm trying to accomplish. We have an list of categories that appear on a page. The number of categories is unknown. The description can be pretty much any size... yet we want a uniform look. So, we are using the dotdotdot plugin to put ellipses on the paragraphs. When you hover over the item, it should expand the description and show the full text.

I want that hover to float or overlay whatever is below it. Due to some of my layout items (see my NOTE below) my sccontainer element doesn't have a set height. It's dynamic based on the content... with a max-height set.

When I change that height to AUTO in the hover event (which causes the text to flow down and displays all the content), I lose the background on the sccontainer element.

Some pertinent CSS:

  .sccontainer { width: 280px; zoom: 1; float: left; margin: 5px 10px; padding: 0; border: 1px solid #8697a1; -moz-border-radius: 5px; border-radius: 5px; -moz-box-shadow: 0 0 6px #777; -webkit-box-shadow: 0 0 6px #777; box-shadow: 0 0 6px #777; -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=6, Direction=90, Color='#777777')"; filter: progid:DXImageTransform.Microsoft.Shadow(Strength=6, Direction=90, Color='#777777'); position: relative; background: #fff url(http://imagecss.com/images/background.jpg) repeat-x left top; }
  .sccontainer .parent { position: absolute; width: 270px; }
  .sccontainer .image { margin: 5px; float: left; }
    .sccontainer .image img { width: 48px; }
  .sccontainer .icon { margin: 0; }
  .sccontainer p { margin: 8px; padding: 0; max-height: 145px; }
  .sccontainer h1 { line-height: 24px; display: inline-block; vertical-align: middle; width: 200px; height: 48px; padding: 0; margin: 5px 0 0 0; overflow: hidden; }
    .sccontainer h1 a { padding: 0; font-size: 24px; color: #fff; font-weight: normal; }
  .sccontainer .content { position: relative; height: 210px; padding: 0 5px; font-size: 15px; line-height: 22px; width: 270px; }
  .sccontainer a:hover { text-decoration: underline; }

.sccontainer.hover { height: 250px; }
  .sccontainer.hover .content { height: auto; }
    .sccontainer.hover .content p { min-height: 135px; max-height: none; }

jsFiddle:

Here is a jsFiddle version of what I have right now. You can see this in action, if you hover over the text in the blue box. It's a bit large, so I used jsFiddle instead of putting all the bits here code tags...

http://jsfiddle.net/ztMM5/1/

And here is a mockup of what I'd like to see. Method 5a expands slightly to show the full content.... yets overlaps the red line. None of the other items move around or are affected.

mockup of service catalog

NOTE: Sorry for the size of things. I've trimmed it down about as much as I can. Also, I am modifying an existing intranet website... it's 3rd party, so I have limited control of the source code - hence the table usage. :(

What I've Tried/Researched:

I believe the issue stems from the fact that my sccontainer item is floating, and doesn't have a height specified. That's why the image disappears.

I had a version that kept the background... but the sccontainer box didn't resize like we need... the text just overflowed it... rather ugly.

I don't know enough CSS to make this all work right. I'm not adverse to using jQuery to do more if needed.

I did work on a version that handled most of the hover using the :hover stuff... but it didn't work quite as well as the jQuery approach.


原文:https://stackoverflow.com/questions/21465064
更新时间:2021-10-22 07:10

最满意答案

有一个RepositoryItemPopupBase.CloseUpKey属性,您可以使用它来指定用于打开和关闭弹出窗口的组合键。
这里是一个例子:

repositotyItemComboBox1.CloseUpKey = new KeyShortcut(Keys.Space);

或者如果您使用就地形式的自定义布局:

comboBoxEdit1.Properties.CloseUpKey = new KeyShortcut(Keys.Space);

There is a RepositoryItemPopupBase.CloseUpKey property which you can use to specify the key combination for open and close the popup.
Here is example:

repositotyItemComboBox1.CloseUpKey = new KeyShortcut(Keys.Space);

or if you are using custom layout for in-place form:

comboBoxEdit1.Properties.CloseUpKey = new KeyShortcut(Keys.Space);

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)