Html font tables


#1

Hello to whoever is reading this I was wondering if you could change the text that comes on the website inside the table command.

<table>
<tr>
<td></td>
</tr>
</table>

Thanks


#2

Yes! You can create an id for the tag. For example, you could do this when creating the text inside:

> <p id="whatever"></p>

Then you go into your main.css or style tags and add this:

.whatever{
color:green;
}

I hope this helps =)

*If this isn’t what you what, please let me know!


#3

Yes, whatever @trevorhodges stated is true.

However, you should indent them, like this:

<body>
    <p id=“atag”>Hi, I’m a nice little element :]</p>
</body>

And for the CSS, as well:

.atag {
    font-family: monospace;
    color: orange;
}

Happy coding! :slight_smile:


#4

So you need to know how css works in order to change the color of the words that you put in the <td></td> command.


#5

Oops! Thanks for correcting me @_markviii!


#6

Yes, at least basic CSS. Every element in the document has a style object that contains all the presentation and position properties associated with it. We access that object through what is known as a selector. That’s really just a fancy (and more specific) word for element.

In HTML, a table data element, or TD (written, <td></td>, with both opentag and endtag) can be styled just by its type.

td {
    color: red;
    background-color: yellow;
}

The above syntax breaks down as follows:

td        =>  type selector
{...}     =>  declaration block
color:    =>  property name + colon
red;      =>  property value + semi-colon

The last two items are a property-value pair known as a declaration. The whole thing together is known as a selector rule.

We may declare as many properties as we like for any given selector, and we may write them in any order.

Where order matters is in the placement within the style sheet document, itself. The last rule in the style sheet has greater precedence than any above it. That does not mean it will always apply; something above may have greater specificity. Both of these aspects contribute to how importance is calculated when two selector rules collide.

Add this topic to your reading, but don’t stray too far from the HTML you are presently learning. More about CSS will come up as you progresss. Focus on the HTML and its attributes and general syntax.


The above as we’ve seen illustrated is an element, not a command. HTML is not a program, but a static document made of markup declarations. The slang for this is tagged content.


#7

If it is not possible to create or access the external style sheet, we can create an embedded style sheet in the HEAD element.

  <title>embedded style sheet</title>
  <style>
  td {
    color: red;
    background-color: yellow;
  }
  </style>
</head>
<body>
...

Occasionally we find ourselves in a one-off situation where the rule would never apply anywhere else but the specific element. It’s cheating, in a way, but if used sparingly, inline style attributes let us apply a style to that element.

<span style="font-style: oblique;
             text-decoration: underline;
             font-variant: small-caps;
             color: teal">totality</span>

#8

It’s okay, Trevor, you don’t actually have to indent the code for it to work, however white space is good practice, and you should try indenting it.


#9

Ok. Thanks again @_markviii!