对于想了解css–如何无缝对齐不同大小的块div?的读者,本文将提供新的信息,我们将详细介绍css实现无缝滚动,并且为您提供关于Android:如何在绘制到不同大小的屏幕时管理位图大小?、css–Di
对于想了解css – 如何无缝对齐不同大小的块div?的读者,本文将提供新的信息,我们将详细介绍css实现无缝滚动,并且为您提供关于Android:如何在绘制到不同大小的屏幕时管理位图大小?、css – Div表格单元格垂直对齐不工作、css – 以固定大小的div垂直对齐中心图像、css – 即使第二个div溢出,如何并排保留两个内联块div的有价值信息。
本文目录一览:- css – 如何无缝对齐不同大小的块div?(css实现无缝滚动)
- Android:如何在绘制到不同大小的屏幕时管理位图大小?
- css – Div表格单元格垂直对齐不工作
- css – 以固定大小的div垂直对齐中心图像
- css – 即使第二个div溢出,如何并排保留两个内联块div
css – 如何无缝对齐不同大小的块div?(css实现无缝滚动)
目前我的div框没有正确对齐.不同高度的Div盒在一些div之间产生大的垂直空间. div盒子也越来越向右侧.
我希望div盒彼此保持相同的边距,无论盒子的高度如何,并且它们从左边排列>对.
我希望div框对齐这样的东西:
以下是正在发生的事情的例子:http://jsfiddle.net/P4S8z/
HTML:
<div> <divhttps://www.jb51.cc/tag/Box/" target="_blank">Box"> <h3>Blah blah</h3> </div> <divhttps://www.jb51.cc/tag/Box/" target="_blank">Box"> <h3>Blah blah</h3> </div> <divhttps://www.jb51.cc/tag/Box/" target="_blank">Box"> <h3>Blah blah</h3> </div> <divhttps://www.jb51.cc/tag/Box/" target="_blank">Box"> <h3>Blah blah</h3> </div> <divhttps://www.jb51.cc/tag/Box/" target="_blank">Box"> <h3>Blah blah</h3> </div> <divhttps://www.jb51.cc/tag/Box/" target="_blank">Box"> <h3>Blah blah</h3> </div> </div>
CSS:
.container { position: relative; float: left; margin: 0; } .Box { position: relative; display: block; float: left; width: 250px; margin-left: 1.5em; margin-bottom: 0.5em ; padding: 0 10px 0; color: #666; background: #fff; border: 1px solid #d2d2d2; border-radius: 3px; } .Box h3 { position: relative; display: block; height: 20px; line-height: 1.3em; width: 260px; margin: 0; padding: 5px 10px; left: -15px; top: 8px; color: #cfcfcf; text-shadow: 0 1px 1px #111; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; background: #333; Box-shadow: 0 1px 2px rgba(0,0.3); }
解决方法
我用div包围了每个“列”,并将那些div留下了.
这是一个更新的小提琴:http://jsfiddle.net/Renson/P4S8z/4/
这应该保持边距相等你想要的
新的HTML
<div> <div> <divhttps://www.jb51.cc/tag/Box/" target="_blank">Box"> <h3>Blah blah</h3> </div> <divhttps://www.jb51.cc/tag/Box/" target="_blank">Box"> <h3>Blah blah</h3> </div> </div> <div> <divhttps://www.jb51.cc/tag/Box/" target="_blank">Box"> <h3>Blah blah</h3> </div> <divhttps://www.jb51.cc/tag/Box/" target="_blank">Box"> <h3>Blah blah</h3> </div> <divhttps://www.jb51.cc/tag/Box/" target="_blank">Box"> <h3>Blah blah</h3> </div> <divhttps://www.jb51.cc/tag/Box/" target="_blank">Box"> <h3>Blah blah</h3> </div> </div>
添加到CSS
.subcontainer{ float: left; }
Android:如何在绘制到不同大小的屏幕时管理位图大小?
我有一个应用程序,可以触摸移动的位图.到目前为止,它已经在480×320屏幕上开发,测试图形已经在此分辨率下创建.为了支持模拟WVGA等替代屏幕,我已经成功地在hdpi文件夹中放置了更高分辨率的图像,并且它可以工作.
但是,当我创建一个像10英寸平板电脑这样的大屏幕时,图形被绘制到一个小的手机大小的区域.
如果采用更高密度的分辨率,为更大的屏幕提供更高分辨率的源图像的正确方法是什么?我是否必须手动加载和缩放位图?
解决方法
因此,请尝试将此类设备的图形放在名为的文件夹中
drawable-xlarge-mdpi
请参阅此参考:
http://developer.android.com/guide/practices/screens_support.html
css – Div表格单元格垂直对齐不工作
下面是我使用的CSS,这是所有的在html页面。
@charset "utf-8"; /* CSS Document */ html,body { background-color:#FFFFFF; font-family:Arial,Helvetica,sans-serif; margin: 0; padding: 0; padding-top: 5px; } div.Main { background-color:#FFFFFF; border-collapse:collapse; width:800px; margin-left:auto; margin-right:auto; } div.MainHeader { color:#C00000; font-size:18pt; font-weight:bold; text-align:center; width:800px; } div.BlackBox { background-color:#000000; color:#FFFF00; display:table-cell; float:left; font-size:18pt; font-weight:bold; height:191px; text-align:center; vertical-align:middle; width:630px; } div.BlackBoxPicture { background-color:#000000; float:right; height:191px; margin-top:auto; margin-bottom:auto; text-align:right; vertical-align:bottom; width:170px; }
我究竟做错了什么?
解决方法
css – 以固定大小的div垂直对齐中心图像
解决方法
<div></div>
css – 即使第二个div溢出,如何并排保留两个内联块div
<!DOCTYPE html> <html> <head> <style type="text/css"> body { background-color:#d0e4fe; } div.container { width: 600px; border: solid 1px black; } div.divLeft { display:inline-block; border: solid 1px red; color: red; } div.divRight { display:inline-block; border: solid 1px blue; color: blue; } </style> </head> <body> <div> <div> <p>1 - Some short text</p> </div> <div> <p>Some not too long text with the div besides the first one.</p> </div> </div> <div> <div> <p>2 - Some short text</p> </div> <div> <p>Some very long text that will eventually wrap because it is so long and when it wraps is when the trouble starts because the div moves down instead of staying besides the first one.</p> </div> </div> </body> </html>
在第二种情况下,有没有办法保持除第一个之外的div而不是它移动到第一个之下.请注意,我不能将我的div使用固定宽度作为将在未知中显示的文本的长度.然后我唯一知道的是第一个div中的文本总是很短,第二个中的文本可能很长.
这是我想要的基本图表:
First div text Second div text stays beside the first one and wraps around still being aligned like this
谢谢大家!
解决方法
今天关于css – 如何无缝对齐不同大小的块div?和css实现无缝滚动的分享就到这里,希望大家有所收获,若想了解更多关于Android:如何在绘制到不同大小的屏幕时管理位图大小?、css – Div表格单元格垂直对齐不工作、css – 以固定大小的div垂直对齐中心图像、css – 即使第二个div溢出,如何并排保留两个内联块div等相关知识,可以在本站进行查询。
本文标签: