2014-01-18 59 views
1

我正在練習網頁設計,並在網址www.bigchip.co.nf有一個網頁,我不知道爲什麼我不能得到按鈕說變更日期放在圖片和小說明下方。我認爲這很清楚:對芯片圖像的權利將使按鈕下降一個新的線。這樣做是否正確的方式將它們放入div來分離它們?不能弄清楚一點點的CSS做清除屬性

+2

請分享一些代碼,例如jsfiddle.net。 – meavo

+1

'更改日期** **是**下面的圖片和描述...? Chrome - 32.0.1700.72 m – MElliott

+0

你想在哪裏放置按鈕? – radha

回答

0

在看了你的頁面之後,我發現圖片沒有浮動,導致圖片清晰:對它不起作用..你可以做的是在圖片元素之後添加一個br標籤來推動變化日期按鈕到元素的底部。

<div id="container"> 
    <h1 id="header">BigChip.com</h1> 

    <ul id="nav"> 
     <li class="li1"><a href="home.html">Home</a></li> 
     <li class="li2"><a href="gallery.html">Gallery</a></li> 
     <li class="li3"><a href="funny_chips.html">Funny Chips</a></li> 
     <li class="li4"><a href="sign_in.html">Sign In</a></li> 
    </ul> 

    <p id="description"> 
     Welcome to BigChip.com! The site with the biggest chips on the web. Get involved by uploading your own chips or browse through our gallery where your find all the chips uploaded by other users. 
    </p> 

    <h2 id="biggest_chip">Today's Biggest Chips!</h2> 

    <img id="chipsimg" src="images/chips.jpg"> 
    <br /> 
    <button id="button" type="button" onclick="change_date()">Change Date</button> 

</div> 
+1

這就是我正在尋找的內容,我將在未來更多地使用
元素,而不是將所有內容封裝在div中。謝謝 – Jake

+0

或者你可以改變圖像的顯示屬性爲「阻止」在CSS(而不是默認的「內聯」),這將避免需要額外的標記。 – pwdst