最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

Cs中的相对定位和绝对定位问题(菜鸟问题)_html/css

来源:懂视网 责编:小采 时间:2020-11-27 16:33:05
文档

Cs中的相对定位和绝对定位问题(菜鸟问题)_html/css

Cs中的相对定位和绝对定位问题(菜鸟问题)_html/css_WEB-ITnose:无标题文档.parent{ width:700; height:100; top:5px; left:5px; position:relative; background-color:#366} #duanlu{ text-align:right; right:10px; bottom:10pX; position:absolute; }sdfsdds
推荐度:
导读Cs中的相对定位和绝对定位问题(菜鸟问题)_html/css_WEB-ITnose:无标题文档.parent{ width:700; height:100; top:5px; left:5px; position:relative; background-color:#366} #duanlu{ text-align:right; right:10px; bottom:10pX; position:absolute; }sdfsdds

无标题文档sdfsddsd


我这样写为什么页面上没有任何显示了呢.... 我是在看<<精通Css:高级Web解决方案>>这本书的时候有一小段这样的代码... 求解释.....


回复讨论(解决方案)

.parent
{

width:700 px;
height:100 px;
top:5px;
left:5px;
position:relative;
background-color:#366}

#duanlu
{
text-align:right;
right:10px;
bottom:10pX;
position:absolute;
}

注意单位么有写。

.parent
{

width:700px;
height:100px;
top:5px;
left:5px;
position:relative;
background-color:#366}

#duanlu
{
text-align:right;
right:10px;
bott……
++

相对定位(relative),绝对定位(absolute)简单说下。
当父级设置了相对定位,那他里面的元素如果设置了绝对定位,那么这个定位坐标是应离他最近的一个设置了相对定位的父级去坐参考,反之如果这个元素所有的父级都没有设置成相对定位,那就是以默认的body为参考,即整个窗口了。

.parent
{

width:700px;
height:100px;
top:5px;
left:5px;
position:relative;
background-color:#366}

#duanlu
{
text-align:right;
right:10px;
bottom:10pX;
position……


dui

文档

Cs中的相对定位和绝对定位问题(菜鸟问题)_html/css

Cs中的相对定位和绝对定位问题(菜鸟问题)_html/css_WEB-ITnose:无标题文档.parent{ width:700; height:100; top:5px; left:5px; position:relative; background-color:#366} #duanlu{ text-align:right; right:10px; bottom:10pX; position:absolute; }sdfsdds
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top