如何使用CSS 浮动

2025-05-09 14:38:51

1、定义图像浮动于文章的左面。<style type="text/css">img{float:left}</style>

如何使用CSS 浮动

3、定义一个标题图像,并让其出现在文章的右面。<style type="text/css">div{float:right;width:120px;margin:0 0 15px 20px;padding:15px;border:1px solid black;text-align:center;}</style><body><div><img src="/i/e.gif" /><br />CSS is fun!</div>

如何使用CSS 浮动

5、利用浮动代码与链接代艨位雅剖码再结合表格做一个导航条。<style type="text/css">ul{float:left;width:100%;padding:0;margin:0;list-style-type:none;}a{float:left;width:7em;text-decoration:none;color:white;background-color:purple;padding:0.2em 0.6em;border-right:1px solid white;}a:hover {background-color:#ff3300}li {display:inline}</style>

如何使用CSS 浮动
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢