使关闭图像出现在右上角的DIV [英] Making A Close Image Appear On Top Right Corner Of A DIV

查看:132
本文介绍了使关闭图像出现在右上角的DIV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何让右上角的小叉号(近)的图像出现在div中。使用CSS和XHTML。谢谢

I wanted to know how to make a small cross (close) image appear on the top right inside of a div. Using CSS and XHTML. Thanks

推荐答案

你可以做这样的:的 http://jsfiddle.net/steweb/7JEAZ/

标记:

<div id="panel"><a id="close" href="#"></a></div>

css:

#panel{
    width:100px;
    height:100px;
    background:red;
}
#close{
    display:block;
    float:right;
    width:30px;
    height:29px;
    background:url(http://digitalsbykobke.com/images/close.png) no-repeat center center;
}

这篇关于使关闭图像出现在右上角的DIV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆