Struggling with organizing the layout of your HTML page? Let us lend

I am having difficulty with the layout of a page I'm working on. The lower page navigation is not positioning properly - it wraps below the left column instead of staying below the data columns. Additionally, the border for the navigation appears at the top of the page instead of around the navigation itself. Finally, the footer is displaying at the top of the page rather than at the bottom. I've been trying to troubleshoot this for over a day now and can't seem to find where I went wrong.

Here's a simplified version of the code:

.h2b {
  /*page title*/
  font-size: 17.5pt;
  color: #469;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
}
.a {
  color: #469;
  text-decoration: none;
}
body {
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: small;
  font-style: normal;
  background-color: #fff;
}
#container {
  width: 100%;
  margin: 0;
  background-color: #fff;
  position: relative;
  padding: 0;
}
#masthead {
  text-align: right;
  width: 100%;
  background-color: #c5d5e5;
  /*width: auto;*/
  margin: 0;
  padding: 0;
  overflow: auto;
}
#page_content {
  position: relative;
  width: 96%;
  /*width: 98%;*/
  /*border-top-width: 1px;
border-top-style: solid;
border-top-color: #CCAA77;*/
  left: 20px;
}
#major_revision {
  
}
#footer {
  background-color: #dfcfbf;
  padding-bottom: 5px;
  width: auto;
  clear: both;
  overflow: auto;
}
#masthead img {
  float: left;
  margin: 0;
  padding: 0;
}
#masthead p {
  font-size: small;
  text-align: right;
  color: #000;
  margin: 0 0 0 0;
  padding: 0;
}

/* Styles for Navigationcommon modified 10-16-2015*/

#navigationcommon {
  background-color: #548EBE;
  overflow: hidden;
  border-bottom: thin black solid;
}
#navigationcommon ul {
  list-style-type: none;
  width: 100%;
  margin: 0;
  padding: 0;
}
#navigationcommon li {
  float: left;
}
#navigationcommon a {
  color: #FFF;
  text-decoration: none;
  display: block;
  padding: 5px;
  border: 1px solid #D3D3D3;
  background-color: #548EBE;
}
#navigationcommon a:hover {
  color: #000;
  text-decoration: none;
  border: 1px solid #D3D3D3;
  background-color: #ADD8E6;
}

/* Styles for Footer */

#footer p {
  font-size: x-small;
  text-align: center;
  color: #393939;
  margin: 10px;
  padding: 1px;
}
#footer a {
  color: #393939;
  text-decoration: underline;
}
#footer a:hover {
  color: #000;
  text-decoration: none;
}
<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta charset="UTF-8">

  <title>PAGE</title>


</head>

<body>

  <!-- Begin Container -->
  <div id="container">

    <!-- Begin Masthead -->
    <header id="masthead" onclick="" style="background-color:#0047ff">
      <p style="background-color:#0047ff;height:30px; width:104px">
        <!--See helper file for paths to image files-->
      </p>
    </header>
    <!-- End Masthead -->
    <nav id="navigationcommon" onclick="">
      <ul>
        <!--See helper file for paths to image files-->
        <li><a href="#">Home</a>
        </li>
        <li><a href="#">About</a>
        </li>
        <li><a href="#">Contacts</a>
        </li>
        <li>
          <a href="#" onclick="passdata(); return false">Improve</a>
        </li>
        <li><a href="#">Tailor</a>
        </li>
      </ul>

      <a href="#" style="float:right;font:small-caption;border-style:none;
color:white; vertical-align:bottom;margin-bottom:0px;padding-bottom:0px;padding-left:5px;padding-right:5px">Advanced Search</a>
      <!--See helper file for paths to image files-->
      <input type="image" src="pill-button-green-clip-art.jpg" style="width: 90px; border-style:none; float:right; height: 28px;" value="Search" onclick="search()">&nbsp; &nbsp; &nbsp;
      <input name="search" type="text" maxlength="512" id="search" class="searchField" title="" style="width: 300px; 
border-style:none; height: 26px; float:right; padding-right:5px; " value="Enter Keyword">&nbsp; &nbsp; &nbsp;
    </nav>

    <!-- Begin Page Content -->
    <section id="page_content" style="top: 60px;" onclick="">
      <div id="major_revision" style="position:fixed;top: 65px;float:left;width:100%;padding: 0 1% 1% 2%;">
     
      </div>

    
      
        </div>

       
      </div>

     
   

    </section>
    <!-- Begin Footer -->
    <div id="footer">
      <p>Copyright &copy; All Rights Reserved.</p>
    </div>
    <!-- End Footer -->

  </div>
  <!-- End Container -->

</body>

</html>
​

Answer №1

If you are currently in the process of creating a sophisticated application with complex design elements, I suggest utilizing absolute layouts:

http://codepen.io/anon/pen/BomePK

<div class="l-header">Header</div>
... (similar code with slight adjustments) ...
<div class="l-footer">Footer</div>


.l-header        { width:100%; height:20px; top:0; left:0; position:absolute; background:orange; }
.l-navigation    { width:100%; height:20px; top:20px; left:0; position:absolute; background:green; }
... (some CSS styles modified) ...

<p>This layout will function well on tablet-sized screens, but given the expected complexity of your application, it may not be sufficient. It's advisable to reconsider the user experience aspect for smooth operation on mobile devices.</p>

<p>Furthermore, moving your inline CSS to an external stylesheet is highly recommended.</p>
    </div></answer1>
<exanswer1><div class="answer chosen" i="33217212" l="3.0" c="1445254553" a="TG93a2FzZQ==" ai="981047">
<p>It seems like you are working on a high-level application, and based on the intricate complexity displayed in your design, I recommend opting for absolute layouts:</p>

<p><a href="http://codepen.io/anon/pen/BomePK" rel="nofollow">http://codepen.io/anon/pen/BomePK</a></p>

<pre><code><div class="l-header">Header</div>
... (similar code with slight adjustments) ...
<div class="l-footer">Footer</div>


.l-header        { width:100%; height:20px; top:0; left:0; position:absolute; background:orange; }
.l-navigation    { width:100%; height:20px; top:20px; left:0; position:absolute; background:green; }
... (some CSS styles modified) ...

<p>This layout will work effectively on tablet-sized screens, however, considering the complexity expected in your application, it may fall short. It would be wise to reassess the user experience aspect to ensure seamless functionality on mobile devices.</p>

<p>In addition, transferring your inline CSS to an external stylesheet is strongly advised.</p>
    </div></answer1>
<exanswer1><div class="answer chosen" i="33217212" l="3.0" c="1445254553" a="TG93a2FzZQ==" ai="981047">
<p>It appears that you are developing a complex application, and based on the intricacy of your design, I recommend using absolute layouts:</p>

<p><a href="http://codepen.io/anon/pen/BomePK" rel="nofollow">http://codepen.io/anon/pen/BomePK</a></p>

<pre><code><div class="l-header">Header</div>
... (similar code with slight adjustments) ...
<div class="l-footer">Footer</div>


.l-header        { width:100%; height:20px; top:0; left:0; position:absolute; background:orange; }
.l-navigation    { width:100%; height:20px; top:20px; left:0; position:absolute; background:green; }
... (some CSS styles modified) ...

<p>This layout will be suitable for tablet-sized screens, but the anticipated complexity in your application may require more. It's recommended to review the user experience aspect to ensure optimal performance on mobile devices.</p>

<p>Additionally, consider relocating your inline CSS to an external stylesheet.</p>
    </div></answer1>
<exanswer1><div class="answer chosen" i="33217212" l="3.0" c="1445254553" a="TG93a2FzZQ==" ai="981047">
<p>It looks like you're embarking on building a sophisticated application, and judging by the level of complexity in your design, I advise utilizing absolute layouts:</p>

<p><a href="http://codepen.io/anon/pen/BomePK" rel="nofollow">http://codepen.io/anon/pen/BomePK</a></p>

<pre><code><div class="l-header">Header</div>
... (similar code with slight adjustments) ...
<div class="l-footer">Footer</div>


.l-header        { width:100%; height:20px; top:0; left:0; position:absolute; background:orange; }
.l-navigation    { width:100%; height:20px; top:20px; left:0; position:absolute; background:green; }
... (some CSS styles modified) ...

<p>This layout will adapt well to tablet-sized screens, but with the expected complexity in your application, it may not suffice. Consider revisiting the user experience aspect for smooth operation on mobile devices.</p>

<p>Moreover, transitioning your inline CSS to an external stylesheet is highly advisable.</p>
    </div></answer1>
<exanswer1><div class="answer chosen" i="33217212" l="3.0" c="1445254553" a="TG93a2FzZQ==" ai="981047">
<p>You seem to be working on a complex application, and typically, I advocate for using absolute layouts given the intricate nature of your design:</p>

<p><a href="http://codepen.io/anon/pen/BomePK" rel="nofollow">http://codepen.io/anon/pen/BomePK</a></p>

<pre><code><div class="l-header">Header</div>
... (similar code with minor modifications) ...
<div class="l-footer">Footer</div>


.l-header        { width:100%; height:20px; top:0; left:0; position:absolute; background:orange; }
.l-navigation    { width:100%; height:20px; top:20px; left:0; position:absolute; background:green; }
... (slight adjustments in CSS styles) ...

<p>This design will adjust well to tablet-sized screens, but given the complexity expected in your app, it might not be adequate. Revisiting the user experience aspect to ensure effective functioning on mobile devices is crucial.</p>

<p>Also, consider moving your inline CSS to an external stylesheet for better organization.</p>
    </div></answer1>
<exanswer1><div class="answer chosen" i="33217212" l="3.0" c="1445254553" a="TG93a2FzZQ==" ai="981047">
<p>It appears that you are developing a sophisticated application, and based on the intricate design you have implemented, my suggestion is to utilize absolute layouts:</p>

<p><a href="http://codepen.io/anon/pen/BomePJ" rel="nofollow">http://codepen.io/anon/pen/BomePJ</a></p>

<pre><code><div class="l-masthead">Masthead</div>
<div class="l-navigation">Navigation</div>
<div class="l-revision">Revision</div>
<div class="l-pagenav-top">Page Navigation Top</div>
<div class="l-data">
  <div class="l-data-con">
    <div class="l-data1">
      <p>
        Lorum1
      </p>
      <p>
        Lorum2
      </p>
      <p>
        Lorum1
      </p>
      <p>
        Lorum1
      </p>
      <p>
        Lorum1
      </p>
    </div>
    <div class="l-data2">
      <p>
        Lorum1
      </p>
      <p>
        Lorum2
      </p>
      <p>
        Lorum1
      </p>
      <p>
        Lorum1
      </p>
      <p>
        Lorum1
      </p>     </div>
   </div>  
</div>
<div class="l-pagenav-bot">Page Navigation Bottom</div>
<div class="l-footer">Footer</div>


.l-masthead      { width:100%; height:20px; top:0; left:0; position:absolute; background:orange; }
.l-navigation    { width:100%; height:20px; top:20px; left:0; position:absolute; background:green; }
.l-revision      { width:100%; height:20px; top:40px; left:0; position:absolute; background:lime; }
.l-pagenav-top   { width:100%; height:20px; top:60px; left:0; position:absolute; background:yellow; }

.l-data          { width:100%; position:absolute; top:80px; bottom:40px; left:0; }
.l-data-con      { width:100%; height:100%; position:relative; }
.l-data1         { padding:20px; overflow-y:auto; position:absolute; top:0; right:50%; bottom:0; left:0; background:LightBlue; }
.l-data2         { padding:20px; overflow-y:auto;position:absolute; top:0; right:0; bottom:0; left:50%; background:LightCyan; }

.l-pagenav-bot   { width:100%; height:20px; position:absolute; bottom:20px; left:0; background:yellow; }
.l-footer        { width:100%; height:20px; position:absolute; bottom:0; left:0; background:orange; }

This layout will be responsive up to a tablet size, but beyond that, considering the complexity expected in your app, it may not be sufficient. You may need to revisit the user experience to ensure proper functionality on phones.

Furthermore, shifting your CSS from inline to an external file is recommended for better management.

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

Updates made to CSS are not reflecting on the error 404 page

Unable to Apply CSS Changes to 404 Error Page EDIT: page in question: Right from the start: I have ruled out any relative path issues. I have specified a base href in my header like this: <base href="https://hinnahackers.no/"> I am aware that thi ...

The columns in the table are all displaying varying widths even though they have been defined with fixed table layout

I have a nested table displayed in my HTML, and I am attempting to set each column to be 50% width, but for some reason it's not working. In the past, whenever I've needed to accomplish this, applying table-layout: fixed has usually done the tri ...

Leverage an HTML table to serve as a data source for populating a Kendo UI template

My latest creation is a unique service that generates HTML tables based on request parameters. The current implementation returns the data as an HTML page in string format. Here's a sample output: <!DOCTYPE html> <html> <head> ...

Using JQuery to conceal floated divs

I'm facing an issue that I had resolved the last time I worked on this website. However, I am currently redesigning it to include additional elements, and I am struggling to make the jQuery part function correctly. Essentially, I have an HTML documen ...

Tips for getting my navigation bar menu button functioning properly?

I am struggling to make my button show the menu when clicked. I have tried various methods but still can't pinpoint the issue. I utilized the "checkbox" trick to display the hamburger button when the site width is under 500px for a responsive menu, ye ...

Troubleshooting Angularjs: Why isn't the HTML displaying the variable value?

Trying to display the value of an AngularJS variable in HTML using this code: <div ng-controller="MyTextbox"> <p>Last update date: {{nodeID1}} </p> Here's my angularjs controller code: angular.module("umbraco").controller("MyTex ...

Switching the checkbox value upon clicking a div element

One challenge I am facing is with a checkbox that saves its value and title in the local storage when clicked. This checkbox is located within a div, and I want the checkbox value to change whenever any part of the div is clicked. Despite my efforts, I hav ...

Troubleshooting: Navbar dropdown menu in AngularJS gets hidden within UI layout

After spending some time trying to understand why the NavBar drop-down is getting overlapped inside the ui-layout, I realize that I must be overlooking some basic steps. This issue seems so simple, yet it is eluding me. To see the details of the problem, ...

Utilizing CSS-in-JS to eliminate arrow buttons from a TextField

I'm currently developing a webpage using React and Material-UI. One of the components I have is a TextField element, and I need to remove the arrow buttons that typically appear on number input fields. If I were utilizing CSS, I could easily achieve t ...

Adding an existing element to the DOM using Javascript/jQuery

I am facing an issue in my DOM where I have an element with two children, a div block and a button. My goal is to add a new copy of the same div block to the parentNode whenever the button is clicked. Currently, I am using the following code in the button ...

Display words on screen and then alter hue using HTML and CSS

Is there a way to dynamically change the color of text inside <a> tags from black to red after a specific time interval and keep it permanently red? do { document.getElementById("code").innerHTML +="<a>Hello World</a><br>"; awa ...

Discover more in React about using ellipses (...) with dangerouslySetInnerHTML

What is the best method for limiting the number of HTML lines retrieved using dangerouslySetInnerHTML in a React application and creating a '... Read More' expander for it? I attempted to use react-lines-ellipsis, but unfortunately the 'tex ...

Using Javascript to create a radio button group

Is there a way to trigger an alert message when all radio buttons are checked as 'no'? I currently am only able to check each radio button individually. //The method I currently know $('#attraction1').change( function(){ if ($(this ...

Retrieve detailed Paypal donation transaction information in HTML format with the donation button functionality integrated

I'm currently in the process of building a web application for a non-profit organization, which includes a Paypal Donation feature. I am using HTML5, CSS3, and jQuery to develop this application. I have successfully implemented the Donation button fro ...

How can I incorporate a search bar or similar feature on my website that mimics the functionality of Ctrl+F?

Is there a way to incorporate a search bar on certain pages of my website that functions similarly to the Ctrl+F feature in Google Chrome? Essentially, I am looking for a "find" function that searches the entire page(s). My site is built using WordPress, ...

What is the best method for integrating opensea-js using a script tag in a vanilla HTML/JS environment?

Is there a way to incorporate opensea-js into an html/js project that does not rely on node.js? The source code for opensea-js is only available on github and npm at https://github.com/ProjectOpenSea/opensea-js I came across this link: However, when I tr ...

Iconic slim template for data disabling

Having an issue while working on a Rails app with slim. I am facing a problem passing HTML to slim through a button using the data-disable-with attribute. My aim is to display an icon on the button when it's clicked. = f.submit t("basket.next_step") ...

Troubleshoot: CSS class H2 style is not displaying correctly

I have the following code in my .css file: h2.spielbox { margin-bottom:80px; color:#f00; } a.spielbox { text-decoration:none; background-color:#aff; } However, in my html file, the h2 style is not ...

Sending jQuery events from an aspx page to an ascx control

Yesterday, I began utilizing ascx and started breaking down my "dynamic" default.aspx page into smaller segments. In default.aspx, there is a significant amount of JavaScript/jquery code responsible for managing various events. After moving some html code ...

Get rid of the paper border in Material-ui

Is there a way to remove the top border in material-ui Paper component? I've attempted the code below, but it doesn't seem to be effective. <Paper sx={{ border: 0, borderTop: 0, borderRadius: 0, ...