css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose
<style type="text/css"> .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: 160px; border-radius: 20px; font-weight: bold; font-size: 25px; color: #2b669a; text-align: center; } .hd_btn_submit,.hd_input{ position: relative; float: right; top:10%; } .show_img{ position: relative; background-color: #245269; height: 500px; width: 80%; border-radius: 20px; left: 35px; } </style></head><body> <div class="header"> <p>标题</p> <button class="hd_btn_submit" type="submit">register</button> <label> <input class="hd_input" type="text"> </label> </div> <div class="container_showImg"> <div class="show_img"></div> <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > </div></body>
spot的top:35%没作用,怎么能放到右边空白区域,最好能中间container容器放大后,放置在其上面?谢谢大神!
回复讨论(解决方案)
你是相对定位的
top: -500px;
<style type="text/css"> .spot{ display:list-item; margin: 5px; width: 30px; height: 30px; border-radius: 60px; } .spot:hover{ background-color: #0080ff; } .header{ background-color: #262626; margin: 20px auto; width: 95%; height: 160px; border-radius: 20px; font-weight: bold; font-size: 25px; color: #2b669a; text-align: center; } .hd_btn_submit,.hd_input{ position: relative; float: right; top:10%; } .show_img{ float:left; background-color: #245269; height: 500px; width: 80%; border-radius: 20px; left: 35px; } </style></head><body> <div class="header"> <p>标题</p> <button class="hd_btn_submit" type="submit">register</button> <label> <input class="hd_input" type="text"> </label> </div> <div class="container_showImg"> <div class="show_img"></div> <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > </div> </body>
你是相对定位的
top: -500px;
谢x谢!relative相对的的元素是相邻的上级元素吗?
<style type="text/css"> .spot{ display:list-item; margin: 5px; width: 30px; height: 30px; border-radius: 60px; } .spot:hover{ background-color: #0080ff; } .header{ background-color: #262626; margin: 20px auto; width: 95%; height: 160px; border-radius: 20px; font-weight: bold; font-size: 25px; color: #2b669a; text-align: center; } .hd_btn_submit,.hd_input{ position: relative; float: right; top:10%; } .show_img{ float:left; background-color: #245269; height: 500px; width: 80%; border-radius: 20px; left: 35px; } </style></head><body> <div class="header"> <p>标题</p> <button class="hd_btn_submit" type="submit">register</button> <label> <input class="hd_input" type="text"> </label> </div> <div class="container_showImg"> <div class="show_img"></div> <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghw/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > </div> </body>
谢谢!
你是相对定位的
top: -500px;
谢x谢!relative相对的的元素是相邻的上级元素吗?
不是,
relative是相对于元素原本的位置进行偏移。

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

熱門話題

本文討論了HTML&lt; Progress&gt;元素,其目的,樣式和與&lt; meter&gt;元素。主要重點是使用&lt; progress&gt;為了完成任務和LT;儀表&gt;對於stati

本文討論了html&lt; datalist&gt;元素,通過提供自動完整建議,改善用戶體驗並減少錯誤來增強表格。Character計數:159

本文討論了使用HTML5表單驗證屬性,例如必需的,圖案,最小,最大和長度限制,以直接在瀏覽器中驗證用戶輸入。

本文討論了HTML&lt; meter&gt;元素,用於在一個範圍內顯示標量或分數值及其在Web開發中的常見應用。它區分了&lt; meter&gt;從&lt; progress&gt;和前

本文討論了視口元標籤,這對於移動設備上的響應式Web設計至關重要。它解釋瞭如何正確使用確保最佳的內容縮放和用戶交互,而濫用可能會導致設計和可訪問性問題。

本文討論了&lt; iframe&gt;將外部內容嵌入網頁,其常見用途,安全風險以及諸如對象標籤和API等替代方案的目的。

HTML適合初學者學習,因為它簡單易學且能快速看到成果。 1)HTML的學習曲線平緩,易於上手。 2)只需掌握基本標籤即可開始創建網頁。 3)靈活性高,可與CSS和JavaScript結合使用。 4)豐富的學習資源和現代工具支持學習過程。
