Results 1 to 2 of 2

Thread: CSS: drop-cap problem?

  1. #1
    Join Date
    Aug 2004
    Posts
    34

    CSS: drop-cap problem?

    Hello eveyone:

    I have this problem to get first letter in different paragraph change color.

    my approach is to define a class selector in which I defined font-family, font-weight and color attribue

    then I used a contextual selector to modify a character in another paragraph to make it Drop-Cap.

    Code:
      #body_txt .firstChar
    {
      float: left; 
      font-size: 360%;
      line-height: 0.8;
    }
    
    .firstChar {color: #ffcc00;
                font-family: herculanum, papyrus, harrington, 'zapf chancery', 'apple chancery', impact, sans-serif;}
    I got Drop-cap effect working but I wasn't able to change first characters in 3 separate paragraph enclosed in <div id="ingredients">tag.

    I couldn't figure out what went wrong here. Please have me trouble this CSS issue. Thanks!

    URL: http://www.cuj06.com/html/chocolate.html

    Jeff
    10-24-06

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    If you want a class to apply to several ids, alter the css style from #body_txt .firstChar
    to just
    .firstChar

    or add
    #ingredients .firstChar {
    float: left;
    font-size: 360%;
    line-height: 0.8;}

    Note that there needs to be a gap between #ingredients and .firstChar

    The html is OK because you have <div id="ingredients"> and then class="firstChar" inside a span tag just for the first letter.
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. CSS? (drop-down menu) problem in IE7
    By webbcity in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 17 Feb 2006, 02:28 PM
  2. slight problem with CSS code
    By webguy_dave in forum General Questions
    Replies: 1
    Last Post: 17 Dec 2005, 02:55 PM

Posting Permissions

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