2013-09-27 34 views
0

我還是一個新的CSS,所以請原諒我,如果這個問題聽起來很基本(是)。長話短說,我目前正在爲我的學校開展Ning社交網絡中心的工作,並且足以說有一個預製的預裝設置對於真正的定製並不完美。我已經將母版設置爲背景圖像,並且我希望母版頁上的所有鏈接(全部通向同一網絡上的不同頁面)也具有該背景圖像。我能夠使用母版上的CSS框來表現背景圖像,但對於我來說,我無法想出一種方法來對任何女兒頁面鏈接做同樣的事情。我嘗試添加和更改他們的ID,但它只會導致div被添加到它們中,而當您實際單擊鏈接並轉到該頁面時,並不完全是背景更改。這並不複雜,我知道我錯過了一些基本的東西。誰能幫忙?爲女兒頁面設置相同的背景圖像

這裏是我的「母親頁」中的HTML代碼:

<p><span class="font-size-3" style="color: #000000;"><strong><strong>1. <a  href="http://pharmacypeertopeeradvising.ning.com/page/healtheast-st-john-s-hospital-2012-2013-reviews" target="_self" id="AcuteCareAPPE">HealthEast St.John's Hospital, Maplewood</a></strong></strong></span></p> 

<p><span class="font-size-3" style="color: #000000;"><strong><strong>2. <a href="http://pharmacypeertopeeradvising.ning.com/page/fairview-university-of-minnesota-medical-center-minneapolis-2012-" target="_self" id="AcuteCareAPPE">Fairview UMMC, Minneapolis</a></strong></strong></span></p> 

<p><span class="font-size-3" style="color: #000000;"><strong><strong>3. <a href="http://pharmacypeertopeeradvising.ning.com/page/park-nicollet-methodist-hospital-minneapolis-2012-2013-reviews" target="_self" id="AcuteCareAPPE">Park Nicollet Methodist Hospital, St. Louis Park</a></strong></strong></span></p> 

<p><span class="font-size-3" style="color: #000000;"><strong>4. </strong></span><span class="font-size-3" style="color: #000000;"><strong><a href="http://pharmacypeertopeeradvising.ning.com/page/united-hospital-allina-2012-2013-reviews" target="_self" id="AcuteCareAPPE">Allina United Hospital, St. Paul</a></strong></span></p> 

<p><span class="font-size-3" style="color: #000000;"><strong>5. <a href="http://pharmacypeertopeeradvising.ning.com/page/regions-hospital-level-1-trauma-center-st-paul" target="_self" id="AcuteCareAPPE" name="AcuteCareAPPE">HealthPartners Regions Hospital-Level 1 Trauma Center, St. Paul</a></strong></span></p> 

而這裏的CSS代碼中,我已經得到了。由於其寧網,CSS被放置在一個「盒子」上的「母頁面」的底部:

<style> 

#AcuteCareAPPE{ 
background-image:url(http://www.acutecarecontinuum.com/Portals/0/IMG_3192_ver2.jpg); 

background-position: -50px, +10px; 

} 

</style> 

所以你看,我試圖讓鏈接到這些4頁(全具有相同的AcuteCareAPPE ID)具有相同的背景,但是我的CSS代碼最終會返回包含這些鏈接的背景圖像的div。接下來我應該做什麼?

+0

看起來像段落被濫用作爲標記中的有序列表和* lot *表示樣式。 – cimmanon

回答

0

改爲使用類。每個頁面允許一個ID。不知道你想要做什麼,但如果你解釋這個codepen鏈接應該發生什麼,我可以幫助你。我更新了您的代碼,以使用無序列表。 http://codepen.io/anon/pen/aJhBl

+0

嗨bradcush,感謝您的codepen鏈接!這是我遇到的問題:我想要設置從這些鏈接導向的所有頁面,當你到達那裏時有相同的背景圖像(即點擊鏈接,到達該頁面,並且頁面現在具有新的背景圖像),而不是圍繞鏈接本身的簡單div。 – user2534182