引导链接样式到div中的所有文本

时间:2022-06-15 15:17:03

here is my code : UPDATE : jsfiddle hre : http://jsfiddle.net/vn0nwztg/3/

这是我的代码:UPDATE: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>

As you can see, i had wrapped the whole "article" within a "a" attribute. Bootstrap somehow only applies its link styling on the last "p" element. I managed to modify the styling of this element by adding the the attrivbute a "cancel_link_formating" ... in an external stylesheet

正如你所看到的,我把整个“文章”包裹在一个“a”属性中。 Bootstrap以某种方式仅在最后一个“p”元素上应用其链接样式。我设法通过在外部样式表中添加attrivbute“cancel_link_formating”...来修改此元素的样式

Question is : i would like to apply the same styling to the "h2" attribute. How can I acheive this ?

问题是:我想将相同的样式应用于“h2”属性。我该如何实现这一目标?

my css :

我的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;
}

1 个解决方案

#1


1  

Get rid of:

摆脱:

.article_title_hompage{
//this css color:
    color: #2C3646;
}

#1


1  

Get rid of:

摆脱:

.article_title_hompage{
//this css color:
    color: #2C3646;
}