Submit Your Article Forum Rules

Results 1 to 6 of 6

Thread: CSS style sheets and H1 tags

  1. #1

    CSS style sheets and H1 tags

    Well, I've reached a standstill (oh poor me...:o)LOL
    But actually I need some pointers, I've been working frantically on my site getting ready to do monthly submissions. Here's my problem, I've already got the css stylesheet, but no H1 tags, how does one go about adding or changing this and where are the proper lines place on the HTML and stylesheet without changing the look of the page? I've tried doing some research and reading on the subject, but it seems very vauge and it hasn't as yet started to 'compute'! Any help would be wonderful!
    Custom ComputerHaven
    "The Best for Less"
    http://www.customcomputerhaven.com

  2. #2
    Senior Member southplatte's Avatar
    Join Date
    Jul 2003
    Posts
    364
    If you already have your css file defined, you should be able to add the new style for H1 at the end of the style sheet. A small basic example:
    h1 {
    font-family: "Courier New", Courier, mono;
    font-size: 16px;
    font-weight: bold;
    }

    This simply redefines the H1 html tag using the css sheet.

    Then, all <H1> tags should default to the redefined H1 css style.

    The other option is to create a custom class, such as .heading1 It would look similar only:

    .heading1
    {
    font-family: "Courier New", Courier, mono;
    font-size: 16px;
    font-weight: bold;
    }

    Then in your html code, any place you want the style applied to the H1 tag, you should be able to use:

    <H1 class="heading1">Text goes here</H1>

    I am still relatively new to css, so I hope I am sending you in the right direction. You can test it on a sample html and css file to avoid modification to your entire site.

  3. #3
    southplatte,

    Thanks so much for your reply! I've tried numerous times, but I can't seem to get it working. I'll keep plugging along. I'm using Verdana font, if that makes any difference!
    Custom ComputerHaven
    "The Best for Less"
    http://www.customcomputerhaven.com

  4. #4
    Senior Member paulhiles's Avatar
    Join Date
    Jul 2003
    Posts
    2,073
    Hi there computers,

    Say if you wanted the <h1> tag to be the red header that you have on your newsletter page, you would simply add the following to your textstyle.css file

    h1 {background-color:#FFFFFF; font-family:Verdana; font-size:18px; font-weight:bold; color:#CC0000; text-align:center;}

    Then in your page's code you would have the following:
    <h1>Has Your Browser Been Hijacked?</h1>

    this would achieve the same effect as all those

    , <font> and <span> tags put together! :o) Obviously it's up to you to define which headers will have which styles.. working through h1, h2, h3 etc.

    By the way, I would put all your current styles into just the one CSS file for ease of maintenance. Currently you're mixing inline styles with an external CSS. You also have a local file referenced from an E:Drive! Eeek!

    Any further help, just post back here or PM me if you wish.

    Cheers,

    Paul

  5. #5
    paulhiles,

    Thanks for your help! I've found the E:drive reference you mentioned and have removed it, but not on all pages as yet. I have no idea where that came from! I really don't know much of anything about css textstyle, and don't have any idea where to start changing all over to it. Also I haven't had any luck with H1. It always changes the font size, even though I've adjusted it in the css textstyle. So for now I think I may just leave that alone and work on learning more about it in the comming month. Thanks again!
    Custom ComputerHaven
    "The Best for Less"
    http://www.customcomputerhaven.com

  6. #6
    Senior Member southplatte's Avatar
    Join Date
    Jul 2003
    Posts
    364
    Some good resources for css:

    http://wdlv.com -- web developers virtual library
    http://www.w3schools.com -- another good source for just about anything web/programming related

    best of luck --

Similar Threads

  1. How to build multiple CSS style sheets for Different Browsers.
    By TheBrownRecluse in forum Graphics & Design Discussion Forum
    Replies: 6
    Last Post: 06-15-2007, 05:02 PM
  2. Style sheet switcher and hiding style sheets
    By kgun in forum Accessibility and Usability Forum
    Replies: 0
    Last Post: 03-05-2007, 09:43 AM
  3. User selectable Style Sheets?
    By jordanmcclements in forum Web Programming Discussion Forum
    Replies: 2
    Last Post: 03-10-2005, 10:22 AM
  4. dynamically linked style sheets?
    By hommealone in forum Web Programming Discussion Forum
    Replies: 14
    Last Post: 02-25-2005, 08:29 PM
  5. Cascading Style Sheets
    By WPW_Feedbot in forum Graphics & Design Discussion Forum
    Replies: 0
    Last Post: 12-15-2004, 10:59 AM

Posting Permissions

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