How to set italics or bold, etc, in HTML using CSS?

How to set italics or bold, etc, in HTML using CSS?
this isn't workin, friend
I'm copying you guys methods and past in HTML, but it doesn't work. What do you think I'm doing wrong, remember I am clueless in CSS
 
Well, there are lots of ways to do that.

1) You can choose an HTML element and modify it's style. For the sake of this example we'll use <p>. Then you can add this to your CSS code:
//for italics
p{ font-style: italics}
//for bold
p{ font-weight: bold}
//for underline
p{ text-decoration: underline}

2) You can create a CSS class and set it as your HTML element's class.
.my_style {
font-style: italics // etc..
}

In your HTML code you'll have:
<p class="my_style">Hello World</p>

3) You can create a CSS id and set it as your HTML element's id.
#my_style{
font-style: italics //etc...
}

In your HTML code you'll have:
<p id="my_style">Hello World!</p>

There are still lots of ways to achieve this but those are just the basics.
 
p.bold
{
font-style: bold;
}
p.italic
{
font-style: italic;
}

<p class="bold">
Bold
</p>

<p class="italic">
Italic
</p>

To make an element all bold regardles remove the bold from the p.bold then all paragraphs will be bold
 
Back
Top