Rifthy February 2016

Can use CSS Properties as a HTML Attibutes?

Example:

p {
            color:blue;
            font:Arial;
            font-size:30px;
            }

all css properties can be a html attribute?

<p color="blue" font="Arial">Some Text</p>

Answers


Linuslabo February 2016

CSS properties are not valid HTML attributes, but they can be set inline to an HTML element through the style attribute.

e.g.

<p style="color:blue;font:Arial;font-size:30px;"> content.....</p>


Joshua February 2016

This can be accomplished with the style attribute:

<p style="color:blue;">Text</p>

CSS is valid within the style attribute's value.

Post Status

Asked in February 2016
Viewed 3,561 times
Voted 5
Answered 2 times

Search




Leave an answer