我有一張圖像需要放置在左側的內容右側。我已經確定,要做到這一點,需要我絕對放置物體。如果尺寸小於圖像標籤定義的尺寸,我也需要圖像保持相同的尺寸,否則圖像需要縮小以適應邊界。這全部可能嗎?強制圖像到特定位置
如果可以的話,謝謝!
我使用HTML,CSS和JavaScript(僅在必要時請!)
下面是一些代碼來看看:)
function createQuestions(id) {
var tReturn="<form style=\"text-align: left;width: 33.33333%;background-color: lightblue;border=1px solid #000000;padding: 10px\">";
tReturn=tReturn+"<b>Questions "+(id+1)+":</b><br /> <i>"+Questions[id].Question+"</i><br /><br />";
for (var i=0,l=Questions[id].Values.length;i<l;i++) {
tReturn=tReturn+"<input onClick=\"checkAnswer("+id+","+i+",this)\" type=\"button\" value=\""+Letters[i]+"\" style=\"width:50px\" />. "+Questions[id].Values[i]+"<br />";
}
//V----- THIS LINE BELOW!
//tReturn=tReturn+"<img src='images/test.jpg' style=' />"
tReturn=tReturn+"</form>";
return tReturn;
}
你有任何代碼,我們可以看看嗎?你到目前爲止嘗試過哪些方法無效? – Seth 2011-05-02 18:11:58
現在我確實有一些源代碼:) – FreeSnow 2011-05-02 18:13:50