I am not able to create CSS Dropdown menu

0 votes

I was just trying to make a dropdown menu. But it is not working. What is the error?

.dropdown1{
    width: 200px;
    height: 110px;
    background-color: white;
    border: 5px solid black;
    position:absolute;
    left: 400px;
    opacity: 0;
}

.about_us1:hover .dropdown1{
    opacity: 1;
}
    <div class="header">
       <strong> <h3 style="position: relative;top: 2px;left: 200px;font-weight: 1000;font-size: 30px;">HOME</h3></strong>
       <strong> <h3 class="about_us1" style="position: relative;top: -30px;left: 400px;font-weight: 1000;font-size: 30px;">ABOUT US</h3></strong>
<center>
       <div class="dropdown1">
           <h3>Our Motto</h3>
           <br>
           <h3>Admission</h3>
           <br>
           <h3>Principal's Desk</h3>
       </div>
</center>
       <strong> <h3 style="position: relative;top: -65px;left: 700px;font-weight: 1000;font-size: 30px;">ACADEMIC</h3></strong>
       <strong> <h3 style="position: relative;top: -100px;left: 1000px;font-weight: 1000;font-size: 30px;">INFRASTRUCTURE</h3></strong>
       <strong> <h3 style="position: relative;top: -135px;left: 1450px;font-weight: 1000;font-size: 30px;">ADMISSION</h3></strong>
    </div>

I've tried two things instead of opacity. (visibility:visible as well as visibility:hidden) (display: none and display: block). With these three trials, it is still not working.

Jun 21 in CSS by Edureka
• 8,060 points
8 views

1 answer to this question.

0 votes
Use any element to open the dropdown menu, e.g. a <button>, <a> or <p> element. Use a container element (like <div>) to create the dropdown menu and add the dropdown links inside it. Wrap a <div> element around the button and the <div> to position the dropdown menu correctly with CSS.
answered 2 days ago by Edureka
• 9,540 points

Related Questions In CSS

0 votes
1 answer

asp.net master page css not applying to asp form pages

just try the following code: <head> ...READ MORE

answered Jun 13 in CSS by Edureka
• 9,540 points
16 views
0 votes
1 answer

How can I use CSS to style multiple images differently?

You can do that in HTML (delete ...READ MORE

answered Jun 21 in CSS by Edureka
• 9,540 points
8 views
0 votes
1 answer
0 votes
1 answer

input[type='text'] CSS selector does not apply to default-type text inputs?

Because that is not what it is ...READ MORE

answered 2 days ago in CSS by Edureka
• 9,540 points
9 views
0 votes
1 answer

How do I give text or an image a transparent background using CSS?

Use either a semi-transparent PNG or SVG ...READ MORE

answered May 27 in CSS by Edureka
• 9,540 points
25 views
0 votes
1 answer

CSS Background Opacity

The CSS opacity property can be used ...READ MORE

answered Jun 17 in CSS by Edureka
• 9,540 points
9 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
4,482 views
0 votes
1 answer

Using/Handling colon inside a JSF generated HTML element ID in CSS selector

Yes, you can.  Just Backslash (\) the colon.  Like ...READ MORE

answered Nov 14, 2018 in Others by DataKing99
• 8,240 points
1,652 views
0 votes
1 answer

I want to create a small square colour filled box in HTML & CSS. And most important - I want to write one line after the box

Try using the square html entity: <div style="color:blue">&a ...READ MORE

answered 2 days ago in CSS by Edureka
• 9,540 points
4 views
0 votes
1 answer

How to create material design input form using css and bootstrap?

Try with this code. HTML: <div class="main_div"> ...READ MORE

answered Jun 21 in CSS by Edureka
• 9,540 points
21 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP