Jump to content

How to overwrite <font size="6" ...> elements?


pstein

Recommended Posts

Assume I have a webpage which has currently NO CSS stylesheet assigned.

Instead font definitions are defined as HTML elements like

<font size="6" face="Arial">foobar</font>

How can I overwrite this definition e.g. by:

font-size: 16px; line-height: 18px; font-family: Verdana;

This new CSS definition should be assigned to all occurencies of exactly this element (but not e.g. <font size="2" ....>)

How can I achieve this?

Peter

Link to comment
Share on other sites

This sounds like a very bad way to build a website. You really would be best off rewriting the HTML, but if you only want to target elements with a particular attribute value, use the attribute selector:

font[size=6] {
  font-size: 18px;
  line-height: 18px;
  font-family: Verdana, sans-serif;
}

 

Link to comment
Share on other sites

Font element is deprecated, and been replaced with css styling to give the same result and more. By using a identifier such as id for singular element or class for multiple elements you can apply the same styling, which makes it more easily manageable.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...