这是我的代码: 更新:jsfiddle hre:http://jsfiddle.net/vn0nwztg/3/
<a href="#" class="cancel_link_formating"><article class="article_container">
<p class="article_tag2">Month Highlight</p>
<img class="article_tag_country_flag" src="C:\Users\laurent\GoogleDrive\whichmeal\programing\Website building pinegrow_2\images\flags\flags\flags\32\Singapore.png">
<img class="article_image_hompage" src="C:\Users\laurent\Google Drive\whichmeal\App content\content country\Singapore\pics\around_food\singapore_river_v2.jpg">
<h2 class="article_title_hompage">So Singapore !</h2>
<p class="article_text_hompage">Singapore , officially the Republic of Singapore, is a sovereign city-state and island country in Southeast Asia.
It lies off the southern tip of the Malay Peninsula and is 137 kilometres (85 mi) north of the equator [...]</p>
</article></a>
正如你所看到的,我把整篇文章包好了#34;在&#34; a&#34;属性。 Bootstrap不知何故仅在最后&#34; p&#34;上应用其链接样式。元件。 我通过添加attrivbute a&#34; cancel_link_formating&#34;设法修改此元素的样式。 ...在外部样式表中
问题是:我想将相同的样式应用于&#34; h2&#34;属性。我该如何实现这一目标?
我的css:
.article_text_hompage{
font-size:16px;
padding:10px 0px 0px 0px;
width:90%;
display:block;
text-align:center;
margin-left:auto;
margin-right:auto;
font-family: "Roboto Slab","cambria";
}
a.cancel_link_formating{
color:#2C3646;
}
a.cancel_link_formating:hover{
color:#A9A9A9;
}
答案 0 :(得分:1)
摆脱:
.article_title_hompage{
//this css color:
color: #2C3646;
}