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想让块靠右该如何实现的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

css里面有哪些选择器

css如何实现底部tapbar栏效果

css怎么设置无边框

js如何控制css

css中浮动是什么意思

css flex布局的优缺点是什么

css可以去掉浮动吗?

css怎么去掉输入框的边框

css什么意思?

css语言入门视频教程推荐

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




打赏

取消

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

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

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

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

评论

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