DanielC DanielC -4 years ago 85
HTML Question

How to use more than one style attribute in HTML

<p style="color:red;"> text here </p>th


This code works however how would I make the text bigger as well since that uses the style attribute?

Answer Source

The way to do this directly in your HTML is this:

<p style="color: red; font-size: 50px"> text here </p>

As you can see, you simply separate the style rules with the semicolon.

However, if you want to do this using CSS, you could do something like this:

HTML

<p class="large-red-text">text here</p>

CSS

.large-red-text {
    color: red;
    font-size: 50px;
}

Just be sure to save your CSS in a file with the .css extension and include it in your HTML in the <head> tag like this:

<link rel="stylesheet" type="text/css" href="filename.css" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download