I am having difficulty combining 2 HTML pages without the output becoming distorted

Having encountered issues when combining two HTML pages, one for a navbar and the other for a contact form in my Django project. The resultant single page appears distorted as shown in the image below. I attempted to use sections but it does not seem to resolve the problem:/

Navbar HTML:

<nav>
    <div class="logo">
        <a class="h4" href="{% url 'home' %}">Name</a>
    </div>
    <ul class="nav-links">
        <li><a href="{% url 'about' %}">About</a></li>
        <li><a href="#">Name 2</a></li>
        <li><a href="{% url 'contact' %}">Contact</a></li>
    </ul>
</nav>

Contact Page HTML:

<div class="container">
    <form class="shake" action="{% url 'contact' %}" role="form" method="post" id="contactForm"
          name="contact-form" data-toggle="validator">
        {% csrf_token %}
        <h2>Let me know what you felt.</h2>
        <div class="row100">
            // Remaining contact form code here...
        </div>
    </form>
</div>

Combined HTML Code:

// Combined HTML code will be included here...

CSS of Navbar:

*{
    // CSS for Navbar
}
// Rest of the CSS code for Navbar

CSS of Contact Page:

*{
    // CSS for Contact Page
}
// Rest of the CSS code for Contact Page

Answer №1

If you're experiencing alignment issues, it may be due to the display:flex property in the body CSS. Try changing it to block or another value, and it should help with aligning elements as desired:

body {
    display: block;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #051115;
    font-family: 'Poppins', sans-serif;
}

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

A guide on how to modify a CSS property to set the display to none upon clicking a radio button

Currently, I am attempting to display two input boxes in a table when I select specific radio buttons and hide them if I choose another option. The code I have does work but has a minor issue, function disappear() { document.getElementsByClassName("ta ...

The arrow icon that I included in my bootstrap project seems to have disappeared from my view

While trying to enhance my footer, I attempted to include an arrow-up-circle icon. However, after adding the code, the icon doesn't appear. Here is the html snippet I used: <html> <head> <link href="https://cd ...

What is the best way to retrieve the context data within the template?

context_object_name = 'item_list' template_name = 'krop_view.html' model = Item def get_queryset(self): user = self.request.user krop = get_object_or_404(Krop, owner=user) return Item.objects.filte ...

Accessing a specific child div within a parent div using JavaScript and CSS

Struggling to target and modify the style of the child div within id="videoContainer" <div id="videoContainer"> <div style="width: 640px; height: 360px"> <------- this is the target <video src ...

Showing the outcome of a PHP function within a div container

While working on my WordPress site, I've implemented user registration and login functionality. However, I'm not a fan of the default 'admin bar' and would rather create a custom navigation bar. I am looking for a way to dynamically loa ...

Ways to evenly distribute divs into rows

Greetings if this question has already been inquired about, but my search turned up nothing quite like it. My current setup is as follows: .main{ display: inline-flex; flex-direction: row; } <div class = "main"> <div class="sub-div ...

When designing responsive websites in Bootstrap 4, what is the preferred choice between using the class "container" or "container-fluid"?

When creating responsive designs, which is more effective to use - the .container class or the .container-fluid class? ...

The HTML and CSS layout is not displaying correctly as planned

I am currently working on a responsive webpage design project. Here is what I have been experimenting with: jsfiddle <div id="container"> <div id="one">#one</div> <div id="two">#two</div> <div id="three">#t ...

Tips for creating a CSS triangle background on a div without relying on borders or images

I have experience creating triangles using CSS borders and images, but this time I want to achieve it using background color. Here is the image of the desired outcome: https://i.stack.imgur.com/qP3yt.jpg If anyone can assist me with this, it would be gre ...

What is the best way to place text inside a TH element without any text within the TH's child nodes?

When parsing a website and obtaining the instance of a TH element, I use innerText to extract the text I need. However, sometimes there is additional unnecessary text that I want to exclude. Is there a way to only retrieve the top-level text? var th_elem ...

What is the process for setting up a vertical carousel in Bootstrap 5 with a stationary previous image?

Looking for assistance with my vertical carousel project. Is there a way to create a vertical carousel in bootstrap 5 with the previous image fixed? I found a slider on this website: zara.com/jp/en/ I want to maintain the previous image in a fixed posit ...

Modifying the Vue page background directly from a page: a step-by-step guide

UPDATE: I recently discovered that I need to modify the body background-color, but I am unsure of how to accomplish this from within the style of this page based on the wrapper's class. The class is determined by the data values. I aim to change the ...

Implementing a sorting mechanism for ajax data retrieval

Currently, I am using the code below to save HTML created with jQuery in a database and retrieve it later: $('div[read]').each(function(){ var kelas = $(this).attr('kelas'); $.post('admin.php',{kelas:kelas,id:id},func ...

Adjusting the size of all elements on a webpage

Upon completing my project, I noticed that my localhost:3000 is zoomed in at 125%, causing it to appear less than ideal at 100% zoom. Is there a way to adjust the zoom/scale of my website to match how it appeared on my localhost environment? I came across ...

Removing a row from an HTML table using JavaScript

I have a piece of JavaScript code that is responsible for managing an HTML table. One of the functionalities it needs to support is deleting a row from the table. Currently, I am using the following snippet of code to achieve row deletion: var rowToDele ...

Creating an inverted curve or border-radius for a div element is a design technique that can add

I've been tackling a project that requires me to style the border of a div in an inverted manner. To achieve this, I'm limited to using only CSS and JS without any plugins. I've searched through various online resources and similar questions ...

Widgets do not have a form instance displayed

views.py def save_report(request): form = ReporterRegisterForm() profileform = ProfilecontactForm() user = request.user userprofile = UserProfile.objects.get(user=user) if request.method == 'POST': id = reques ...

input access is granted through the post method using an integer as the name parameter

Suppose there is a dynamic form with multiple fields generated with integer names based on the iteration that creates them. The goal is to retrieve their values using either post or get method (though focusing on post here). Below is the code for generati ...

showing text style that is only specified on the server, not by the client

I am in the process of creating a new website that offers SMS services through clickatell. This website includes various font families that may not be defined on the client's computer. For instance, if the site is accessed from a different computer, t ...

The overflowing pop-up container

When I trigger a popup that dynamically generates a fixed background with a centered dialog, it works well. However, on smaller monitors like laptops, tablets, and phones, the content can overflow beyond the visible area due to its fixed container, making ...