css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose
来源:懂视网
责编:小采
时间:2020-11-27 16:33:52
css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose
css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose: .spot{ position: relative; display: list-item; margin: 5px; width: 30px; height: 30px; border-radius: 60px; left: 98%; } .spot:hover{ background-color: #0080ff; } .header{ background-color: #262626; margin: 20px auto; width: 95%; height: 1
导读css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose: .spot{ position: relative; display: list-item; margin: 5px; width: 30px; height: 30px; border-radius: 60px; left: 98%; } .spot:hover{ background-color: #0080ff; } .header{ background-color: #262626; margin: 20px auto; width: 95%; height: 1
spot的top:35%没作用,怎么能放到右边空白区域,最好能中间container容器放大后,放置在其上面?谢谢大神!
回复讨论(解决方案)
你是相对定位的
top: -500px;
你是相对定位的
top: -500px;
谢x谢!relative相对的的元素是相邻的上级元素吗?
谢谢!
你是相对定位的
top: -500px;
谢x谢!relative相对的的元素是相邻的上级元素吗?
不是,
relative是相对于元素原本的位置进行偏移。
css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose
css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose: .spot{ position: relative; display: list-item; margin: 5px; width: 30px; height: 30px; border-radius: 60px; left: 98%; } .spot:hover{ background-color: #0080ff; } .header{ background-color: #262626; margin: 20px auto; width: 95%; height: 1