css中“备注:”会在框格的下方显示,怎样让它在方框的上方显示?

html-css014

css中“备注:”会在框格的下方显示,怎样让它在方框的上方显示?,第1张

<label>备注</label>

<textarea></textarea>

楼主是这个意思吗?

这样话,css中输入label{display:block}看就可以了

请问是网页悬停备注吗?

用法:将下面代码拷贝成文件styleAlt.js,然后在你的网页里的最后面(</html>的后面)加进这个js文件即可,然后你的网页中所有元素都会出现新的alt提示效果,你也可以自己改…

【js代码】

<!--

var tPopWait=50 //停留tWait毫秒后显示提示。

var tPopShow=120000//显示tShow毫秒后关闭提示。

//若有视频或音频,请设置最长时间并考虑缓冲时间。

var showPopStep=20 //透明递进。

var popOpacity=99 //最大非透明度。

var mouseoutkeep = 3000//鼠标移出区域mouseoutkeep毫秒后关闭提示。

/* 以下若不会,建议你不要修改 */

var sPop=null

var curShow=null

var tFadeOut=null

var tFadeIn=null

var tFadeWaiting=null

/* 这里可以更改成你喜欢的样式 */

document.write("<style type='text/css'>")

document.write(".theText { font-size:12pxbackground-color: #F8F8F5color:#000000border: 1px #000000 solidfont-color: font-size: 12pxpadding-right: 4pxpadding-left: 4pxheight: 20pxpadding-top: 2pxpadding-bottom: 2pxfilter: Alpha(Opacity=0)}")

document.write("</style>")

document.write("<div id='dypopLayer' style='position:absolutez-index:1000' class='theText'></div>")

function showPopup(){

var o=event.srcElement

MouseX=event.x

MouseY=event.y

if(o.alt!=null &&o.alt!=""){o.dypop=o.alto.alt=""}

if(o.title!=null &&o.title!=""){o.dypop=o.titleo.title=""}

if(o.dypop!=sPop) {

sPop=o.dypop

clearTimeout(curShow)

clearTimeout(tFadeOut)

clearTimeout(tFadeIn)

clearTimeout(tFadeWaiting)

clearTimeout(mouseout)

if(sPop==null || sPop=="") {

var mouseout = setTimeout(fadeIn,mouseoutkeep)

}

else {

if(o.dyclass!=null) popStyle=o.dyclass

else popStyle="theText"

curShow=setTimeout("showIt()",tPopWait)

}

}

}

function showIt(){

dypopLayer.className=popStyle

dypopLayer.innerHTML=sPop

popWidth=dypopLayer.clientWidth

popHeight=dypopLayer.clientHeight

if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24

else popLeftAdjust=0

if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24

else popTopAdjust=0

dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust

dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust

dypopLayer.style.filter="Alpha(Opacity=0)"

fadeOut()

}

function fadeOut(){

if(dypopLayer.filters.Alpha.opacity<popOpacity) {

dypopLayer.filters.Alpha.opacity+=showPopStep

tFadeOut=setTimeout("fadeOut()",150)

}

else {

dypopLayer.filters.Alpha.opacity=popOpacity

tFadeWaiting=setTimeout("fadeIn()",tPopShow)

}

}

function fadeIn(){

if(dypopLayer.filters.Alpha.opacity>0) {

dypopLayer.filters.Alpha.opacity-=1

tFadeIn=setTimeout("fadeIn()",1)

}

if(dypopLayer.filters.Alpha.opacity<=0){

dypopLayer.innerHTML=''

}

}

document.onmouseover=showPopup

//-->

【你的网页代码】

<html>

<body>

<b style="font-size:14px">鼠标放到图片上,会显示提示信息,鼠标离开后三秒消失!不需要在标签中添加其它事件,凡标签有Alt,title属性的,会自动处理</b>

<img src="http://www.163wap.com.cn/dl/up_img/1129183598.jpg" alt="<b>[相关说明]</b><P><b>说明:</b>请欣赏《一千年以后》<br><a href=#>it's _fcksavedurl="#>it's" _fcksavedurl="#>it's" _fcksavedurl="#>it's" here</a>">

<P align="center">

<a href="http://www.sina.com.cn" style="font-size:24pxfont-weight:bold" title="新浪网:<br>http://www.sina.com.cn">新浪</a>

<a href="http://www.sohu.com.cn" style="font-size:24pxfont-weight:bold" title="搜狐网:<br>http://www.sohu.com.cn">搜狐</a>

</body>

</html>

<script src="styleAlt.js"></script>