---
title: "固定poshytip提示框小箭头位置"
author: "tdttyl.cwm"
date: "2013-06-19T13:37:07Z"
tags: ["jQuery", "poshytip"]
categories: ["Web前端"]
slug: "poshytip"
draft: false
lastmod: "2013-06-19T17:06:23Z"
id: 1889180
url: "https://no-mor.iteye.com/blog/1889180"
---

在poshytip的样式文件中，可以看到提示框的小箭头默认是50%位置（以右弹为例）

```
.tip-yellowsimple .tip-arrow-left {
	margin-top:-4px; /* approx. half the height to center it */
	margin-left:-6px;
	top:50%;
	left:0;
	width:6px;
	height:9px;
	background:url(tip-yellowsimple_arrows.gif) no-repeat -27px 0;
}
```

 为了避免提示框的箭头不随内容变多而改变位置，可以修改箭头的样式文件，我修改为距上20px

```
.tip-yellowsimple .tip-arrow-left {
	margin-top:-4px; /* approx. half the height to center it */
	margin-left:-6px;
	top:20px;
	left:0;
	width:6px;
	height:9px;
	background:url(tip-yellowsimple_arrows.gif) no-repeat -27px 0;
}
```

 这样，小箭头的位置就可以相对target固定位置了。