One of the most important parts of a website is the text. We can modify text in a lot of ways . In a webpage the CSS affect directly the style of HTML elements. We use the style attribute inside the opening tag of the elements and the we set up a property we want to see on the screen.
There are a lot of properties we can talk about them is the post, CSS has like more that thousand type of properties. today we just talk about more used and commons property in Css.
To change how big text is we use the font-size property for example:
<!DOCTYPE html> <html> <head> <title>...<title> </head> <body> <p style="font-size:60px;" > My first paragraph</p> </body> </html>
Basically we measure elements on webpage with Pixels (px). But there are others we can use as: em; rem; percentage (20%) and so on, we will discuss about it later.
Now that u have an idea what CSS does, we talk about some common properties uses in CSS . To set the type of font for an html elements we start by adding the font-family property, there are a lot available you can use the most used are:
- Courier New
- Times New roman
<p style="font-family:CourierNew;"> Hello world !</P>
To italicise the text of an element we use the font-style property:
<p style="font-style:italic;"> Hello world !</P>
To bold the text of an element, we use the font-weight property and set the value to bold.
<p style="font-weight:bold;"> Hello world !</P>