Results 1 to 6 of 6

Thread: Simple question concerning CSS and HTML

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Question Simple question concerning CSS and HTML

    How do I set apply a class on an entire table?

    Code:
    <table>
       <tr>
            <td>This is the test</td>
            <td>A new line</td>
        </tr>
    </table>

  2. #2
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Not quite sure what u mean but anyhow u really arent supposed to use 'tables' in CSS. U should use <div> tags. Do u know anything about CSS already? What do u want to do and what do u already know how to do.
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    Sorry for beeing unprecise, I only want to know how I can define my font size of all the fields in a table

  4. #4
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    <style type="text/css">
    td,th,body { font-size: 10px; font-family: Verdana;}
    </style>
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  5. #5
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    <table class="classname"> should work.

    <table style="font-family:arial; font-size:8pt;">
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  6. #6
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Sorry for not answering directly but I think that u are attempting to jump into something in CSS without knowing enough of the basics. U need to create a separate css file with #frame properties and paragraph properties and then use them to build your "tables".

    here's a sample CSS file and html file
    VB Code:
    1. 'Called yourstyles.css
    2. body        {
    3.         text-align: center;
    4.         background: url(back.gif) fixed;
    5.         margin-left: 0;
    6.         margin-top: 0;
    7.         }
    8.  
    9. A       {
    10.         color: #000080;
    11.         text-decoration:none
    12.         }
    13.  
    14. A:hover     {
    15.         color: #FF0000;
    16.         font-family: Verdana, Helv, Arial;
    17.         }
    18.  
    19. A:visited   {
    20.         color: #000080;
    21.         font-family: Verdana, Helv, Arial;
    22.         }
    23.  
    24. #frame      {
    25.         width:750px;
    26.         margin-right: auto;
    27.         margin-left:auto;
    28.         margin-top:20px;
    29.         padding:0px;
    30.         background:#fff;
    31.         text-align:center;
    32.         border:4px solid #000;
    33.         }
    34.  
    35. #frameinner {
    36.         width:742px;
    37.         margin-right: auto;
    38.         margin-left:auto;
    39.         padding:0px;
    40.         background:#fff;
    41.         text-align:left;
    42.         }
    43.  
    44. #contentheader  {
    45.         text-align: left;
    46.         padding: 7px;
    47.         background:#fff;
    48.         }
    49.  
    50. #contentleft    {
    51.         width:340px;
    52.         padding: 0px;
    53.         float:left;
    54.         text-align:center;
    55.         background:#fff;
    56.         }
    57.  
    58. #contentright   {
    59.         width: 340px;
    60.         padding: 0px;
    61.         float:left;
    62.         text-align:left;
    63.         background:#fff;
    64.         }
    65.  
    66. #contentfooter  {
    67.         text-align: left;
    68.         padding: 7px;
    69.         background:#fff;
    70.         }
    71.  
    72. p.standard  {
    73.         margin-left: 0;
    74.         margin-top: 10px;
    75.         align:left;
    76.         font-family: Verdana, Helv, Arial;
    77.         font-size: 12px;
    78.         font-color: #000;
    79.         }
    80.  
    81. p.footer    {
    82.         margin-left: 333px;
    83.         margin-top: 10px;
    84.         align:left;
    85.         font-family: Verdana, Helv, Arial;
    86.         font-size: xx-small;
    87.         font-color: #000;
    88.         }

    VB Code:
    1. <html>
    2.  
    3. <head>
    4. [b]<link rel=stylesheet href="yourstyles.css" type="text/css">[/b]
    5. </head>
    6.  
    7. <body>
    8. <div id="frame">
    9.     <div id="contentheader">
    10.     'Something in here
    11.     </div>
    12.  
    13. <div id="frameinner">
    14.     <div id="contentleft">
    15.         <img src="somepic.gif"><br>
    16.         <br><br>
    17.     </div>
    18.  
    19.     <div id="contentright">
    20.         <img src="someotherpic.gif"><br>
    21.         <p class="standard">   
    22.                   Some text<br>
    23.         </p>
    24.     </div>
    25. </div>
    26. </div>
    27. </body>
    28.  
    29. </html>
    Hopefully this gives u some ideas
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

Posting Permissions

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



Click Here to Expand Forum to Full Width