Apply style to particular HTML List (UL) using CSS

Last Reply 19 days ago By dharmendr

Posted 19 days ago

Actually i am using one ul tag for menu in ecommerce website and other one for side navigation bar but if i m doing styling in side nav.bar ul tag, it is also applied to menu ul and i m not able to use 2 multiple ul tag in my ecommerce website.How to use two ul tag & after that how to style them invidually 

You are viewing reply posted by: dharmendr 19 days ago.
Posted 19 days ago Modified on 19 days ago

Hi Amit1992,

Give unique class name to your UL element and apply css property to it.

Example :

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style type="text/css">
        .SideNavigation li
        {
            color: Red;
            font-size: x-large; 
            /*More css properties*/
        }
        .Menu li
        {
            color: Green;
            font-size: xx-large; 
            /*More css properties*/
        }
    </style>
</head>
<body>
    <ul class="SideNavigation">
        <li>Home</li>
        <li>Report</li>
        <li>Dashbord</li>
    </ul>
    <ul class="Menu">
        <li>Home</li>
        <li>About Us</li>
        <li>Contact Us</li>
    </ul>
</body>
</html>

Demo