Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    2
    Thanked 0 Times in 0 Posts

    ANother font question

    Yes I am a newbie and boy do I feel like it. Is there a way to have multiple fonts in the same div? like p1, p2, p3, and so on if so how is that written in css and then the markup.

    would it be something like;

    CSS
    #box1 { any selectors...
    }
    #box1 p {
    }
    #box1 p1 {
    }
    .text1 { font: verdana; size: 5px; color: red;}
    .text2 { font: arial: wieght: bold; size 20px; color: 555555;}


    HTML
    <div id="box1">
    <p class="text1"> blah blah blah </p>
    <p1 class="text2"> and more blah blah</p>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Yes! like

    #box1 text1 {
    font-family:Verdana;
    }
    #box1 text2 {
    font-family:arial;
    }
    Last edited by abduraooft; 09-27-2007 at 09:33 AM. Reason: didn't notice class values...
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Aug 2007
    Location
    Ballarat
    Posts
    22
    Thanks
    0
    Thanked 1 Time in 1 Post
    Although above is how you do it, the understanding of why would help you.

    the chaining or cascading or selectors lets you do some very powerful things. If you want to change the look of somethings, think of how your page is laid out and work from there. For example, you might want to style italic writing inside a paragraph to be a different color. To do that, you'd use #maincontent p i { color:#ddd; } . That line affects all <i> tags inside a paragraph, in the content div


  •  

    Posting Permissions

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