How can I align the tags properly when inserting a tab box within a section tag?

How can I successfully insert a tab box within my section tag? I found this tab box tutorial on the website here

The download link for the source code is available here: source code

Below is the HTML code snippet:

 <!DOCTYPE html>
  <html>
<head>
<meta charset="utf-8" />
<title>Librarian's corner</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/nav-menu.css">
<link rel="stylesheet" type="text/css" href="css/body.css">

</head>
 <body >

 <div class="big-wrapper">
 <div class="form-nav-menu">
 <nav>

    <ul>
        <li><a id="active" href="adduser.html">ADD USER</a></li>
        <li><a  class="in-active" href="#">EDIT USER</a></li>
        <li><a  class="in-active" href="#">DELETE USER</a></li>
        <li><a  class="in-active" href="#"> VIEW USER</a></li>
    </ul>
</nav>
 </div>

  <header>
<h1>The Librarian's corner</h1>
</header>



  <section>

  > insert tab  box here <

 </section>



 <footer>
 <h1>this is footer</h1>
  </footer>
   </body>
  </html>

And here is the CSS code in the file named nav-menu.css:

 * {
margin: 0;
padding: 0;
}

 html {
width: 100%;
display: -webkit-box;
-webkit-box-pack: center;
background: orange;
background-attachment: fixed;
background-size: cover;
background-position: center;

 }
 body {
 display: block;
 width: 100%;

}

header {
width: 100%;


 background: rgba(0, 0, 12, 1); /* Fallback */

 background-color: rgba(12, 12, 12, 0.5);

 margin: 0;

  }
 header h1 {
text-align: center;
line-height: 400px;
z-index: 99;
color: #fff;
font-size: 50px;
font-family: Comic Sans, Comic Sans MS, cursive;
text-shadow: rgb(3, 3, 3) 4px 4px 4px;
height: auto;
}

 section {
height: auto;
background: white;
width: 100%;
margin-top: 0px;
}


footer {
height: 150px;
background: black;
width: 100%;
margin-top: 0px;
}


.form-nav-menu {

z-index: 99;
position: fixed;
width: 100%;
display: -webkit-box;
-webkit-box-pack: center;

  }

.form-nav-menu nav {
width: 100%;
height: 70px;
}
.form-nav-menu nav ul{
width: 100%;
height: 70px;
list-style-type: none;
}
.form-nav-menu nav ul li{
height: 70px;
width: 120px;
display: inline-block;
float: right;
}

I'm facing an issue where inserting the CSS tab box code within the section tag causes the footer background to misalign. The body background is set to orange while the background of the footer is black. However, the black color appears at the top instead of at the bottom.

Answer №1

To ensure proper layout, consider setting a min-height for the "section" element when using a container:

section {
height: auto;
**min-height:250px;**
background: white;
width: 100%;
margin-top: 0px;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

CSS styles may not be consistently displayed or may vanish after being initially implemented

The colors and background remain unchanged. In previous projects, everything ended up falling apart Refreshing the page with F5 or CTRL + F5 does not make a difference. When using Open Live Server in VS Code, it initially shows the changes being applied b ...

Exploring the Positives and Negatives of Using JQuery and Glow JavaScript Libraries

Is there a detailed analysis available that compares JQuery with the BBC's Glow JavaScript libraries? ...

Reorganizing an array using a custom prioritized list

Is it possible to sort an array but override precedence for certain words by placing them at the end using a place_last_lookup array? input_place_last_lookup = ["not","in"]; input_array = [ "good", "in", "all&qu ...

Adjust the size of the sliding tool with images of varying dimensions

My mobile-first slider features three different types of images: tall, horizontally long, and square. I want the size of the slider to be determined by the horizontally long image and then scale and center the other images to fit its size. To achieve this, ...

Mastering the Art of Implementing Jquery Contains Function

Exploring the jQuery website led me to the contains selector. $("div:contains('John')").css("text-decoration", "underline"); I am trying to figure out how to make this work with a dynamic value instead of hard-coding it. I attempted something l ...

Switching the scope or zone in Angular when handling events external to Angular

Currently, I am utilizing an external library within my Angular 6 application that incorporates customizable event listeners. Specifically, I am employing flowchart.js, although similar issues may arise with other libraries. In the case of flowchart.js, i ...

Sort through the API's array

Currently, I am working with the OpenWeather API's 5-day 3-hour forecast feature and encountering an issue regarding the response JSON. The array contains 40 items, each with a "dt_txt" value in the format of "2018-11-22 15:00:00". My goal is to displ ...

Experience a seamless transition as the background gently fades in and out alongside the captivating text carousel

I have a concept that involves three background images transitioning in and out every 5 seconds. Additionally, I am utilizing the native bootstrap carousel feature to slide text in synchronization with the changing background images. Solving the Issue ...

Expanding the size of a textarea using JavaScript

JavaScript: function adjustRows() { var value = document.getElementById("test1").value.length; if (value <= 18) { value.rows = 1; } else if (value > 18 && value < 36) { value.rows = 2; } else if (value > 36 && v ...

Error: The build process for Next.js using the command `npm run build`

Currently attempting to construct my application with target: 'serverless' set in the next.config.js file (in order to deploy on AWS Lambda). Upon running npm run build, I am encountering the following output: Warning: Built-in CSS support is bei ...

How to retrieve the chosen option from a drop-down menu created within a loop in a React application

I am seeking guidance on the best way to create multiple drop-down menus (<select>) using a loop, so that I can retrieve their selected values using a button. I have attempted to replicate what is currently in my code, hoping this information is suff ...

CAUTION: Attempted to load angular multiple times while loading the page

I encountered a warning message while working on my project, causing errors in calling backend APIs due to duplicate calls. Despite attempting previously suggested solutions from the forum, I am stuck and seeking assistance. Can anyone provide guidance? Be ...

After a successful login, learn how to implement a bottom tab menu in React Native

I'm diving into the world of react-native and finding myself a bit lost when it comes to routing and navigation. I have 4 screens - Login, Register, Home, and Links. The Register and Login screens are all set up, with the ability to navigate back usin ...

I have been dynamically inserting div elements into the DOM using JavaScript, using the appendChild method to add them and later removing them with removeChild. Strangely, when trying to append a div

There seems to be an issue in the code snippet below. The function create() works fine the first time, but encounters a problem on the second run at the line boxWrapper.appendChild(box);. It appears that the removeChild method is causing some disruption in ...

Use $.ajax to display the menu by capturing an array of elements {0}

Whenever I click on one of the DIV elements, a menu pops out on the side displaying more information about the clicked element. I can determine which element I'm clicking on, but I'm struggling to pass that information from jQuery to the PHP pag ...

Form Field Highlighting

I am currently attempting to eliminate the blue "halo" outline that appears on form elements in Firefox on OS X. I have successfully removed the halo in Safari on OS X using CSS with the following code: input { outline: none; } However, this method doe ...

Proper positioning of try/catch block in scenarios involving delayed async/await operations

For the past six months, I have been utilizing async/await and have truly enjoyed the convenience it provides. Typically, I adhere to the traditional usage like so: try { await doSomethingAsync() } catch (e) {} Lately, I've delved into experimenti ...

How can we bring back the '<center>' tag into the HTML standard?

The debate between presentation and relation is the basis for removing the tag from the HTML spec. However: Despite this, some browsers still require/recognize this tag. There are several issues with the alternative options. There are arguable relationa ...

When items are set to full width, material ui grid alignItems flex-start only affects the first row

I'm currently working with the material ui grid system, and I have a specific requirement. I need to create a grid container with a fixed height of 200px that accommodates full-width items. The challenge here is that I want the items to fill the conta ...

What is the best method to send user information from a registration form to a MySQL database table using AJAX without having to refresh

Currently facing an issue where user registration data (email, username, password) is not being submitted to the register table tbl_register when the submit button is clicked. Utilizing PHP with AJAX to prevent page refresh upon clicking submit and sendin ...