MozTW 討論區 https://forum.moztw.org/ |
|
天空部落格 個人圖檔置中問題 https://forum.moztw.org/viewtopic.php?f=13&t=30172 |
第 1 頁 (共 1 頁) |
發表人: | white9cat [ 2010-05-10, 09:30 ] |
文章主題 : | 天空部落格 個人圖檔置中問題 |
http://blog.yam.com/user/redqcat.html (網址如上) 我原本是用IE8的,最近轉用FF,發現部落格整個破碎的很淒厲,所以做了不少修改,可是個人圖檔一直無法置中。 (HTML擷取) <div class="boxProfile1"> <div class="sideContent"> <a id="profile_img_link" href="http://blog.yam.com/user_data.php?BLOG_ID=redqcat"> <img id="profile_img" class="profile" src="http://profile.yamedia.tw/r/e/redqcat/index.jpg?1239603786" alt="個人圖檔"> </a> <div style="clear: both;"> </div> <span class="highlight">ID:</span>redqcat<br> <span class="highlight">暱稱:</span>九命<br> </div> </div> (CSS) 我是用 text-align : center; 直接大範圍圖文置中,可是不知道為什麼,個人圖檔在FF中,沒有置中…… 希望有誰可以教我一下,要怎麼讓個人圖檔在IE和FF中都置中。 (目前卡在無法讓FF和IE都在同一個位置上(靠左靠右),再用相對位置推到中間, 也不知道怎麼只在FF狀態下,把個人圖檔往中間推……) |
發表人: | coolcd [ 2010-05-10, 10:07 ] |
文章主題 : | Re: 天空部落格 個人圖檔置中問題 |
http://moztw.org/docs/gecko/webdevfaq/ 引言回覆: 「text-align: center;」是將某個區塊(block)內的 inline 內容置中,而不是(也不該是)用來將區塊本身置中的。要將區塊置中,可以將「margin-left」及「margin-right」屬性設定為 auto,並將「width」指定一數值、讓該區塊比其容器區塊(containing block)來得小即可。 或者不設 width,設定 margin-left 、margin-right。 |
發表人: | white9cat [ 2010-05-10, 16:39 ] |
文章主題 : | Re: 天空部落格 個人圖檔置中問題 |
1.我的文字還是要置中,所以我不能捨棄掉原本的設定,必須針對圖檔作修正。 2.我不是很懂樓上的大大的意思,希望大大可以解釋一下。 3.如果直接放棄原本的設定,用MARGIN/PADDING做推移,會造成個人圖檔下方的文字,跟著跑位,無法文字置中。 4.我嘗試使用過margin-left:auto; margin-right:auto; 結果是靠邊站,而沒有置中。 |
發表人: | coolcd [ 2010-05-10, 21:41 ] |
文章主題 : | Re: 天空部落格 個人圖檔置中問題 |
不太清楚你想怎麼排版,CSS 教學可以參考 http://ant4css.blogspot.com/2009/02/center.html ![]() |
第 1 頁 (共 1 頁) | 所有顯示的時間為 UTC + 8 小時 |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |