- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我目前没有可作为示例显示的代码,因为我一直在努力使它正常工作,但甚至没有接近使其按预期工作。由于保密协议(protocol),我无法展示图片。所以我会尽我所能描述。
基本上:
我在 div 中有一个 Logo 图像。 div 有 margin:0 auto;所以它在浏览器中居中。
我有一个透明背景的“箭头”png 图像,需要在浏览器的右侧刷新。
要注意的是,无论您将浏览器窗口设置多宽,我都需要将箭头尖端保持在 Logo 右侧的旁边,并且箭头的尾部仍与浏览器的右侧齐平.
页面内容也将居中。以防万一需要此信息。
基本上我需要将箭头调整为浏览器宽度,但要确保箭头尖端始终指向 Logo 。
我所有的尝试都使 div 太大,导致 Logo 一直冲到左边而不是居中。
我知道这可能包括将箭头分成两个图像,但即便如此,我仍然对如何使它真正起作用感到困惑。开始认为这是不可能的事情。
这是一张图片来解释,我相信一旦我弄清楚如何做顶部箭头,我就能得到底部箭头。底部箭头略有不同,因为箭头尖端可能位于不同的位置,具体取决于页面。
最终更新:使用 Max 的建议
注意:我只在 chrome、firefox 和 safari 上测试了它,这些都是截至本文发布时的最新版本。不确定使用其他版本或 IE 会遇到什么问题。
HTML
<div class="header-wrapper">
<div class="header">
<img src="images/logo.png" />
</div>
<div class="arrow-wrapper">
<div class="arrow-tail"></div>
</div>
</div>
CSS 代码
.header-wrapper{
position:relative;
width:100%;
overflow:hidden;
}
.header {
position: relative;
z-index: 10;
height: 69px;
margin: 0 auto;
}
.arrow-wrapper {
z-index: 5;
background:url(../images/arrow_tip.png) no-repeat top left;
width: 50%;
position: absolute;
left: 50%;
top: 18px;
padding: 0 0 0 120px;
height:23px;
margin-left:140px;
}
.arrow-tail{
background:url(../images/arrow_tail.png) repeat-x top left;
height:23px;
width:100%;
}
最佳答案
如果我没猜错,这可能是一个解决方案: http://jsfiddle.net/WazcT/3/
HTML:
<div class="main">
<div class="header"></div>
<div class="arrow_container">
<div class="arrow">←‐‐</div>
</div>
</div>
CSS:
.main{
position: relative;
width: 100%;
overflow: hidden;
}
.header{
position: relative;
opacity: 0.5;
z-index: 10;
width : 400px;
height: 100px;
margin: 0 auto;
background: #ccc;
}
.arrow_container {
z-index: 5;
background: #88b7d5;
width: 50%;
position: absolute;
left: 50%;
top: 10px;
padding: 10px 0 10px 200px;
}
.arrow{
padding: 10px;
background: #eee;
font-size: 32px;
}
关于html - CSS 如何使图像流畅地延伸到浏览器的一侧,并与居中的内容对齐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11216309/
我发现很多关于使用而不是关于定义 future 在 Dart 。假设我有 letsWait()这需要相当长的时间。如何使用 Future类(class)? import 'dart:async'; v
有什么区别: Class和 Class ? 谢谢 最佳答案 实际上是一样的 关于java - 反射java?延伸,我们在Stack Overflow上找到一个类似的问题: https://stacko
我想在下面的 jackson 反序列化中添加多个类。但我该怎么做呢?下面是示例代码。 XmlMapper mapper = new XmlMapper(); JaxbAnnotationModule
我正在使用 NetBeans 和 Glassfish 从现有 WSDL 构建 Web 服务。NetBeans 已从给定的 WSDL 创建了所需的类。WSDL 定义了一些基本数据类型(例如 BaseTy
我有一个获取这种类型参数的方法: NSArray 现在,当我获取此数组的一个元素时,我得到一个 ClassCastException。我的方法: public static List getWrapp
在使用泛型时,我遇到了声明 .如果我以集合接口(interface)的 addAll 方法为例。 它的声明是这样的: interface Collection { public b
我对集合中使用的通用通配符表示法有一些(违反直觉的)观察。通配符的目的 List是允许列表(T 的子类型)的赋值到“?”列表的引用的 T'。它的目的不是特别允许将 T 的子类型的元素添加到列表中( o
Closed. This question needs details or clarity。它当前不接受答案。 想改善这个问题吗?添加详细信息,并通过editing this post阐明问题。 2
你能帮我一个泛型吗?我有一个要求,我有一个 UI 表单,但根据类型,表单会完全更改。我为每种类型的表单创建了具有公共(public)字段的父 DTO 和子 DTO。使用 vaadin 进行验证。我该如
我有一个 list List generics; 我们如何对此进行排序?是否可以在 Comparator 实现上比较子类对象? 谢谢 最佳答案 参见Collections.sort ,其中T必须imp
尝试在 android 中创建一个内存游戏而不使用 xml 布局,本质上我现在想做的是在网格上的不同位置创建两张相同的卡片。所以我在这里问的是如何将这些卡片随机放置在网格上。我首先创建了随机整数数组,
所以我得到了一个接口(interface),其中我需要实现的一个方法为我提供了一个集合,并希望我将集合中的数据“全部添加”到我的对象中。我仍然不确定集合到底是什么。它是一个数组列表吗?我不相信它是,但
有没有办法强制最后一列延伸到 DataGrid WPF 的宽度? 因为在某些情况下,当 DataGrid 的宽度大于所有列的累积宽度时,DataGrid 的行为就像包含最后一个空列。 public
我在对象中有一个变量: private final Map bElementsToAdd = new HashMap<>(); 使用Builder模式中的方法我想完成这个 map 。 public B
这个问题已经有答案了: Can't add value to the Java collection with wildcard generic type (4 个回答) 已关闭 9 年前。 为什么我
我的问题正是我的标题所说的。 我有以下类(class) public class StoreItem { //Lots of irrelevant information! :) }
这个问题在这里已经有了答案: Why adding an element (of correct type) into a List through a method of is a compil
我正在准备 Java 期末考试。我遇到一道题,需要填空。 需要填空的相关代码 ____ ____ C {} ____ B extends ____ , C {} 问题是:我可以插入所有这些空白来编译我
我有一个.page 围绕着里面的所有内容。当内容延伸时,.page 也会延伸。 . 我的主要问题是 .leftBannerBackground 不使用 .page 扩展. 我能做些什么来调整 .l
有时,很多次我在文档中看到这种情况。这让我想知道要输入什么。有人可以用清晰的简化文字向我解释这句话的意思吗:D。这是怎么回事: ArrayList(Collection c) 最终被用作: new A
我是一名优秀的程序员,十分优秀!