English 中文(简体)
1. 过度流入:只为某些内容所隐藏
原标题:Setting overflow:hidden only for certain elements
  • 时间:2011-03-20 06:08:51
  •  标签:
  • html
  • css

http://jsfiddle.net/waitinforatrain/sEX3n/

我在集装箱内有两艘满载体。 这两架飞机都位于集装箱外面。 如果我不处理过量:隐藏的线将隐藏在集装箱外的一切。

然而,我只想掩盖四一片 over流,四舍五入。 但是,由于过度流入:隐藏必须放在父母身上,这将掩盖他们。 是否有任何办法隐藏一个人?

即使我能够这样做,这样就能够显示上下边界的过量,但不会停留在左边,而且会适得其事(我试图用溢出的x和溢出的流,但我却认为这并非其本意。

<div id="container"> 
    <div id="div1"></div> 
    <div id="div2">Test</div> 
</div> 

#container {
    width: 300px;
    position: relative;
    border: 1px solid #000;
    height: 10px;
    /*overflow: hidden;*/
}

#div2 {
    position: absolute;
    top: 16px;
    border: 1px solid #444;
}

#div1 {
    position: absolute;
    height: 10px;
    left: 90%;
    width: 15%;
    background-color: purple;
}
最佳回答

The most obvious solution is to:

  • Add an extra wrapper div.
  • Apply overflow: hidden to this div.
  • Move the time outside this div.

与此类似:

问题回答




相关问题
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....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

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 ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签