css想让块靠右该如何实现


当前第2页 返回上一页

属性值:

  • left 元素向左浮动。

  • right 元素向右浮动。

  • none 默认值。元素不浮动,并会显示在其在文本中出现的位置。

  • inherit 规定应该从父元素继承 float 属性的值。

代码实现:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

<html>

<head>

<style type="text/css">

img

{

float:right

}

</style>

</head>

 

<body>

<p>在下面的段落中,我们添加了一个样式为 <b>float:right</b> 的图像。结果是这个图像会浮动到段落的右侧。</p>

<p>

<img src="/i/eg_cute.gif" />

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

</p>

</body>

 

</html>

实现效果:

43c7e9871412d28526b2c5b45a4941a.png

相关推荐:CSS教程

以上就是css想让块靠右该如何实现的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

display:inline是什么意思?

css的id选择器怎么定义

详解css处理长短文本内容的几种小技巧(值得收藏)

css中无继承性的属性有哪些

css target-position属性怎么用

详解三种css3模糊背景效果(代码实例)

css字体有哪些

css border-width属性怎么用

::before有什么作用?::before与:before的区别是什么?

css3实现卡片效果

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...