看板 Web_Design 關於我們 聯絡資訊
※ 引述《drlai (蘇打)》之銘言: : 我想要將一個方塊置中 : 然後方塊內的文字靠左 : 以下是我寫的 : <html> : <head> : <style> /* div.test { text-align:center; } 這個應該不用,規定上不能使區塊置中 */ : div.test2 : { : font-size: 13px; : width: 100px; : border: 1px solid black; : text-align:left; position:absolute; left:50%; margin-left:-50px; : } : </style> : </head> : <body> <!-- <div class="test"> --> : <div class="test2"> : test : </div> <!-- </div> --> : </body> : </html> : 但以上僅是用於IE : 用FX,沒辦法讓文字方塊置中 : FX目前的解決方式是在class="test" 後面加上 align="center" : 才能顯示出與IE相同的畫面 : 那有辦法改CSS來修正嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.135.148.39 ※ 編輯: medicalwei 來自: 220.135.148.39 (01/23 08:54)