• I’m attempting to branch out to new-for-me css territory, psuedo classes! But without any luck.

    What I want is for each first letter of headlines to be a different font than the rest of the headline. Most especially entry and post titles and for the main navigation. I already acopmplished this with a span atribute in wordpress, but it’s weird and clunky and doesn’t work at all when the page is automatically translated.

    So I took off the span css for the first post, Events, and tried out some :first-letter css in the child theme. None of it is working. I even copied the example of :first-letter styling straight from a tutorial on it, on the p tag. Nothing is working. https://dievilla.at/ is the website.

    Anyone know what I’m doing wrong? Or why it’s not working? Here is a list of things I’ve tried, to no avail.

    p:first-letter {
      font-weight: bold;
      font-size: 300%
      background-color: red;
    }
    
    h1::first-letter {
    	font-family: 'crimsonbold';
    	background-color: #999999;
    }
    
    h1.entry-title::first-letter {
    	font-family: 'crimsonbold';
    	background-color: #999999;
    }
    
    entry-header::first-letter {
    	font-family: 'crimsonbold';
    	background-color: #999999;
    }
    
    h2::first-letter {
    	font-family: 'crimsonbold';
    	background-color: #999999;
    }
    
    h2.entry-title::first-letter {
    	font-family: 'crimsonbold';
    	background-color: #999999;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Example of p:first-letter working on your site:
    https://i60.tinypic.com/ynt6t.png

    Thread Starter AdriaChilcote

    (@adriachilcote)

    Well, that’s great that it’s possible. But I still can’t figure out for the life of me why I can’t get it to work. Just CSS in my child theme, like all the other custom CSS that I’ve applied successfully.

    I keep thinking, maybe I’m trying to apply it to an element that’s not block level, but it’s not even working on p::first-letter. Not to mention h1:first-letter or h1.entry-title::first-letter.

    Really confusing.

    Thread Starter AdriaChilcote

    (@adriachilcote)

    It won’t even work for me when I try it in the Style Editor of Firebug. Tried with just one : or two ::, tried %, px, font-color, font-size. Nothing happens. Here is a pic of the code I’m trying:
    https://i59.tinypic.com/24430gl.png

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘:first-letter not working’ is closed to new replies.