The initial website design only occupies half of the webpage with HTML

My code is only filling up half the screen, specifically the left half but not the right. I attempted to set the html height and width to 100%, but unfortunately, it did not resolve the issue. Additionally, after this adjustment, I encountered problems with clicking on the href links that direct to other pages. Any assistance or guidance would be greatly appreciated.

        html {
        margin: 0;
        height: 100%;
        width: 100%;
        }
        body {
        background: #B2906F;
        font-family: arial;
        margin: 0;
        height: 100%;
        }
        
        .picture{
        display: inline;
        margin: 0;
        padding: 0;
        position: fixed;
        z-index: -1;
        background-size: 100%
        }
        
        .button{
        padding: 10px 15px;
        text-decoration: none;
        border-radius: 5px;
        background-color: #05280c
        }
        .button-primary:hover {
        background-color: #05370c
        }
        
        h1{
        display: inline;
        margin: 0;
        background-color: #2c421f;
        padding: 5px;
        position: absolute;
        }
        
        ul{
        margin: 0;
        display: inline;
        padding: 0px 0px 0px 250px;
        }
        ul li {
        display: inline-block;
        list-style-type: none;
        padding: 15px 10px;
        color: #050c0c;
        margin: 0;
        }
        
        ul li a {
        color: black;
        }
        
        footer{
        clear: both;
        }
        
        nav {
        color: 
        height: 40px;
        margin: 0;
        background-color: #2c421f;
        }
 <!doctype html>
        <html>
        <head>
        <title>NWWolfPack</title>
        <link href="main.css" rel="stylesheet" />
        </head>
        
        <body>
        <h1>NW Wolf Pack</h1>
        <div class="picture"><img src="camo.jpg" width="1000" height="150">
            <header>
        <nav>
        <ul>
        <li class="button"><strong>Home</strong></li>
        <li><a href="records.html" class="button button-primary"><strong>Records</strong></a></li>
        <li><a href="membership.html" class="button button-primary"><strong>Membership</strong></a></li>
        <li><a href="contactus.html" class="button button-primary"><strong>Contact Us</strong></a></li>
        </ul>
        </nav>
        </header>
        </body>
        
        
        <footer>2017 Dillan Hall</footer>
        </html>

Answer №1

Place your coding within the primary container and set its width with margin: 0 auto

.primaryContainer{
    width:990px;
    margin: 0 auto;
}

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

Moving from the end to the beginning with a jQuery slider transition

Instead of relying on external plugins, I built this slider from scratch: function customSlider(selector, interval, index) { var slider = this; this.ind = index; this.selector = selector; this.slides = []; this.activeSlide = 0; this.amount; ...

How can modifications be made to HTML strings passed through props in React?

I'm working on implementing a pre-loader icon before an image is rendered in a React component using the code snippet below: export default class MediaPostItem extends BaseComponent { public constructor(props: IMediaPostItemProperties) { ...

Identify and target a particular DIV based on the URL for customization

My webpage has a collection of frequently asked questions (FAQs) on a page called faq.html. Here is an example structure: <div id="faq1">...</div> <div id="faq2">...</div> I am looking to create a pulsating or highlighting effect ...

Tips for creating a div that is consistently 80% of the page height and perfectly square

Sorry if this question seems a bit confusing, but I just can't seem to find the right words to explain it! What I'm trying to achieve is having a div element always be 80% of the height of the page, while also being perfectly square in shape. In ...

Creating multiple unique custom attributes for a specialized HTML element

Creating getter/setter methods for a custom attribute on a custom HTML element is quite simple: customElements.define('custom-el', class extends HTMLElement { static get observedAttributes() { return ['customAttr'] ...

When scrolling on IOS devices, the fixed element gets hidden underneath the lower element

During the development of my web H5 app, I encountered a technical issue. The fixed element 'Header' is getting covered by a lower element on IOS devices when I drag down the lower element, but it works fine on Android devices. Here is an image ...

I'm having trouble grasping the concept of serving gzip-compressed JavaScript and CSS files

Why is it important to serve compressed JavaScript and CSS files? I understand that it reduces file size, but does the browser/webserver have to decompress them to read them? It's been mentioned that the webserver handles the compression. Does this me ...

What is the best way to showcase a JSON object in an attractive format on a webpage?

Similar Question: JavaScript data formatting/pretty printer var theobject_string = '{...}'; // I have a JSON object as a string. Is there a way to present this string in a visually appealing manner on an HTML webpage? I would like the ...

Looking for the Mustache template library?

Can you provide some examples of how mustache can be used effectively? I recently came across it, but I'm struggling to grasp how it differs from the traditional approach of creating template files within frameworks like cakePHP or django, or simply ...

specifying the input value pattern restriction in HTML5

Struggling to set a minimum and maximum value for an input text box. Despite my efforts, I haven't been able to make it work. How can I resolve this issue? The current pattern restricts values up to 10 but I need to allow values from 100 to 100000. Wh ...

Modifying the state object in ReactJS: A step-by-step guide on updating values

Below my query and explanation, you will find all the code. I am currently attempting to update the state in a grandparent class. This is necessary due to file-related reasons, and I am using Material-UI for text boxes. Additionally, I am implementing Red ...

Tips for aligning a dropdown button with the other elements in your navbar

I followed the code outline from a tutorial on We3schools, but I'm having an issue with the button not aligning correctly with the navbar. https://i.sstatic.net/fSRIT.png I attempted to adjust the code for proper alignment before publishing, but was ...

Unable to assign a className to a personalized React component - troubleshooting needed!

I have a component that relies on another component. I am trying to pass CSS positioning from the outer component to the inner one by using the following code: import OptionsMenu from './OptionsMenu' import { withStyles } from 'material-ui/ ...

What is the best way to align text above a wrapper box?

After watching a tutorial on YouTube about creating a simple login form, I decided to customize it with some personal touches. I wanted to include a "Welcome" text above the login form, but when using h1, the text appeared next to the box rather than abov ...

Floating unordered list items in a gallery display

I am dealing with a Gallery view where I am using the UL LI elements with float left to create a gallery-like layout with multiple lines based on the content. However, I am encountering an issue where after the first line, the layout seems to malfunction i ...

Extract a specific pattern from a string using Javascript

Currently, I am attempting to extract a specific string from a tag in javascript using the following code: document.querySelector('.title h2').textContent However, when I execute this code, I am getting a result that includes unnecessary double ...

Issue with Bootstrap v3.3.7 panel not collapsing as expected following height adjustment

Utilizing bootstrap 3.3.7 panels, I encountered an issue when trying to slide up the panel using the icon. The panel would not hide properly once the panel height was set, resulting in only the panel content body sliding up. Here is an example: $(&apo ...

Implementing Dynamic Script Injection in Angular Controllers for Enhanced HTML Functionality

I'm a total beginner when it comes to Angular and frontend development, so please bear with me if my question seems basic: In my controller, I have the following code where I am populating the $window.user data that is being used in the script [2] ad ...

Dynamically size and position elements to fit perfectly within the container

I am currently facing a challenge with my absolutely positioned elements that have different position.top and height values generated from the database. The main goal is to resolve collisions between these elements by shifting them to the right while adju ...

Move the scroll bar outside of the div and set it to automatically overflow

My issue involves a small div with the CSS property overflow:auto;. However, when the scroll bar appears, it covers up a significant portion of the div. One possible solution is to use overflow:scroll;, but this can result in an unsightly faded scroll bar ...