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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Feb 2009
    Posts
    121
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Need Help with CSS

    Hi,
    I have 5 forms and I want to apply these settings(background-color:#006666; font-family: 'Arial Black'; height: 6px; font-size: small;color: #ffffff) using css to a heading in all those 5 forms. How can I achieve this? I am using a separte CSS file.

    My heading HTML is 1 form is

    <td>Status Information</td>
    Can someone please help me with that?


    Thanks.

  • #2
    New Coder
    Join Date
    Jun 2009
    Location
    /root
    Posts
    91
    Thanks
    4
    Thanked 9 Times in 8 Posts
    Since you have multiple (five) elements that you wish to style the same way, you should declare a "class" identification in your markup like so:
    Code:
    <td class="class_name">Status Information</td>
    Then in your CSS file you need to define the style like so:
    Code:
     .class_name{background:#006666;color:#FFFFFF;font-family:"Arial Black",Verdana,Sans-serif};font-size:small;height:6px;}
    with the font-family, always start with the one you want but always define alternatives.
    Kodah

  • #3
    New Coder
    Join Date
    Jul 2009
    Location
    Bristol, England
    Posts
    20
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hello

    I also wanted to suggest that if these are the titles of your table, you use the table heading - <th> - tag instead of <td> - it's very handy for people using assistive technology

  • #4
    Regular Coder
    Join Date
    Aug 2006
    Location
    Cardiff, UK
    Posts
    141
    Thanks
    15
    Thanked 2 Times in 2 Posts
    It's largely my own personal preference, but I always wrap the text inside a table inside its own <p> tag (or appropriate level heading <h#> for td cells), so that I can style the text separately from the containing cell.

    You don't mention the context for the <th> cells - do they appear in separate divs, or do the tables they appear within each have an ID? Do you have other td cells that you want to appear differently styled? All of these could lead to different approaches to how you could use the CSS.
    If anyone asks my boss, this counts as work, okay?


  •  

    Posting Permissions

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