The design of the website is all over the place

I am encountering challenges in creating distinct containers for the header, body, and other sections of my website. The layout is not turning out as planned, and I can't pinpoint where my code is going wrong. Any advice or suggestions on how to resolve this issue would be immensely appreciated.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>San Francisco | Downtown Parking Guide</title>

    <link rel="stylesheet" type="text/css" href="css/style.css">

    </head>

    <body>
    <!-- Header -->
        <div class="container">
            <nav class="cf">
                <ul>
                    <li><a href="index.html" class="logo" title="Home Page"></a></li>
                    <li><a href="index.html" title="Home Page" class="">Home</a></li>
                    <li><a class="bar">|</a></li>
                    <li><a href="#" title="Downtown Parking List">Downtown Parking List</a></li>
                </ul>
            </nav>
        </div>
    <!-- End Header -->
    <!-- Begin San Francisco Image -->
        <div class="container">

            <div id="sfpic">
                <h1>WELCOME TO THE</h1>
                    <div class="break1"></div>
                <h2>SAN FRANCISCO PARKING GUIDE</h2>
            </div>
    <!-- End San Francisco Image -->
    <!-- Begin Ad  -->      
                <div class="ad">
                    <h1>SPECIAL DEALS</h1>
                        <div class="break1"></div>
                            <h2>RESERVE</h2>
                        <h3>SAN

Francisco is a cultural, commerical, and financial center in Northern California and the only consolidated city in Northern California. San Francisco is known as a popular tourist destination due to it's cool summers, fog, steep hills, eclectic mix of architecture and landmarks including the Golden Gate Bridge, cable cars, Alcatraz, and Chinatown.</h3>
                    <button type="button" class="adbutton">RESERVE NOW</button>
                </div>
        </div>
    <!-- End Ad -->
    <!-- Begin Text Below Picture & Add -->
        <div class="container">
            <div class="break1"></div>
                <p>San Francisco is a cultural, commercial, and financial hub located in Northern California. Known for its unique blend of architecture, landmarks and attractions such as the Golden Gate Bridge, cable cars, Alcatraz, and Chinatown, the city attracts visitors from around the world due to its pleasant weather and scenic views.</p>

        </div>
    </body>
    </html>

CSS:

@charset "UTF-8";
/* CSS Document */
html {
    background: #ffffff; }
body {
    font-family: "Helvetica Neue", Times, serif;
    width: 75%;
    margin: 0 auto; }

/*--- Begin Header Section ---*/

.logo {
    display: block;
    padding: 0; 
    margin: 30px 330px 0 20px;
    background-image: url(../Images/DPG-Logo.jpg) ;
    width: 406px;
    height: 28px;
}
/*micro-clearfix by Nicolas Gallagher http://nicolasgallagher.com/micro-clearfix-hack/*/
/* For modern browsers */
.cf:before,
.cf:after {
    content:"";
    display:table; }
.cf:after {
    clear:both; }
/* For IE 6/7 (trigger hasLayout) */
.cf {
    zoom:1; }

/*horizontal menu styles*/  
nav {
    background: #FFF }

ul, li {
    margin : 0;
    padding: 0;
    list-style: none;
    float: left; 
}

ul {
    background: none;
    height: none; 
    margin: 0;
    padding: 0;
}

li {
    display: inline-block; 
}
li a {
    display: block;
    line-height: none;
    padding: 0;
    color: #8b9093;
    text-decoration: none;
    margin: 36px 0 0 30px;
}
li a:hover {
    color: #FE5A1D;
    }

li a:active {
    color: #d74c18;
}

.bar {
    -moz-user-select: -moz-none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
}
a.bar:hover{
    color: #8b9093;
}

...

.adbutton:hover {
    background-image: url(../Images/button-reserve-hover.jpg);  
}

.adbutton:active {
    background-image: url(../Images/button-reserve-click.jpg)   
}
/*--- End Ad Section ---*/

http://jsfiddle.net/44z5a055/

Answer №2

Give the basic Bootstrap layout a go – it's the solution you're looking for.

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

Creating a color icon for StackExchange using HTML

I am currently working on building my personal website. I am looking to include a link to my Stack Exchange profile on my site using the Stack Exchange icon. However, the icons available in Font Awesome are grayscale and not colored like other icons such a ...

Modify the color of the select element when it is in an open state

If you're new to Material UI, I have a select element that I would like to change the color of. When 'None' is selected, I want the background color of the input field above it to match the 'None' section. Then, when the dropdown m ...

Incorporating a File Attachment within a JSON Structure

Can a file attachment be included in a JSON Object? I am working on an HTML Form with text field inputs and a file attachment, and I would like to send all this form data (including the file attachment) as a JSON Object to the server. Are there any specif ...

Modifying .vue files within Laravel seems to unexpectedly impact unrelated CSS styles

I've been working on a Laravel project that involves building Vue components. Strangely, every time I update a .vue file and add it for a commit, modifications are also made to the app.css and app.js files. These changes seem to be undoing a particula ...

What steps can I take to ensure the browser only shows the page once it has completely loaded?

I find it frustrating when webpages load slowly and you can see the process happening. In my opinion, it would be more satisfying to wait until everything is fully loaded - scripts, images, and all - before displaying the page. This brings up two questio ...

Can dynamic CSS imports be unloaded in a React application?

I am facing an issue with loading two files using react.lazy and suspense: import React, { Suspense, lazy } from "react"; import { Route, Redirect } from 'react-router-dom'; const MainLayout = lazy(() => import('Components/Layout/MainL ...

Display HTML content generated by JavaScript in the page source

Can the HTML elements I've added through JavaScript and jQuery codes be displayed in the page source (ctrl+U)? ...

The HTML element failed to be inserted

Currently, I am involved in a project based on .NET Core for my organization. This project entails loading work orders from our SQL database using Entity Framework and then filtering them to display as markers on a map via the Google Maps API for our insta ...

Positioning CSS for a Responsive Button

Currently, I am working on making my modal responsive. However, I am encountering an issue with the positioning of the "SAVE" button. The button is not staying in the desired position but instead disappears. Below is the snippet of my HTML and CSS: .dele ...

Tips for arranging divs in a row to switch to stacking when the screen size decreases

Sorry if this question seems repetitive, but as a newbie, deciphering posts from others has been overwhelming! I have two divs placed side by side within a wrapper, but I need them to stack on top of each other when viewed on a tablet or phone. Below is t ...

Tips for ensuring text remains within a div container and wraps to the next line when reaching the edge

Currently, I am working on a flash card application using Angular. Users can input text in a text box, and the text will be displayed on a flash card below it. However, I have encountered an issue where if the user types a lot of text, it overflows and mov ...

HTML SVG text elements styled with varying background shades

Looking to enhance an image by adding multiple labels with distinct background colors: <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <svg version="1. ...

Is it possible to set the input form to be read-only?

I need to create a "read-only" version of all my forms which contain multiple <input type="text"> fields. Instead of recoding each field individually, I'm looking for a more efficient solution. A suggestion was made to use the following: <xs ...

Using AngularJS to create a form and showcase JSON information

My code is below: PizzaStore.html: <!DOCTYPE html> <html ng-app="PizzaApp"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Delicious pizza for all!</title> ...

I am looking to create a button with a transparent border within a white background container

I am trying to achieve a button border effect similar to the one in the image provided. I want to create a div with a white background color, and inside that div, I need to add a button with a 15px margin or padding while making it transparent. <div cl ...

Inconsistent expansion panel widths observed in Chrome when using React material-ui

I've encountered an issue in Chrome where the width adjusts to fit its content instead of taking up the full width of the container. However, this problem does not occur on Firefox. https://i.stack.imgur.com/HyWGU.png When I click on the expand icon ...

Struggling to incorporate a logo into the navigation bar for an HTML project

I'm a beginner in the world of HTML and CSS, trying my hand at creating a homepage. While I managed to add a logo to the Navigation bar, it seems to have messed up the link for the HOME page. Could this be due to not wrapping the logo in a div or imp ...

Triggering animation with jQuery and CSS

I am working on a one-page site and I want to make a parallelogram disappear when a button is clicked for the next part. Currently, it is disappearing from right to left but I would like to change the direction to left to right. Additionally, I have a simi ...

JavaScript class name modifications are not functioning as expected

Testing a sprite sheet on a small web page I created. The code for each sprite in sprites.css is structured like this... .a320_0 { top: 0px; left: 0px; width: 60px; height: 64px; background: url("images/sprites.png") no-repeat -787 ...

Issue with fixed positioning not behaving as intended while scrolling downwards

I am facing an issue with an element that has the .it class and I want to keep it fixed on the screen using the position: fixed CSS property. However, as I scroll down the page, the element moves along with the screen instead of staying in place. Below is ...