Changing the Default Display Value using CSS

CSSWeb DevelopmentFront End Technology

Every element in CSS has a default display value and we can easily change. This is dene by explicity setting the display property value. Let us see an example wherein we are setting inline display property value for horizonatal menus −

Example

 Live Demo

<!DOCTYPE html>
<html>
<head>
<style>
p {
   background-color: orange;
   color: white;
}
li {
   display: inline;
}
</style>
</head>
<body>
<h2>Tutorials List</h2>
<p>Following are the list of resources:</p>
<ul>
<li><a href="https://www.tutorialspoint.com/machine_learning/index.htm" target="_blank">Machine Learning</a></li>
<li><a href="https://www.tutorialspoint.com/python_data_science/index.htm" target="_blank">Python Data Science</a></li>
<li><a href="https://www.tutorialspoint.com/python/index.htm" target="_blank">Python</a></li>
<li><a href="https://www.tutorialspoint.com/csharp/index.htm">C#</a></li>
<li><a href="https://www.tutorialspoint.com/artificial_intelligence/index.htm" target="_blank">Artificial Intelligence</a></li>
</ul>
</body>
</html>

Output

raja
Published on 26-Dec-2019 12:33:50
Advertisements