- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我一直想弄清楚为什么我用 CSS 创建的三个框不会与顶部对齐。特别是在 Internet Explorer 中也是如此。如果你看,你会看到第一个盒子下面的中间盒子和末端盒子是怎样的手。
我在这里设置了一个 JFiddle:http://jsfiddle.net/pgz9Y/
HTML代码:
<div class="wrapper margin-bot1">
<div class="bg-3">
<div class="indent">
<div class="wrapper margin-bot"><img src="http://www.erglighting.com/media/wysiwyg/images/page1_img1.png" alt="" /><a href="http://www.erglighting.com/index.php/products/archilume-collection.html"><img src="http://www.erglighting.com/media/wysiwyg/images/logo_archilume.png" alt="" /></a>
<div class="extra-wrap"> </div>
</div>
<ul class="ul-1">
<li><span style="font-family: 'trebuchet ms', geneva;">Made in USA</span></li>
<li><span style="font-family: 'trebuchet ms', geneva;">Expert Domestic Tech Support</span></li>
<li><span style="font-family: 'trebuchet ms', geneva;">High-end Installations</span></li>
<li><span style="font-family: 'trebuchet ms', geneva;">Robust Features</span></li>
</ul>
<a class="button-1 margin-left" href="http://www.erglighting.com/index.php/products/archilume-collection.html">Click to Order Now!</a></div>
</div>
<div class="bg-3">
<div class="indent">
<div class="wrapper margin-bot"><img src="http://www.erglighting.com/media/wysiwyg/images/XLD-SLD_group_thumb.png" alt="" /><a href="http://www.erglighting.com/index.php/products/genlume-collection.html"> <img src="http://www.erglighting.com/media/wysiwyg/images/GenLume-Logo.png" alt="" /></a>
<div class="extra-wrap"> </div>
</div>
<ul class="ul-1">
<li><span style="font-family: 'trebuchet ms', geneva;">Competitively Priced</span></li>
<li><span style="font-family: 'trebuchet ms', geneva;">Expert Domestic Tech Support</span></li>
<li><span style="font-family: 'trebuchet ms', geneva;">General Lighting Installations</span></li>
<li><span style="font-family: 'trebuchet ms', geneva;">Robust Features</span></li>
</ul>
<a class="button-1 margin-left" href="http://www.erglighting.com/index.php/products/genlume-collection.html">Click to Order Now!</a></div>
</div>
<div class="bg-3">
<div class="indent">
<div class="wrapper margin-bot"> <a href="http://www.erglighting.com/index.php/products/duralume-collection-usa.html"><img src="http://www.erglighting.com/media/wysiwyg/images/duralume.gif" alt="" width="144" height="33" /></a>
<div class="extra-wrap"> </div>
</div>
<ul class="ul-1">
<li><span style="font-family: 'trebuchet ms', geneva;">Made in USA</span></li>
<li>Long-life Durability</li>
<li><span style="font-family: 'trebuchet ms', geneva;">Custom Solutions</span></li>
<li><span style="font-family: 'trebuchet ms', geneva;">On-site Engineers</span></li>
</ul>
<a class="button-1 margin-left" href="http://www.erglighting.com/index.php/products/duralume-collection-usa.html">Click to Order Now!</a></div>
</div>
</div>
CSS 代码:
@import"reset.css";@import"grid.css";
/* Global Structure---------------------------------------- */
.main
{
width: 950px; // Reduced this to match with the parent's width
padding: 0;
margin: 0 auto;
position: relative;
}
.wrapper {width:100%; overflow:visible; position:relative;}
.extra-wrap {overflow:hidden;}
/*----- txt,links,lines,titles -----*/
.fleft{float:left}
.fright{float:right}
.alignright{text-align:right}
.aligncenter{text-align:center}
.alignmiddle *{vertical-align:middle}
.d-in-block {display:inline-block;}
.d-block {display:block;}
.reg {text-transform:uppercase;}
.reg2 {letter-spacing:-1px;}
.reg3 {letter-spacing:-2px;}
.index {z-index:99; position:relative;}
.rel {position:relative;}
.color1{color:#ff2100;}
/********************** Content ************************/
.img-indent-l {float:left; margin:0px 12px 0px 0px;}
.img-indent-2 {float:left; margin:0px 20px 0px 0px;}
/*********************************boxes**********************************/
.indent {padding:27px 20px 27px 25px;}
.indent1 {padding:25px 15px 15px 25px;}
.indent2 {padding:24px 15px 10px 19px;}
.indent-left {padding-left:0px;}
.indent-bottom {padding-bottom:18px;}
.indent-bottom1 {padding-bottom:8px;}
.indent-right {padding-right:0px;}
.indent-top {padding-top:19px;}
.indent-top1 {padding-top:39px;}
.margin-top { margin-top:-10px;}
.margin-top1 { margin-top:-2px;}
.margin-top2 { margin-top:-6px;}
.margin-top3 { margin-top:-8px;}
.margin-top4 { margin-top:-4px;}
.margin-top5 { margin-top:7px;}
.margin-bot {margin-bottom:7px; height:50px;}
.margin-bot1 {margin-bottom:10px;}
.margin-bot2 {margin-bottom:24px;}
.margin-bot3 {margin-bottom:21px;}
.margin-bot4 {margin-bottom:17px;}
.margin-bot5 {margin-bottom:30px;}
.margin-bot6 {margin-bottom:19px;}
.margin-bot7 {margin-bottom:58px;}
.margin-bot8 {margin-bottom:25px;}
.margin-bot9 {margin-bottom:15px;}
.margin-bot10 {margin-bottom:6px;}
.margin-bot11 {margin-bottom:10px;}
.margin-bot12 {margin-bottom:28px;}
.margin-bot13 {margin-bottom:26px;}
.margin-bot14 {margin-bottom:62px;}
.margin-left {margin-left:5px; margin-left: 27px;}
.margin-left1 {margin-left:16px;}
.margin-right {margin-right:14px;}
/*********************************content*************************************/
#content {
width:100%;
padding:60px 0;
position:relative;
background:url(../images/bg-5.gif) left top repeat-x #fff;
}
#page1 #content {padding-top:57px;}
/*********************************bg's*************************************/
.bg-1 {
background:url(../images/bg-2.jpg) left top repeat-x;
width:100%;
border-top:6px solid #fff;
height:351px;
}
.img {
position:absolute;
width:359px;
height:582px;
background:url(../images/page1_img.png) left top no-repeat;
top:-113px;
right:0;
z-index:19;
}
.bg-2 {
background:url(../images/bg-3.jpg) left top no-repeat;
width:100%;
height:351px;
position:relative;
}
.bg-3
{
overflow: visible;
width: 33%;
display: inline-table;
height: 270px;
background-image: url(http://www.webstertoolbox.com/skin/frontend/default/erglighting/images/bg-4.png);
background-repeat: no-repeat;
background-position: left top;
}
.bg-4 {
background:url(../images/bg-6.png) left top no-repeat;
height:182px;
width:100%;
overflow:hidden;
}
.bg-5 {
width:88px;
height:215px;
position:absolute;
right:0;
top:-22px;
background:url(../images/page2_img8.png) left top no-repeat;
}
.bg-6 {
background:url(../images/bg-7.png) left top no-repeat;
height:182px;
overflow:hidden;
width:100%;
}
.border-1 {border-bottom:1px solid #e5e5e5;}
.border-2 {border-bottom:1px solid #fff;}
/*********************************buttons*************************************/
.button-1 {
display:inline-block;
color:#fff;
font-weight:bold;
font-size:15px;
line-height:18px;
border-radius:17px;
-moz-border-radius:17px;
-webkit-border-radius:17px;
background:url(../images/button-1-2.png) left -82px repeat-x #555;
background: -webkit-linear-gradient(top, #747474, #555); /* Chrome 10+, Saf5.1+, iOS 5+ */
background: -moz-linear-gradient(top, #747474, #555); /* FF3.6 */
background: -ms-linear-gradient(top, #747474, #555); /* IE10 */
background: -o-linear-gradient(top, #747474, #555); /* Opera 11.10+ */
background: linear-gradient(top, #747474, #555);
padding:7px 18px 10px 15px;
}
.button-1>span {
display:inline-block;
width:17px;
height:11px;
margin:4px 0 0 13px;
background:url(../images/button-1.png) left top no-repeat;
margin-left: 27px;
}
.button-1:hover {
background:url(../images/button-1-2.png) repeat-x left 0 #2f2f2f;
background: -webkit-linear-gradient(top, #404040, #2f2f2f); /* Chrome 10+, Saf5.1+, iOS 5+ */
background: -moz-linear-gradient(top, #404040, #2f2f2f); /* FF3.6 */
background: -ms-linear-gradient(top, #404040, #2f2f2f); /* IE10 */
background: -o-linear-gradient(top, #404040, #2f2f2f); /* Opera 11.10+ */
background: linear-gradient(top, #404040, #2f2f2f);
text-decoration:none;
}
.button-2 {
display:inline-block;
position:relative;
font-size:13px;
line-height:16px;
color:#3e3e3e;
padding:4px 13px 6px;
border:1px solid #c9c9c9;
border-radius:15px;
-moz-border-radius:15px;
-webkit-border-radius:15px;
background:url(../images/button-2.png) repeat-x left -88px #e2e2e2;
background: -webkit-linear-gradient(top, #fefefe, #e2e2e2); /* Chrome 10+, Saf5.1+, iOS 5+ */
background: -moz-linear-gradient(top, #fefefe, #e2e2e2); /* FF3.6 */
background: -ms-linear-gradient(top, #fefefe, #e2e2e2); /* IE10 */
background: -o-linear-gradient(top, #fefefe, #e2e2e2); /* Opera 11.10+ */
background: linear-gradient(top, #fefefe, #e2e2e2);
}
.button-2:hover {
background:url(../images/button-2.png) repeat-x left top #585858;
background: -webkit-linear-gradient(top, #727272, #585858); /* Chrome 10+, Saf5.1+, iOS 5+ */
background: -moz-linear-gradient(top, #727272, #585858); /* FF3.6 */
background: -ms-linear-gradient(top, #727272, #585858); /* IE10 */
background: -o-linear-gradient(top, #727272, #585858); /* Opera 11.10+ */
background: linear-gradient(top, #727272, #585858);
border-bottom-color:#585858;
border-top-color:#727272;
border-left-color:#6d6d6d;
border-right-color:#606060;
color:#fff;
text-decoration:none;
}
.marker-1 {
background:url(../images/marker-1.gif) left 3px no-repeat;
padding:0 0 0 24px;
}
.marker-2 {
background:url(../images/marker-2.gif) left 2px no-repeat;
padding:0 0 0 24px;
}
/*********************************lists*************************************/
.ul-1 {
padding-left:6px;
margin-bottom:12px;
}
.ul-1 li {
font-size:14px;
line-height:17px;
background:url(../images/ul-1.png) left 8px no-repeat;
padding:4px 0 5px 24px;
}
.ul-1 li a {
color:#616161;
}
.ul-1 li a:hover {
text-decoration:underline;
}
.ul-2 li {
font-size:13px;
line-height:16px;
font-weight:bold;
padding:8px 0;
}
.ul-2 li a {
color:#959595;
background:url(../images/ul-2.png) left -91px no-repeat;
padding-left:24px;
}
.ul-2 li a:hover {
color:#3e3e3e;
text-decoration:none;
background-position:left 5px;
}
.ul-3 li {
font-size:13px;
line-height:18px;
background:url(../images/ul-3.png) left 7px no-repeat;
padding:4px 0 4px 30px;
}
.ul-3 li a {
color:#959595;
}
.ul-3 li a:hover {
text-decoration:underline;
}
.ul-4 li {
font-size:13px;
line-height:16px;
color:#959595;
overflow:hidden;
display:block;
padding:6px 0;
}
.ul-4 li a {
color:#959595;
display:block;
float:left;
}
.ul-4 li a:hover {
text-decoration:underline;
}
.ul-4 li span {
display:block;
float:right;
}
.ul-4 li strong {
background:url(../images/ul-4.png) left 11px repeat-x;
overflow:hidden;
display:block;
}
.dl-1 dt {
font-size:15px;
line-height:22px;
color:#2b2b2b;
margin-bottom:19px;
}
.dl-1 dd {
overflow:hidden;
}
.dl-1 dd span {
display:block;
float:left;
width:80px;
}
/*********************************fonts*************************************/
.size-1 {font-size:24px; line-height:29px;}
.size-2 {font-size:46px; line-height:56px;}
.size-2r {
font-size:46px;
line-height:56px;
color: #F00;
}
.size-2y {
font-size:46px;
line-height:56px;
color: #FB040;
}
.size-3 {font-size:76px; line-height:92px;}
.size-3b {
font-size:76px;
line-height:92px;
color: #36F;
}
.size-4 {font-size:36px; line-height:44px;}
.size-5 {font-size:15px; line-height:22px;}
.size-6 {font-size:18px; line-height:22px;}
.size-7 {font-size:32px; line-height:39px;}
.size-8 {font-size:21px; line-height:26px;}
.color-1 {color:#2b2b2b;}
.color-2 {color:#fff;}
.color-3 {color:#dedede;}
.color-4 {color:#8d8d8d;}
.color-5 {color:#434343;}
.color-6 {color:#3e3e3e;}
.color-7 {color:##3366FF;}
/**************** "slideshow" ************/
#slideshow {
width:700px !important;
height:270px !important;
overflow:hidden !important;
background:none !important;
}
#slideshow .wrapper {
padding-top:76px;
background:none !important;
}
#slideshow strong {
letter-spacing:-3px;
margin-left:-2px;
}
.cycle_wrap {
background:none !important;
position:relative;
}
.cycle_wrap #nav a {
display:block;
text-indent:-9999px;
width:10px;
height:10px;
float:left;
margin-right:10px;
background:url(../images/cycle.png) right top no-repeat;
}
.cycle_wrap #nav a.activeSlide,.cycle_wrap #nav a:hover {
background-position:left top;
}
.cycle_wrap #nav a.activeSlide {
cursor:default;
}
.cycle_wrap #nav {
position:absolute;
left:445px;
top:315px;
z-index:999;
}
有人可以告诉我我做错了什么以及为什么盒子不会排到顶部吗?
最佳答案
将 vertical-align: top
添加到 CSS 中的 bg-3
类
.bg-3
{
overflow: visible;
width: 33%;
display: inline-table;
height: 270px;
background-image: url(http://www.webstertoolbox.com/skin/frontend/default/erglighting/images/bg-4.png);
background-repeat: no-repeat;
background-position: left top;
vertical-align: top;
}
关于html - 三个框不对齐顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20106010/
我希望能够像在 jsFiddle 中那样将元素列表对齐到右侧的复选框。这是如何做到这一点的最佳实践?传统上我从来没有 float 过相互嵌套的元素,所以我想确定这是否是解决此问题的正确方法。 代码(h
指令.align n是什么意思在数组中做什么? 更具体地说,假设我有以下部分代码: array: .align 2 .space 800 它的重要性是什么,为什么不跳过它并使用
基本上我正在寻找一种强制特定相对对齐的方法 即我想保证其他一些值(value) m s.t m > n alignment_of(foo) % 2^m == 2^n IE: .align 2^m; .
在我的代码中,我必须考虑一个数组数组,其中内部数组具有固定维度。为了使用 STL 算法,将数据实际存储为数组的数组很有用,但我还需要将该数据传递给 C 库,该库采用扁平化的 C 样式数组。 如果能够以
横向上,我想显示两个位图,并在它们之间显示一个标签字段。 代码看起来很简单,但所有字段都添加在屏幕左侧。 HorizontalFieldManager hfm = new HorizontalFiel
我想绘制一个变量名称及其符号。因为某些变量的名称很长,所以我试图将换行符与轴标签混合使用。这会导致对齐中发生有趣的事情: par(mar=c(1,12,1,1)) plot( y=1:6, 1:6,
使用这个脚本 df <- data.frame(x = 1:5, y = 1:5, color = letters[1:5]) ggplot(df, aes(x, y, fill = color))
我有一个带有标量字段的结构,比如妈妈,我想在屏幕上对齐的列中显示结构的值,可能还有一些标题。这是一个最小的工作示例: mom.a = 1; mom.b = 2; mom.veryLongName =
在 iOS6 中,我使用自动布局。 我有 2 个以编程方式创建的 View v1 和 v2。 v2 作为 subview 添加到 v1 v1 的约束已通过编程方式创建(此处未显示)。 我希望 v1 和
概述 浏览时operator new, operator new[] - cppreference.com ,似乎我们有许多选项来分配具有特定对齐要求的对象数组。但是,没有指定如何使用它们,而且我似乎
Widget _createProfileContainer() { return new Container( height: 64.0, child: ne
我正在使用 Bootstrap 和语义 UI 的组合来设计和对齐我的网页。目前,我在将页面 api map 和博客文章在整个页面上对齐时遇到问题,而不是像图像所示 那样堆叠在一起。 这是我的底层代码,
所以我已经添加了标签和所有内容,但我仍然在格式化和对齐所有内容时遇到问题。计算按钮显然应该居中。我知道使用 gridbag 将框架分割成坐标系,当一列大于其他列时,它会调整其他列并将其抛弃(对吗?)。
我必须将程序上的按钮对齐到中间,我运行的当前代码但显示的按钮与程序一样大,我想要一个特定大小的中心按钮,这是我尝试过的 /** * Created by Timk9 on 11/04/2016.
我正在尝试将 VIM 作为我的 ruby/rails 编辑器。太胖了,我对它的功能印象深刻 并且我能够安装以下插件以提供更好的 IDE 体验 自动配对 Better-snipmate-snippe
在结构内对齐成员的最佳或常规方法是什么?添加虚拟数组是最佳解决方案吗? 我有一个 double 的结构和 double 的三倍是吗? struct particle{ double mass;
我正在尝试对齐我的输出,但由于某种原因我无法做到我多么想要它,这真的很令人沮丧。标题不会正确对齐。我不知道我是否正确使用了 setw()。 #include using std::cout; usi
我正在开发一个 android 应用程序,其相对布局如下所示。 这是应用程序在屏幕上的显示方式的 imgur 链接:http://imgur.com/c4rNJ .我希望“Text 1”出现在“a l
我不确定为什么我不能在下面的代码中调整按钮的位置。我有几行设置了边界,但我一定遗漏了一些东西。 public DayGUI() { mainFrame = new JF
我有一个 html 页面,我想在页面底部对齐一个 iframe,使 iframe 占据所有宽度,我无法在底部对齐 iframe。请找到底部的 iframe 标签页面。 The rest of th
我是一名优秀的程序员,十分优秀!