开发者

font size in html code

开发者 https://www.devze.com 2023-01-19 05:48 出处:网络
<html> <tr> <td style=\"padding-left: 5px;padding-bottom:3px; font size=\"35;\"\"> <b>Datum:</b><br/>
  <html>
  <tr>
  <td style="padding-left: 5px;padding-bottom:3px; font size="35;""> <b>Datum:</b><br/>
                        开发者_运维问答    November 2010 </td>
  </html>

is my code correct? i would like to increase the font of the first line. Not sure if i have to put 2 "'s here. and it seems it didn't work.


Try this:

<html>
  <table>
    <tr>
      <td style="padding-left: 5px;
                 padding-bottom: 3px;">
        <strong style="font-size: 35px;">Datum:</strong><br />
        November 2010 
      </td>
    </tr>
  </table>
</html>

Notice that I also included the table-tag, which you seem to have forgotten. This has to be included if you want this to appear as a table.


font-size:35px;

So like this:

<html>
  <table>
  <tr>
  <td style="padding-left:5px;padding-bottom:3px;"> 
    <strong style="font-size:35px;">Datum:</strong>
    <br/>
    November 2010 
  </td>
  </tr>
  </table>
</html>

Although inline styles are a bad practice and you should class things. Also you should use a <strong></strong> tag instead of <b></b>


you dont need those quotes

<td style="padding-left: 5px;padding-bottom:3px; font-size: 35px;"> <b>Datum:</b><br/>
                        November 2010 </td>


There are a couple of answers posted here that will give you the text effects you want, but...

The thing about tables is that they are organized collections of labels and data. Having both a label ("Datum") and the value that it labels in the same cell is oh so very wrong. The label should be in a <th> element, with the value in a <td> either in the same row or the same column (depending on the data arrangement you are trying to achieve). You can have <th> elements running either vertically or horizontally or both, but if you don't have heading cells (which is what <th> means), you don't have a table, you just have a meaningless grid of text. It would be preferable, too, to have a <caption> element to label the table as a whole (you don't have to display the caption, but it should be there for accessibility) and have a summary="blah blah blah" attribute in the table tag, again for accessibility. So your HTML should probably look a lot more like this:

<html>
  <head>
    <title>Test page with Table<title>
    <style type="text/css">
      th {
        font-size: 35px;
        font-weight: bold;
        padding-left: 5px;
        padding-bottom: 3px;
      }
    </style>
  </head>
  <body>
    <table id="table_1" summary="This table has both labels and values">
      <caption>Table of Stuff</caption>
      <tr>
        <th>Datum</th>
        <td>November 2010</td>
      </tr>
    </table>
  </body>
</html>

That may not be exactly what you want -- it's hard to tell whether November 2010 is a data point or a label from what you've posted, and "Datum" isn't a helpful label in any case. Play with it a bit, but make sure that when your table is finished it actually has some kind of semantic meaning. If it's not a real table of data, then don't use a <table> to lay it out.


Don't need to quote css attributes and you should specify an unit. (You should use an external css file too..!)


<html>        
    <table>
        <tr>
            <td style="padding-left: 5px;padding-bottom:3px; font-size:35px;"> <b>Datum:</b><br/>
            November 2010 </td>
    </table>
</html>


just write the css attributes in a proper manner i.e:

font-size:35px;


I suggest you use CSS instead, seems like you're going to repeat those lines later on. But to answer your question:

<html>
  <head>
  <style type="text/css">
    td.randname {
        padding-left: 5px;
        padding-bottom:3px;
        font-size:35px;
    }
  </style>
  </head>
  <body>
  <table>
  <tr>
  <td class="randname"> <b>Datum:</b><br/>
                            November 2010 </td></tr>
                            </table>
  </body>
</html>


The correct CSS for setting font-size is "font-size: 35px". I.e.:

 <td style="padding-left: 5px; padding-bottom:3px; font size: 35px;">

Note that this sets the font size in pixels. You can also set it in *em*s or percentage. Learn more about fonts in CSS here: http://www.w3schools.com/css/css_font.asp

0

精彩评论

暂无评论...
验证码 换一张
取 消