www.webdeveloper.com
Results 1 to 9 of 9

Thread: first-letter chrome problem?

  1. #1
    Join Date
    Nov 2005
    Location
    Welsh Borderland - UK
    Posts
    8

    first-letter chrome problem?

    On several pages I use first-letter pseudo to make the first letter of a DIV red but I now find that it does not work for me in Chrome (IE & FF ok).

    The css is in external file and the relevant lines are:
    Code:
    .itembox:first-line {font-weight:bold;}
    .itembox:first-letter {color:red;}
    I use class .itembox0 when I do not want the first letter Red

    Here is a sample page. Can any of you good people help?

    Paul

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    This is hiding the letter:
    Code:
    .itembox:after {
        content: "."; 
        display: block; 
        height: 0; 
        clear: both; 
        visibility: hidden;
    }
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Nov 2005
    Location
    Welsh Borderland - UK
    Posts
    8
    Thanks for pointing that out Fang. Now I will have to remember why I added that particular hack before.

    To save head scratching could I change it so just Chrome ignores that line?

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    To save head scratching could I change it so just Chrome ignores that line?
    No
    At least 98% of internet users' DNA is identical to that of chimpanzees

  5. #5
    Join Date
    Nov 2005
    Location
    Welsh Borderland - UK
    Posts
    8
    ....ok I tried adding amended css directly into one page so
    Code:
    #main.itembox:after {
        content: "."; 
        display: block; 
        height: 0; 
        clear: both; 
        visibility: display;
    }
    And it did not make any difference in Chrome.
    I also wonder if it is significant that when I try and select the missing letter in Chrome I cannot select the first two letters.

  6. #6
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Why have you added :after? It is a problem in Chrome and does nothing in other browsers.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  7. #7
    Join Date
    Nov 2005
    Location
    Welsh Borderland - UK
    Posts
    8

    Smile Came from here

    Quote Originally Posted by Fang View Post
    Why have you added :after? It is a problem in Chrome and does nothing in other browsers.
    I wanted my text and images to be 'contained' by my itembox DIVs and I think this is where it came from

  8. #8
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Use overflow to clear not that method.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  9. #9
    Join Date
    Nov 2005
    Location
    Welsh Borderland - UK
    Posts
    8
    Thanks again Fang. Seems things have moved along since I did my pages - and got simpler for a change! Looks like I can get rid of the code above and replace it with overflow:hidden. Easy enough but I have quite a few pages to check.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles