Text align works for one tag but not for another?

im making a simple webpage. i use the style format i create one and it text aligns that but not the other. im sure its something simple but what am i doing wrong?

<!DOCTYPE html>
<html>

<style>
p {
 color: Black;
 text-align: center;
 font-size: 20px;
 } 

 body {
 background-color: lightgray;
}

f { color: green; 
text-align: center;
}

</style>

<body>

<p>hello world!</p>
<f>hello again world</f>

</body>
</html>

Upvotes: 0

Views: 34

Answers (1)

Adrian Brand
Adrian Brand

Reputation: 21658

An f tag is not a standard tag, if you invent your own tag it is not going to have a display rule so make it block.

Try

f { color: green; 
  text-align: center;
  display: block;
}

Upvotes: 2

Related Questions