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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Location
    Phillipsburg
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Post HTML Formatting question

    I'm fairly new to HTML, and this site for that matter, and I'm having trouble formatting a test web page with the .style. tag in the header of the document.
    Here's the markup:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/transitional.dtd">
    <html>
    <head>
    <title>TheFieryFurnaces</title>
    <meta charset="UTF-8"/>
    <style type="text/html">
    h1.heade {color:purple;}
    p1.par1 {color:Ivory;}
    p2.par2 {color: green;}
    a.link {color:green;}
    </style>
    </head>
    <!-- It took me forever to figure out how to format the style of the page and now it's all screwy -->
    <body style="font-family:verdana;color:ivory;background-color:black;">
    I'm posting the complete header because I don't know if it's formatted right, or if it could be cleaned up a bit, so any help would be appreciated.

    The class attributes of each paragraph are set as in the style tag, and I'm not sure how to change the colour of the links on my page. The formatting showed up when the .style. tag was incorrectly placed in the body of the document, but when I moved it to the header, the formatting was erased.


    Attached is the entire file...
    Attached Files Attached Files

  • #2
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    it's

    Code:
    <style type="text/css">
    there's no p1, p2, p3, or p4 either
    Last edited by Sammy12; 08-13-2011 at 09:20 PM.

  • #3
    New to the CF scene
    Join Date
    Aug 2011
    Location
    Phillipsburg
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Ohh

    Is that it? Woow now i feel dumb. And as for the p1, p2, etc. I learned from w3schools, and their pages are formatted that way. How can I id each paragraph without doing that?

  • #4
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    http://www.w3schools.com/tags/tag_p.asp

    you should set a class to each one. id can only be used once. classes can be used multiple times

    Code:
    p.green { color: green; }
    p.green-back { background-color: green; }
    Code:
    <p class="green"></p>
    <p class="green-back"></p>
    <p class="green-back"></p>

  • Users who have thanked Sammy12 for this post:

    boinghd (08-13-2011)

  • #5
    New to the CF scene
    Join Date
    Aug 2011
    Location
    Phillipsburg
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for the help!


  •  

    Tags for this Thread

    Posting Permissions

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