how to format a heading using CSS

Last post 07-06-2009 10:22 AM by viral sarvaiya. 6 replies.

Sort Posts:

  • how to format a heading using CSS

    07-04-2009, 1:57 PM
    • Member
      2 point Member
    • asifakhtar
    • Member since 01-20-2009, 12:35 AM
    • Posts 34

    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.

  • Re: how to format a heading using CSS

    07-04-2009, 2:40 PM

     Hi,

    use like this.

    form id="form1" runat="server">
    <div>
    <table style="width: 315px; height: 137px">
    <tr>
    <td style="width: 3px">
    some text here </td>
    </tr>
    <tr>
    <td style="width: 3px">
    </td>
    </tr>
    <tr>
    <td style="width: 3px">
    </td>
    </tr>
    </table>
    </div>
    </form>

    Thanks :)

     

    Remember to click “Mark as Answer” on the post, if it helps you. Because It helps others to find the solution.

    Srinivas Kotra.


  • Re: how to format a heading using CSS

    07-04-2009, 3:47 PM
    • Member
      2 point Member
    • asifakhtar
    • Member since 01-20-2009, 12:35 AM
    • Posts 34

     Thank you for your help but I was lookign for something like the below:

    Code:
    .heading {background-color:#006666; font-family: 'Arial Black'; height: 6px; font-size: small;color: #ffffff}and then change your five headings to look like:

    Code:
    <td>Status Information</td>

    Again Thank you. 

  • Re: how to format a heading using CSS

    07-04-2009, 4:26 PM
    Answer
    • Contributor
      2,397 point Contributor
    • maverickhyd
    • Member since 03-25-2009, 6:38 AM
    • Posts 416

     Hi,

    Its simple

    create a style sheet and add heading class and use it where ever u required

    check this article

    http://www.w3schools.com/Css/css_syntax.asp

    Please Mark as Answer if it helped You!
  • Re: how to format a heading using CSS

    07-04-2009, 4:44 PM
    Answer
    • Star
      13,643 point Star
    • gt1329a
    • Member since 06-24-2002, 12:53 AM
    • Atlanta
    • Posts 2,252
    • ASPInsiders
      TrustedFriends-MVPs

    If you just want a free-standing heading, you should use a heading element (e.g. h1, h2, h3, etc), and appply that styling via something like:

    h2 { background-color: #066; color: #fff; }

    <h2>Status Information</h2>

    Encosia - ASP.NET, jQuery, AJAX, and more.

    Latest article: Emulate ASP.NET validation groups with jQuery validation
  • Re: how to format a heading using CSS

    07-05-2009, 1:03 AM
    • Member
      330 point Member
    • fizzybunghole
    • Member since 11-22-2003, 2:35 AM
    • London, England
    • Posts 70

    Just style the <th> element:

    th {background-color:#006666; font-family: 'Arial Black'; height: 6px; font-size: small;color: #ffffff}

    <th>This is the heading of the table</th>

    This is also semantically correct - keep your <td> tags for displaying data, not headings.

     

    regards,

    Tim

  • Re: how to format a heading using CSS

    07-06-2009, 10:22 AM
    • Member
      322 point Member
    • viral sarvaiya
    • Member since 09-17-2008, 11:01 AM
    • Ahmedabad, India
    • Posts 85

    in the css file u have to just write

    td
        {
            background-color:#006666;
            font-family:Arial Black;
            height:6px;
            font-size:small;
            color:#ffffff;
        }

    and attach this file to your page.

    and then simply write your code

    <td>Status Information</td>

    it is automatically applied.

    Viral Sarvaiya,
    Software Developer,
    Ahmedabad, India.
    Email : viralsarvaiya_84@yahoo.co.in
    website : http://www.viralsarvaiya.co.cc
    Blogs : http://www.viralsarvaiya.wordpress.com

    Mark as Answer if this reply helps you
Page 1 of 1 (7 items)