How to apply style for 'ul' and 'li' and 'a' in the same class?

I am new to interface design. I want to apply the style for <ul> and <li> , as well as for <a> in the same class .. is this possible?

here is my code

 <html> <head> <title></title> <style type="text/css"> .menu ul, li, a { text-decoration: none; list-style-type: none; padding: 10px; margin-left: 10px; border: 2px solid green; } </style> </head> <body> <div class="menu"> <ul> <li> <a href="#">Home</a> <a href="#">Services</a> <a href="#">Customers</a> <a href="#">Locations</a> <a href="#">Fare</a> <a href="#">Contact Us</a> </li> </ul> </div> </body> </html> 
+5
source share
1 answer

Yes, maybe ...

 .menu ul { /*css here*/ } .menu ul li { /*css here*/ } .menu ul li a { /*css here*/ } 

or

 .menu ul, .menu ul li, .menu ul li a { /*css here*/ } 

or

 .menu ul, .menu li, .menu a { /*css here*/ } 
+11
source

Source: https://habr.com/ru/post/1262623/


All Articles