किसी तत्व के टेक्स्ट के लिए सामान्य, इटैलिक या तिरछी शैली निर्दिष्ट करने के लिए CSS फ़ॉन्ट-शैली की संपत्ति का उपयोग किया जाता है।
सिंटैक्स
CSS फॉन्ट-स्टाइल प्रॉपर्टी का सिंटैक्स इस प्रकार है -
Selector {
font-style: /*value*/
} उदाहरण
निम्नलिखित उदाहरण सीएसएस फ़ॉन्ट-शैली संपत्ति को दर्शाते हैं -
<!DOCTYPE html>
<html>
<head>
<style>
h2 {
font-style: italic;
background-color: steelblue;
color: white;
}
p {
font-style: oblique 10deg;
}
</style>
</head>
<body>
<h2>Fortran Tutorial for Beginners</h2>
<p>Fortran, as derived from Formula Translating System, is a general-purpose, imperative programming language.</p>
<p>It is used for numeric and scientific computing.</p>
</body>
</html> आउटपुट
यह निम्न आउटपुट देता है -

उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
h3 {
font-style: italic;
background-color: mediumpurple;
color: white;
text-align: center;
}
li {
font-family: "Comic Sans MS", cursive;
font-style: oblique 5deg;
}
</style>
</head>
<body>
<h3>Developers Best Practices Tutorial</h3>
<ul>
<li>Documentation is the key</li>
<li>Follow the standards</li>
<li>Write to be Reviewed</li>
</ul>
</body>
</html> आउटपुट
यह निम्न आउटपुट देता है -
