Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to inline a class definition of CSS inside an xhtml file?

Tags:

css

xhtml

Is it possible to inline a class definition of CSS inside an xhtml file?

I mean, to put someting like:

p.first{ color: blue; }
p.second{ color: red; }

Inside my page, not in a separate CSS file.

like image 673
Mr.Eddart Avatar asked Sep 15 '11 17:09

Mr.Eddart


1 Answers

I think you're trying to put your CSS in the HTML page, not inline.

You can put CSS in an HTML page (usually in the head) by surrounding it in style tags:

<style type="text/css">
    p.first{ color: blue; }
    p.second{ color: red; }
</style>
like image 167
Joseph Silber Avatar answered Oct 03 '22 00:10

Joseph Silber