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();
Using HTML and JAVASCRIPT Create a Content area on the main entry page will include inputs...
Using HTML and JAVASCRIPT Create a Content area on the main entry page will include inputs for customer entry for the following: Entry field (with labeling) for the Customer's name Entry field (with labeling) for the Customer's email address Entry field (with labeling) for which room the customer is planning on painting Entry field (with labeling) for the width of the room Entry field (with labeling) for the length of the room Entry field (with labeling) using a colour box...
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?
use the following codes and change  In the main-content div, for content, add three select dropdowns separated...
use the following codes and change  In the main-content div, for content, add three select dropdowns separated by line breaks. One will have ID changeFont, one will have ID bgColor and the third will have ID resizeDiv. For changeFont, the options should be: [CHANGE FONT SIZE] value blank, 8 pt. value 8t, 10 pt. value 10pt, 12 pt. value 12pt, 14 pt. value 14pt, and 16 pt. value 16pt. For bgColor the options should be [CHANGE BG COLOR] value blank, black...
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)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT