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="" 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:

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

Any help would be greatly appreciated.


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{

    CSS Howto..

    What are some Best CSS Practices, Do you Re-use previous CSS? How about Frameworks? [closed]

    How to link to a “tab” on my website

    how to create a pricetag like border around list items

    Position: fixed Background DIV with images makes scrolling slow: How to make conditional CSS rules for browser-compatibility?

    How can I use d3.js filter to assign different css classes to elements?

    How can I set the text on the right of a glyphicon into a Twitter BootStrap theme?

    How to do the Height of html tag Body on 100% of browser window size?

    CSS height, How to get it to go around inner divs

    How to properly preload images, js and css files?

    How to style 3 unorderd lists horizontally in 1 div

    responsive image gallery with different heights - how to achieve this with css (or jquery)

    how to apply ellipse effect in which contain space in string?

    jQuery UI Tooltip with Arrow, why/how does this code work?

    How to remove the BG image on jQueryUI autocomplete combo (select)

    How to filter and show only applied CSS in Chrome Developer Tools (like Firebug in Firefox)

    How do I Align The Border Of Text To An Image? (HTML/CSS) | (Extra [Answered]): How do I Fullscreen with Inspect? |

    How to force input type text within span width

    How to override HTML image using CSS

    Multiple Read more issue in css, how do i solve that?

    How do you set background-color rgba on the body with background-image also?

    How do I sort css selectors with vim?

    meteorjs how to import a wrapbootstrap theme

    How to reference an embedded image from CSS?

    How to dim an image keeping transparency untouched with CSS or JS?

    How do I center this form-button block?

    How to select the last div in css

    How do I refer to an image resource from CSS in grails?

    How do I make the HTML Slider with CSS stay in the box?

    How to add new fonts in CSS for local testing

    How can I make a div with “position:fixed” to stay out of the screen if the window overflows?