How can I target a element inside h2


Tags: css

Problem :

I can't figure out how to style an H2 link in css. I've tried everything. IHow I can I target the link in an h2 element?

<div id="post-225" class="post-225 post type-post sticky hentry category-rugby-world-cup tag-land-rover-rugby-world-cup-2011-rugby-world-cup-2015-land-rover-rugby">
    <h2><a href="http://blog.landrover.com/events/rugby-world-cup/england-rugby-squad-vs-media-driving-challenge-day" title="Permalink to England Rugby Squad vs. Media Driving Challenge Day" rel="bookmark">England Rugby Squad vs. Media Driving Challenge Day</a></h2>

I need to make the headline of this sticky post white:

http://blog.landrover.com/

I've tried .sticky h2 a {color:white;} but without success.

Any help would be greatly appreciated.

Thanks



Solution :

Your .sticky h2 a {color:white;} is being overridden by the main style:

#content h2 a {
color: #4C4C4C;
}

To target the specific h2 of the sticky class, use:

#content .sticky h2 a{
color:#fff;
}

    CSS Howto..

    Css Sub menu needed to show on the left not on the right of the menu

    How to set CSS for disabled checkboxes?

    How to fixed
    in the specific location in css

    How to use a variable in my href path in html

    How does gmail preserve copy and pasted web content, maintaining the attached CSS?

    How to add ::after in the HTML link tag

    How can I create a bold/“cursor” border around a table cell?

    How to absolute position imageless corners with css

    How to make image 3D using CSS

    How to get to be the same width as
    ?

    How to show the same font which in photoshop on my webpage?

    How do I set multiple elements' css in one page without the :not attribute?

    How to make a button CSS change only IF form fields are valid

    How to use a global parent selector with CSS Modules

    how to load css for a div?

    How to make a div update the content with a sliding effect (animation similar to flash)?

    How to change visibility of a div css to visible with jQuery

    How to align multiple images horizontally (in a row)?

    If contains 'string' - set css “visibility:hidden;” - how to?

    On Edge Browser, how to change input placeholder text color using CSS?

    how to place content to the right of the fixed img with css 100% height (no width given)

    How to get user submission to post to page

    How to apply rounded borders to highlight/selection

    How do I get my textboxes to align properly once triggered? - jQuery/CSS

    CSS/Javascript: How to make rotating circular menu with multiple states?

    How to edit .css file from html via jquery

    How to make hover using jquery without CSS?

    How do I make a placeholder for a 'select' box?

    How to scale an element when it loads using only CSS?

    How to size a content div to cover the entire content area in jQuery Mobile