<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/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/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/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/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/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > <img class="spot lazy" src="/static/imghwm/default1.png" data-src="img/spot.png" alt="css效果:怎么把spot的元素放置在网页的右边空白区域_html/css_WEB-ITnose" > </div> </body>
谢谢!
你是相对定位的
top: -500px;
谢x谢!relative相对的的元素是相邻的上级元素吗?
不是,
relative是相对于元素原本的位置进行偏移。

HTML、CSS和JavaScript在網頁開發中的角色分別是:HTML負責內容結構,CSS負責樣式,JavaScript負責動態行為。 1.HTML通過標籤定義網頁結構和內容,確保語義化。 2.CSS通過選擇器和屬性控製網頁樣式,使其美觀易讀。 3.JavaScript通過腳本控製網頁行為,實現動態和交互功能。

HTMLISNOTAPROGRAMMENGUAGE; ITISAMARKUMARKUPLAGUAGE.1)htmlStructures andFormatSwebContentusingtags.2)itworkswithcsssforstylingandjavascript for Interactivity,增強WebevebDevelopment。

HTML是構建網頁結構的基石。 1.HTML定義內容結構和語義,使用、、等標籤。 2.提供語義化標記,如、、等,提升SEO效果。 3.通過標籤實現用戶交互,需注意表單驗證。 4.使用、等高級元素結合JavaScript實現動態效果。 5.常見錯誤包括標籤未閉合和屬性值未加引號,需使用驗證工具。 6.優化策略包括減少HTTP請求、壓縮HTML、使用語義化標籤等。

HTML是一種用於構建網頁的語言,通過標籤和屬性定義網頁結構和內容。 1)HTML通過標籤組織文檔結構,如、。 2)瀏覽器解析HTML構建DOM並渲染網頁。 3)HTML5的新特性如、、增強了多媒體功能。 4)常見錯誤包括標籤未閉合和屬性值未加引號。 5)優化建議包括使用語義化標籤和減少文件大小。

WebDevelovermentReliesonHtml,CSS和JavaScript:1)HTMLStructuresContent,2)CSSStyleSIT和3)JavaScriptAddSstractivity,形成thebasisofmodernWebemodernWebExexperiences。

HTML的作用是通過標籤和屬性定義網頁的結構和內容。 1.HTML通過到、等標籤組織內容,使其易於閱讀和理解。 2.使用語義化標籤如、等增強可訪問性和SEO。 3.優化HTML代碼可以提高網頁加載速度和用戶體驗。

htmlisaspecifictypefodyfocusedonstructuringwebcontent,而“代碼” badlyLyCludEslanguagesLikeLikejavascriptandPytyPythonForFunctionality.1)htmldefineswebpagertuctureduseTags.2)“代碼”代碼“ code” code code code codeSpassSesseseseseseseseAwiderRangeLangeLangeforLageforLogageforLogicIctInterract

HTML、CSS和JavaScript是Web開發的三大支柱。 1.HTML定義網頁結構,使用標籤如、等。 2.CSS控製網頁樣式,使用選擇器和屬性如color、font-size等。 3.JavaScript實現動態效果和交互,通過事件監聽和DOM操作。


熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

mPDF
mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),

Atom編輯器mac版下載
最受歡迎的的開源編輯器

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能

PhpStorm Mac 版本
最新(2018.2.1 )專業的PHP整合開發工具

WebStorm Mac版
好用的JavaScript開發工具