html中相对定位与绝对定位


当前第2页 返回上一页

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

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

#divAddress{

     position: relative;

     margin-top: 48px;//这就是刚才提的当使用margin的时候才能进行下面的相对

     width: 370px;

     height: 66px;

     border-bottom: 1px #c1c1c1 solid;

 }

 #img1{

     position: absolute;

     float: left;margin-top:2px;

     width: 24px; height: 24px;

 }

 .address{

     position: absolute;

     margin-left: 34px;

     font-size: 20px;

     color: #c1c1c1;

 }

 

#peoplePost1{

     position: relative;

     margin-top: 12px;

     width: 370px;

     height: 40px;

     border-bottom: 1px #c1c1c1 solid;

 }

 #people1{

     position: absolute;

     float: left;margin-top:2px;

     width: 24px; height: 24px;

 }

 .people2{

     position: absolute;

     margin-left: 34px;

     font-size: 20px;

     color: #c1c1c1;

 }

 #post1{

     position: absolute;

     float: left;margin-top:2px;margin-left:192px;

     width: 24px; height: 24px;

 }

 .post2{

     position: absolute;

     margin-left: 222px;

     font-size: 20px;

     color: #c1c1c1;

 }

 

<div id="divAddress">

     <img id="img1" alt="address" src="<%=request.getContextPath()%>/images/address.png">

     <div class="address">地址 : <span style="font-weight: 600;color: black;">输入上海市卢湾区卢湾榜路758弄10号1011室</span></div>

 </div>

 

<div id="peoplePost1">

     <img id="people1" alt="people" src="<%=request.getContextPath()%>/images/people.png">

     <div class="people2">联系人 : <span style="font-weight: 600;color: black;">张三</span></div>

     <img id="post1" alt="post" src="<%=request.getContextPath()%>/images/post.png">

     <div class="post2">职位 : <span style="font-weight: 600;color: black;">业务经理</span></div>

 </div>

上面也就是相对和绝对结合的html代码,以上就是本文的所有内容了,希望可以给大家带来帮助!

相关推荐:

html的绝对路径和相对路径怎么使用

相对定位或绝对定位的适用条件

css绝对定位实现居中的八种方式代码详解

以上就是html中相对定位与绝对定位的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

Html <!doctype> 是什么

Html如何实现点击下载文件功能

Html怎样使文字居中

Html audio标签怎么用

Html marquee标签如何设置图片滚动?marquee标签的图片滚动代码实例

HtmlHtml5 的区别是什么?

Html上标<sup>与下标注<sub>标签元素

基于Html如何做出多图上传预览效果

Html标签中lang的作用

详谈Html中script标签(附代码)

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




打赏

取消

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

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

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

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

评论

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