2016-06-08 75 views
1

我試圖讓我的bigcartel頁面顯示Bigcartel移動僅

<div style="margin-top: 0px; img align: middle"> 
     <a href="/products"><img width="420" height="42" style="vertical-align:middle;" src="https://i.imgsafe.org/52c5068376.png" alt="PAF ENTRY"></a> 
</div> 
在移動設備上

只是試圖顯示瀏覽器的代碼只 這裏的精確副本是頁面 http://pafclub.bigcartel.com/entry

這是我到目前爲止有:

<div class="mobileHide"> 
<div style="margin-top: 0px; img align: middle"> 
<a href="/products"><img width="420" height="42" style="vertical-  align:middle;" src="https://i.imgsafe.org/52c5068376.png" alt="PAF ENTRY"></a>  </div> 
<style type="text/css"> 
.mobileHide { display: inline;} 
/* Smartphone Portrait and Landscape */ 
@media only screen 
and (min-device-width : 320px) 
and (max-device-width : 480px){ .mobileHide { display: none;}} 
</style> 

<div class="mobileShow"> 
<div style="margin-top: 120px; margin-bottom: 10px; text-align: center;"> 
<a href="/products"><img width="420" height="42" style="vertical-align:middle;" src="https://i.imgsafe.org/52c5068376.png" alt="PAF ENTRY"></a> 
</div> 
<style type="text/css"> 
.mobileShow { display: none;} 
/* Smartphone Portrait and Landscape */ 
@media only screen 
and (min-device-width : 320px) 
and (max-device-width : 480px){ .mobileShow { display: inline;}} 
</style> 

它顯示的圖像的一個版本,但是當我檢查移動設備上的療法e根本就沒有圖像。

回答

0

的主題有代碼,增加了一個保證金,你需要重寫自定義頁面機構。這種添加到自定義設計>高級的底部> CSS將其刪除:

#entry .page { 
    margin: 0 auto; 
} 

然後爲你的登錄頁面,所有你需要的是下面的代碼有圖像顯示正確居中(桌面和移動)

<a href="/products"> 
    <img style="width:100%;margin:0 auto;max-width: 427px;display:block" src="https://i.imgsafe.org/7da3920e19.png" alt="ENTRY"> 
</a> 
0

我已經解決了您的問題,併爲此解決了問題。請檢查代碼。

.mobileHide { display:table; height:100%; text-align:center; vertical-align:center; width:100%;} 
 
.middle{ display:table-cell; height:100%; vertical-align:middle; width:100%;} 
 
.middle a{ max-width:80%; display:inline-block;} 
 
.middle a img{ max-width:100%;} 
 

 
html, body { 
 
    \t height: 100%; 
 
\t \t margin: 0px; 
 
\t } 
 
<div class="mobileHide"> 
 
<div class="middle"> 
 
    <a href="/products"> 
 
    <img width="420" height="" src="https://i.imgsafe.org/52c5068376.png" alt="PAF ENTRY"> 
 
    </a> 
 
    </div> 
 
    <div style="clear:both;"></div> 
 
</div>

+0

我在哪裏把上半部分的代碼,CSS?此外,這使我的形象正確的中間,我真的很想這麼感謝。 – Spooked