2016-12-20 65 views
0

我真的不知道該怎麼做。 當我更改CSS我的瀏覽器根據我的CSS樣式表不改變網頁

的情況是這樣的瀏覽器沒有改變: 我有一個名爲wraper在CSS和HTML類,這個類是一個div包裝2名兒童的div 我申請display : none這一類,所以這個類應該是不可見的,但事實上,在div可見

所以我檢查元素,我發現DIV沒有在瀏覽器控制檯

這裏一流的,只是用戶代理樣式表截圖:

CSS

browser console

div class='wraper'只有用戶代理樣式表,即使我設置高度和寬度,以900px和300像素,當我檢查div有1343px X 0像素

所述的HTML的結構是這樣的:

<div class='wraper'> 
<div class='gambar-testi'></div> 
<div class='preview-testi'><h2> Testimoni</h2> 
<span>Lorem ipsum dolor sit amet, consectetur 
adipiscing elit. Pellentesque erat ex, dapibus sit 
amet lobortis eget, consequat vel nisi. Aliquam ac 
enim eget libero pretium venenatis id sed nibh.</span></div> 

和CSS:

.wraper { 
width : 900px; 
height : 300px; 
display : none; 
} 
.gambar-testi { 
display : inline-block; 
margin : 10px; 
background-color : red; 
width : 47%; 
height : 340px; 
} 

.preview-testi { 
width : 47%; 
display : inline-block; 
margin : 0 30px; 
} 
.preview-testi span { 
font-size : 30px; 
} 

另一個問題,我只是改變從float : left.gambar-testi屬性display : inline-block幾分鐘前 我檢查在瀏覽器控制檯的元素,並將其顯示屬性仍然float : left尚未改變display : inline-block

enter image description here

.wraper { 
 
\t width : 900px; 
 
\t height : 300px; 
 
\t display : none 
 
} 
 
.gambar-testi { 
 
\t display : inline-block; 
 
\t margin : 10px; 
 
\t background-color : red; 
 
\t width : 47%; 
 
\t height : 340px; 
 
} 
 

 
.preview-testi { 
 
\t width : 47%; 
 
\t display : inline-block; 
 
\t margin : 0 30px; 
 
} 
 
.preview-testi span { 
 
\t font-size : 30px; 
 
    color : black; 
 
}
<html> 
 
    <head></head> 
 
    <body> 
 
<div class="wraper"> 
 
\t <div class="gambar-testi"></div> 
 
\t <div class="preview-testi"><h2> Testimoni</h2> 
 
\t <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque erat ex, dapibus sit amet lobortis eget, consequat vel nisi. Aliquam ac enim eget libero pretium venenatis id sed nibh.</span> 
 
    </div> 
 
</div> 
 
    </body> 
 
    </html>

我也試過的jsfiddle重現問題,但結果沒有顯示這裏是鏈接:https://jsfiddle.net/xqxkzhfL/

也試圖在SO代碼片斷創建,但結果沒有顯示太 請幫我已經穿上」知道該怎麼辦了......這是我所知道的,到目前爲止

編輯 對不起,我是愚蠢的,在的jsfiddle和SO代碼片段我申請display : none.wraper這樣的課程是不顯示的結果,因爲顯示器是沒有... 是的在jsfiddle和SO代碼片段中工作,但它不工作在我的本地主機.....爲什麼?

+0

是你使用某種類型的CMS?像drupal,wordpress? –

+0

你檢查過你的瀏覽器catch嗎? –

+0

不...我只是使用xampp。記事本++,並在本地主機 – Citra45Abadi

回答

0

請確保您的瀏覽器不會緩存你的舊網頁 在Chrome中,保持「開發者控制檯(F12)出現,然後設置 - >網絡 - >禁用緩存(而DevTools是打開的)enter image description here

相關問題