2016-01-21 170 views
0

我已經在這裏嘗試了幾個答案,一直未能找到正在發生的事情。設置錨標籤寬度

我正在做一個wordpress網站,我有一些知識,但我不是一個專家,我沒有成功地完成我所期待的。

這是交易,我試圖將社交圖標放置在網站(wordpress,主題)的頁腳中。當我把圖像,它看起來像它的目的是要做到:

The left column shows the icons properly aligned

當我開始放置錨標籤像這樣(只是一個圖標有錨標籤):

<div> 
    <a href="[full link to your Facebook page]"> 
     <img title="Facebook" src="http://fundacionhonrarlavida.eu/wp-content/uploads/2016/01/1453371609_Facebook.png" alt="Facebook" width="35" height="35" /> 
    </a> 
    <img title="Twitter" src="http://fundacionhonrarlavida.eu/wp-content/uploads/2016/01/1453371295_twitter_social_media_online.png" alt="Twitter" width="35" height="35" /> 
    <img title="YouTube" src="http://fundacionhonrarlavida.eu/wp-content/uploads/2016/01/1453416978_youtube.png" alt="YouTube" width="35" height="35" /> 
    <img title="LinkedIn" src="http://fundacionhonrarlavida.eu/wp-content/uploads/2016/01/1453417011_linkedIN.png" alt="LinkedIn" width="35" height="35" /> 
    <img title="Mail" src="http://fundacionhonrarlavida.eu/wp-content/uploads/2016/01/1453417082_mail.png" alt="Mail" width="35" height="35" />  
</div> 

有一個鏈接的人將整個行移動並將其他人移動到下一個。

我試圖檢查移動的圖標,並按照此圖像實現的,即以整個空間的錨固性,多數民衆贊成,因爲圖像的尺寸是否合適:

Is the Anchor tag that is taking the whole space

現在,我已經試過很多事情,在img a ccs中,我放置在塊,內聯塊,並且我總是得到相同的結果。

Jus作爲一個測試,我試圖使用社交圖標插件和圖標也垂直顯示。

下面是關於IMG的CSS:

a img, a { 
    display: inline-block 
    border: none; 
    outline:none; 
} 
a { 
    outline:none; 
    text-decoration: none; 
    color:#525252; 
} 

我也創建了一個類.footer一個,在那裏我指定錨的大小,但它沒有幫助。

你能指點我正確的方向嗎?

+1

這是相當困難來幫助你,當你只有提供的圖像和代碼有點用。該頁腳有很多事情發生,這可能是導致你的問題的一些事情。你能夠提供更多的代碼,或者做一個jsfiddle或plunkr嗎? –

+0

在控制檯視圖中,開始檢查並取消選中CSS規則,直到找到引起問題的規則。 –

+0

但是,要猜測,我會說你也可能只是想設置邊距和填充爲0。 –

回答

0

嘗試在「內聯元素」內使用: style =「position:absolute;」

或者在CSS中添加一個類,其位置如下: position:absolute;

0

我會與下面的樣式規則開始:

.textwidget > div > a { 
display: inline-block; 
width: 35px; 
height: 35px; 
margin: 0; 
padding: 0; 
} 
+0

我想我明白這一點,爲什麼......可以放在styles.css文件的任何位置? –

+0

它非常具體,因爲它將_only_應用於作爲'textwidget'類的元素的直接子元素的'div'的直接子元素,所以很可能是。聲明越具體,其在瀑布中的位置就越不重要。 – Rounin

+0

試過...但沒有工作...... :( –