Question

In: Computer Science

Click here to show hidden content In the main section, following the last question, create a...


Click here to show hidden content
In the main section, following the last question, create a drop-down menu with two first level links. The second link will show three second level links when hovering.

Solutions

Expert Solution

<html>
<head>
<title>Page Title</title>
</head>
<style>
li {
display: block;
transition-duration: 0.5s;
}

li:hover {
cursor: pointer;
}

ul li ul {
visibility: hidden;
opacity: 0;
position: absolute;
transition: all 0.5s ease;
margin-top: 1rem;
left: 0;
display: none;
}

ul li:hover > ul,
ul li ul:hover {
visibility: visible;
opacity: 1;
display: block;
}

ul li ul li {
clear: both;
width: 100%;
}
a {
text-decoration: none;
}

nav {
font-family: monospace;
}

ul {
background: darkorange;
list-style: none;
margin: 0;
padding-left: 0;
}

li {
color: #fff;
background: darkorange;
display: block;
float: left;
padding: 1rem;
position: relative;
text-decoration: none;
transition-duration: 0.5s;
}
  
li a {
color: #fff;
}

li:hover {
background: red;
cursor: pointer;
}

ul li ul {
background: orange;
visibility: hidden;
opacity: 0;
min-width: 5rem;
position: absolute;
transition: all 0.5s ease;
margin-top: 1rem;
left: 0;
display: none;
}

ul li:hover > ul,
ul li:focus-within > ul, /* this is the line we add */
ul li ul:hover {
visibility: visible;
opacity: 1;
display: block;
}

ul li ul li {
clear: both;
width: 100%;
}
</style>
<body>
<nav role="navigation">
<ul>
<li><a href="#">one</a></li>
<li><a href="#">two</a>
<ul class="dropdown">
<li><a href="#">sub-1</a></li>
<li><a href="#">sub-2</a></li>
<li><a href="#">sub-3</a></li>
</ul>
</li>
<li><a href="#">three</a></li>
</ul>
</nav>
</body>
</html>

2.Code with only 2 menu

<html>
<head>
<title>Page Title</title>
</head>
<style>
li {
display: block;
transition-duration: 0.5s;
}

li:hover {
cursor: pointer;
}

ul li ul {
visibility: hidden;
opacity: 0;
position: absolute;
transition: all 0.5s ease;
margin-top: 1rem;
left: 0;
display: none;
}

ul li:hover > ul,
ul li ul:hover {
visibility: visible;
opacity: 1;
display: block;
}

ul li ul li {
clear: both;
width: 100%;
}
a {
text-decoration: none;
}

nav {
font-family: monospace;
}

ul {
background: darkorange;
list-style: none;
margin: 0;
padding-left: 0;
}

li {
color: #fff;
background: darkorange;
display: block;
float: left;
padding: 1rem;
position: relative;
text-decoration: none;
transition-duration: 0.5s;
}
  
li a {
color: #fff;
}

li:hover {
background: red;
cursor: pointer;
}

ul li ul {
background: orange;
visibility: hidden;
opacity: 0;
min-width: 5rem;
position: absolute;
transition: all 0.5s ease;
margin-top: 1rem;
left: 0;
display: none;
}

ul li:hover > ul,
ul li:focus-within > ul, /* this is the line we add */
ul li ul:hover {
visibility: visible;
opacity: 1;
display: block;
}

ul li ul li {
clear: both;
width: 100%;
}
</style>
<body>
<nav role="navigation">
<ul>
<li><a href="#">one</a></li>
<li><a href="#">two</a>
<ul class="dropdown">
<li><a href="#">sub-1</a></li>
<li><a href="#">sub-2</a></li>
<li><a href="#">sub-3</a></li>
</ul>
</li>

</ul>
</nav>
</body>
</html>

Output for both coding


Related Solutions

As the following statements execute, what is the content of the priority queue? Show the content...
As the following statements execute, what is the content of the priority queue? Show the content of the queue after each step: PriorityQueue<String> myPriorityQueue = new PriorityQueue<>(); myPriorityQueue.offer("Jim"); myPriorityQueue.offer ("Jess"); myPriorityQueue.offer ("Jill"); myPriorityQueue.offer ("Jane"); String name = myPriorityQueue.poll(); myPriorityQueue.offer (name); myPriorityQueue.offer (myPriorityQueue.peek()); myPriorityQueue.offer ("Jim"); myPriorityQueue.poll();
Compute the income tax liability for each of the following unrelated C corporations. Click here to...
Compute the income tax liability for each of the following unrelated C corporations. Click here to access the tax table to use for this problem. a. Darter Corporation has taxable income of $57,500. $ b. Owl Corporation has taxable income of $13,036,000. $ c. Toucan Corporation, a personal service corporation, has taxable income of $845,000. $
The following question is from subject organizational behaviour The last section of chapter one discusses four...
The following question is from subject organizational behaviour The last section of chapter one discusses four contemporary management concerns (diversity, employee health and well-being, talent management and employee engagement, and corporate social responsibility). Question Which two of these four concerns has the Coronavirus had the largest impact on and why?
Random sampling from four treatments produced the following data: Use Table 4. Click here for the...
Random sampling from four treatments produced the following data: Use Table 4. Click here for the Excel Data File Treatments A B C D −11        −8         −8         −12        −13        −13         −13         −13        −10        −15         −8         −15        −12         −13         −10         X−AX−A = −11.3 X−BX−B = −12 X−CX−C = −10.4 X−DX−D = −13.3 sA2 = 2.33 sB2 = 8.7 sC2 = 6.3 sD2 = 2.3 a. Calculate...
specify the code to create html with the following content: 1. a paragraph stating, this is...
specify the code to create html with the following content: 1. a paragraph stating, this is an example. 2 image logo.jpg with alternate text ABC Logo below the paragraph created in 1.
Important: please show work for each question. Thank you! In a previous section of PSY230, the...
Important: please show work for each question. Thank you! In a previous section of PSY230, the second exam was worth 80 points. The scores from that class were normally distributed with a mean (μ ) of 65 and a standard deviation (σ) of 5. If the exam scores were converted to a Z distribution, the distribution would form a perfect bell shape. The following questions require locating individual exam scores on the Z distribution and examine the percentage (or proportion)...
Open the PHET charges and fields stimulation to answer the following question 1. click on "grid"...
Open the PHET charges and fields stimulation to answer the following question 1. click on "grid" after tthat place on + charge in the center of the grid then proceed to click on electric field Do the arrows shown in the stimulation help envision the electric field to be called field lines? How are they alike and how do they differ from the field lines, I will give a thumbs up to answers that are complete
Hand assemble the following unconditional BRA instruction: HERE BRA HERE. Remember to show your work including...
Hand assemble the following unconditional BRA instruction: HERE BRA HERE. Remember to show your work including the branch calculation. (Motorolla 68k)
QUESTION: The following tables describe the content of a relational database: a) Identify and classify the...
QUESTION: The following tables describe the content of a relational database: a) Identify and classify the tables as either entity or relationship The first step in building an E-R model is to identify the entities. Having identified the entities, the next step is to identify all the relationships that exist between these entities. Using the content of the relational database above: b) Using the relations in the relational database, explain how one can transform relationship in E-R model into a...
Question 1 Download the files Book.java and BookInfo.txt from Content->Chapter 12 Quiz Files. Create a BookDriver.java...
Question 1 Download the files Book.java and BookInfo.txt from Content->Chapter 12 Quiz Files. Create a BookDriver.java class with a main method. In the main method, create an ArrayList of Book objects, read in the information from BookInfo.txt and create Book objects to populate the ArrayList. After all data from the file is read in and the Book objects added to the ArrayList- print the contents of the ArrayList. Paste your BookDriver.java text (CtrlC to copy, CtrlV to paste) into the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT