🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X
Questions


















Create a Restaurant Menu Card using HTML and CSS.

Last Updated : 27 Apr 2026 Jan 24

Solution:

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style >
        div{max-width: 550px; margin: 20px auto;}
        h1{text-align: center;}
        h2{color: gray; border-bottom: 1px solid gray;}
        ul{list-style-type: none; }
        li{padding: 5px 0;}
        .rate{float: right; color: red;}

    </style>
</head>
<body>
    <div>
    <h1>Restaurent Menu Card</h1>
    <h2>Tea</h2>
    <ul>
        <li>Normal Tea <span class="rate">Rs 30</span></li>
        <li>Masala Tea <span class="rate">Rs 50</span></li>
        <li>Special Tea <span class="rate">Rs 70</span></li>
    </ul>

        <h2>Pizza</h2>
    <ul>
        <li>Mix veg Pizza <span class="rate">Rs 199</span></li>
        <li>Kulhad Pizza <span class="rate">Rs 99</span></li>
        <li>Onion Pizza <span class="rate">Rs 149</span></li>
        <li>Cheese Pizza <span class="rate">Rs 159</span></li>
    </ul>

        <h2>Burger</h2>
    <ul>
        <li>Veg Burger <span class="rate">Rs 69</span></li>
        <li>Paneer Burger <span class="rate">Rs 89</span></li>
        <li>Fruit  Burger <span class="rate">Rs 75</span></li>
        <li>Cheese Burger <span class="rate">Rs 69</span></li>
    </ul>
</div>
</body>
</html>

OUTPUT:

Code Explanation:

  • Container (div):

    • max-width: 550px;: Limits the container's width to 550 pixels.
    • margin: 20px auto;: Centers the container horizontally and adds 20 pixels of margin on top and bottom.
  • Heading 1 (h1):

    • text-align: center;: Centers the main heading text.
  • Heading 2 (h2):

    • color: gray;: Sets the text color to gray.
    • border-bottom: 1px solid gray;: Adds a gray underline below the heading.
  • Unordered List (ul):

    • list-style-type: none;: Removes bullet points from the list.
  • List Items (li):

    • padding: 5px 0;: Adds 5 pixels of vertical padding to each list item.
  • Price (.rate class):

    • float: right;: Aligns the price text to the right within the list item.
    • color: red;: Colors the price text red.

 

Report an error

Meanwhile you can watch this video

Watch Video
Latest Updates