Header 1 escaping from its designated container

Encountering a problem with a h1 element not remaining within its parent div. Strangely, it remains contained until the font size of the h1 surpasses a certain threshold, causing it to spill out of the div and overlap with other content. Here is the snippet of my HTML and CSS code. I also utilize the Eric Meyer reset sheet and a custom font style sheet:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"  "http://www.w3.org/TR/html4/strict.dtd">

    <title>Lawrence Chabela - User Interface Design</title>

    <!-- CSS --> 
    <link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" charset="utf-8"> 
    <link rel="stylesheet" href="css/font.css" type="text/css" media="screen" charset="utf-8"> 
    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8"> 

    <!--[if IE 6]>
        <link rel="stylesheet" href="/css/ie6.css" type="text/css" media="screen" charset="utf-8">
    <![ endif]--> 
    <!--[if IE 7]>
            <link rel="stylesheet" href="/css/ie7.css" type="text/css" media="screen" charset="utf-8">
    <![ endif]--> 

    <link rel="shortcut icon" href="/favicon.ico"> 
    <link rel="apple-touch-icon" href="/apple-touch-icon.png"> 
</head>
<body>
    <div class="siteWrap">
        <div class="nav clearfix">
            <ul class="clearfix">
                <li>
                    Home<span>is where I work.</span>
                </li>
                <li>
                    About<span>this dude.</span>
                </li>
                <li>
                    Folio<span>take a peek.</span>
                </li>
                <li>
                    News<span>whats going on.</span>
                </li>
                <li>
                    Contact<span>got some work?</span>
                </li>
            </ul>
        </div>
        <div class="slogan">
    <h1>Why Is this h1 not staying in here</h1>
    </div>
</body>

/*Clearing Floats*/
html body * span.clear, html body * div.clear, html body * li.clear, html body * dd.clear { background: none; border: 0; clear: both; display: block; float: none; font-size: 0; list-style: none; margin: 0; padding: 0; overflow: hidden; visibility: hidden; width: 0; height: 0; }
.clearfix:after { clear: both;content: '.';display: block;visibility: hidden;height: 0; }
.clearfix { display: inline-block; }
* html .clearfix { height: 1%; }
.clearfix { display: block; }

/*Base*/
body { font: .875em/1.295em AurulentSansRegular,Impact,Arial,Geneva,Helvetica,sans-serif; background: #f2f2f2 url('../img/top_dot.png') no-repeat scroll center 9px; border-top: 9px solid #000; }
    .siteWrap { width: 1024px; margin: 0 auto; }
        .nav { width: 67%; margin: 50px auto 0; padding: 0 0 15px; border-bottom: 1px solid #BFBFBF; }
            .nav ul { margin: 0 auto; width: 94%;   }
            .nav li { float: left; padding: 0 68px 0 0; font-size: 1em; text-transform: uppercase; }
                .nav li:last-child { padding: 0; }
                .nav li span { padding: 2px 0 0; clear: both; display: block; color: #868686; font-size: .875em; text-transform: none; }
        .slogan { text-transform: uppercase; }

Answer №1

The <div class="slogan"> tag is missing its closing tag.

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

Adding flair to a object's value in React JS

In my React JS file, I have a map function that I am using to populate a select dropdown with options. const options = response.map(k => ({ value: k.id, label: k.description ? `${k.name} - ${k.description}` : k.name, })); I ...

The Heading I am trying to navigate to is partially obscured by the fixed topbar

I admit my code is quite messy, but this is my first project and I'm still figuring out how to properly structure it. I attempted to use margin with h2::before in CSS, and it sort of worked, but it caused other issues with the text layout. I've h ...

Unoccupied whitespace created by using Bootstrap

I'm experiencing a challenge with the code below in terms of large spaces being left when columns are collapsed. Is there a way to eliminate these spaces? body { font-family: sans-serif; max-width: 100%; overflow-x: hidden; } .poster { heig ...

Tips for positioning an inline label and input field in an Angular application using CSS and HTML: How to align the label to the left and the input

I'm currently developing an Angular form with multiple label-input field combinations. I have managed to style the labels and input fields with inline block so that they appear on the same row. However, I am facing a challenge in aligning the label to ...

Creating nested tabs with Bootstrap: A step-by-step guide on adding tabs within tabs

I am encountering a challenge with nested tabs. I am utilizing Bootstrap and not using custom CSS. Any assistance would be greatly appreciated. <div class="container-fluid"> <!-- Tabs --> <ul class="nav nav-t ...

Boost website performance with Google Page Speed by optimizing CSS above the fold using this innovative Bootstrap Template Plugin

My Google PageSpeed Insights report suggests that I should place my CSS below the fold. However, Bootstrap is being used as my templating plugin. I am contemplating printing bootstrap.min.css inline on my homepage, but I hesitate because it may lead to i ...

The Bootstrap menu does not seem to be affecting the positioning of the body text

I recently came across an issue with a Bootstrap-based site I'm working on. When I click the hamburger menu on mobile view, the main content doesn't shift down to accommodate it, causing an overlap. Not ideal :-( Here's my Demo: https://js ...

Server issues causing Laravel 6 CSS and JS to fail loading

I compressed my project folder and uploaded it to the Document Root for the subdomain. All of my CSS and JS files are located inside the Public folder. The project works perfectly fine on XAMPP, but when I transfer it to my shared hosting, the CSS and JS f ...

Overlay jQuery Accordion

I am currently working on an accordion to display old blog posts. However, when using a tab, the section below either moves or jumps around. I want the tab to lay over the rows below it without affecting their position. I have tried various solutions in ...

CSS: Flexible Sidebar - Dynamic Content

Can someone provide clarification on this visual illustration? To sum it up, I am looking to create a sidebar div that adjusts its width based on the content within, alongside a mainContent section that fills the remaining window width. ...

Tips for obtaining the sources of every image on a webpage and consolidating them in a single section

My goal is to preload all images on a webpage into a single division before the page loads. For example, if there are 5 images on the page (eg1.png, eg2.jpg, eg3.bmp, eg4.jpg, eg5.png), I want them to be contained within a div with the id 'pre'. ...

Picture transports during change

Is there a way to increase the size of images in a List without causing other images to move when hovered? Currently, when an image is hovered, it increases in size but causes the surrounding images to shift to a new line and I would like to avoid this beh ...

"Enhancing User Interaction with jQuery Hover State Dropdown Menus

Here's my issue: I've created a drop-down menu and I want the text color to change when hovering over the menu. Additionally, I'd like the hover state to remain active when hovering over the submenu. Currently, I'm using this code: $( ...

The @viewport tag is malfunctioning on iOS devices when used in CSS

Due to certain limitations, I am unable to make any changes to the HTML code of the project I am currently working on. As a result, I am unable to include the following attribute: <meta name="viewport" content="width=device-width, initial-scale=1.0"> ...

Is there a way to specify the dimensions of the canvas in my image editing software based on the user-input

Here is the code and link for my unique image editor. I would like to allow users to enter the desired width and height of the selection area. For example, if a user enters a width of 300 and height of 200, the selection size will adjust accordingly. Addit ...

What is the most effective way to transfer information from one page to another in a PhoneGap application?

I attempted to transfer data from one HTML page to another using two different methods: function reply_click(clicked_id) { window.location = "newsList.html?Title="+clicked_id; } And I also tried: function reply_click(clicked_id) { window.l ...

Incorporating a triangular arrow at the center of the bottom of the navigation item/menu

How can I position a white triangle at the bottom of my horizontal menus when they are hovered/activated? The triangle should be aligned to the right-most corner of the menu, not the center. Adding CSS "left: 50%;" positions it in the center of the menu ba ...

Crafting an interactive SVG element that maintains its clickability without interfering with mouseLeave events

Trying to Achieve: Changing color and displaying SVG when hovering over a row Clicking the SVG triggers a function, including external functions (not limited to ones defined inside script tags) Returning the row to its original form when mouse leaves Cha ...

The bottom section includes all the information

Hey there, I'm in the process of creating my personal website, but I'm having trouble with the footer covering two buttons. It's a strange issue that only seems to occur on my laptop; when I switch to my external monitor, the buttons are dis ...

Align these buttons in a vertical position

I'm trying to place a Twitter button and a LinkedIn profile button next to each other, using the recommended embed code from each service. However, they are not aligning vertically as I would like. I want both buttons to be centered vertically within ...