The CSS styling applied on the HTML page is producing unexpected outcomes

I'm encountering some layout issues with my HTML page. The titles are displaying in two columns as intended, but there seems to be inadequate spacing between them. Additionally, the submit button is not properly positioned below the form.

Below is a snippet of the HTML code:

<!DOCTYPE html>
 <html>

 <head>
 <title>Subscription Management System</title>

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

</head>

<body>

<div id="logo">

    <div class="left_part">
        <a href="index.php"><img src="../images/demo.gif"></a>
    </div>

   <div class="right_part"> 
        <div class="bigHead">Comic Subscription Management</div>
        <div class="littleNavi">
            <a href="../index.php?logout=1">LOG-OUT</a> 
        </div>
    </div>
<nav>
    <ul>
       <!-- more navigation items here -->
    </ul>
</nav></div>

<div id="contents">
    <h2>Add New Titles</h2>


                    <form action="" method="post">
                    <ul>
                       <!-- input fields for adding new titles -->
                        <br><input type="submit" value="Add New Title(s)" name ="submit" id="submit">
                </form>


</div>

<div id="footer">
    <p>Administrator Control Panel </p>
</div>

</body>

</html>

The issue might be related to the CSS implementation. Here is the relevant CSS code that defines the layout:

/* Two Column Layout for Updates */
.col1    {
    position: relative;
    float: left;
    width: 250px;
}

.col2    {
    float: right;
    position: relative;
    width: 550px;
}

input[type="submit"]    {
    background-color: black;
    border: 2px solid rgb(255, 255, 255);
    border-radius: 7px;
    box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.03);
    -webkit-box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.03);
    color: rgb(255, 255, 255);
    cursor: pointer;
    font-size: 13pt;
    font-weight: bold;
    margin: 10px 0;
    outline: none;
    padding: 5px 15px;
}

#contents {
    background:#fff;
    width:900px;
    padding:20px;
    padding-top:5px;
}
<!-- more CSS styles -->

An image illustrating the current display situation is shown above. Let me know if you need further assistance or clarification on this matter.

Answer №1

Relocate .col1 and .col2 from within the final </ul> tag

This HTML structure is flawed and could be contributing to the problem

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

Implementing pagination for a scrolling tab group with a flexible number of buttons

I need to implement a pagination feature in my scroll function where users can select from a list of tabs/buttons and it will automatically scroll to the corresponding div/tab. Currently, I have a while statement that generates songs from my database, with ...

vertically centering a div specifically on laptops

What is the best way to vertically center a div on lap-tops? (...) body {padding: 4% 16%;} body {top:0px; left:0px; bottom:0px; right:0px;} body {border: 12px solid darkred; border-style: double;} body {background-color: #FAFCB4;} p {font-size: 80%; text- ...

Dart and external CSS and JS libraries and tools

As I prepare to dive into developing my very first web application, one technology that has caught my eye is Google Dart. The idea of using a new, innovative approach to web development excites me, and I am seriously considering utilizing it for my project ...

Sending input values to controller action parameters in CakePHP

I am working on an HTML form in which I need the URL output to be structured as follows: "example.com/mycontroller/action/mike/apple" Upon submitting the form using "post" method, the form values are not visible and can only be accessed through "_POST" ...

What are some ways to ensure an ion-item is adaptable to various screen sizes?

My goal is to create a responsive ion-item. Instead of the initial layout shown here: (https://i.sstatic.net/9yROA.png) I want it to look more like this: (https://i.sstatic.net/eUkgE.png) You'll notice that some information gets cut off in the fir ...

Comparing currency to double in handlebars: a comprehensive guide

I've been working with Handlebars.js and encountered an issue when trying to compare product prices above $35. The problem arises from the fact that prices are stored as "$54.99" which gets treated as 0 when compared to a number. How can I effectively ...

Including code that is tailored specifically for the Internet Explorer browser on Windows Phone devices

While testing the Google Maps API on different browsers and devices, I encountered issues with Windows Phone. It turns out that Google Maps is not supported on Windows Phones, resulting in errors. How can I set it up so that instead of displaying the map ...

Methods for animating .jpg images using CSS

I'm currently working on animating an image, specifically moving it from left to right and back. However, before I dive into implementing CSS animation keyframes, I noticed that I am having trouble getting the HTML element to follow the CSS styles I a ...

Changing icons using JQuery when clicking 'show more' or 'show less' buttons

I am currently utilizing https://github.com/jasonujmaalvis/show-more to display and hide text content on a mobile device. My goal is to switch between images for show more and show less: Here's what I have so far: Jquery: Source File: ; (function ...

Enhance Your List with Icon Decorations

Is it feasible to utilize a sprite image in place of the default bullet for an ul list? Is this achievable? ...

What is the reason for the additional line being generated?

Can anyone explain why there is an extra line being produced here? I came across another question where it was mentioned that this issue is not due to CSS but rather caused by HTML. Why is that? This is completely new to me, and I'm curious as to wh ...

Exploring HTML list with padding to determine optimal wrapping configurations

Having an issue with a section of links. The blocks for the links are lining up next to each other when the viewport is wide, but I want one block labeled MOBOT to drop down onto a new line in a small responsive space. The goal is for the MOBOT square to ...

Detect click outside in JavaScript for closing

While this topic has been discussed before, each issue presents its own unique challenges. Despite trying various solutions and examples for making the submenu close when clicking outside of it, I have not had any success. Is there a way to make the uslug ...

What is the method for automatically scrolling down while hovering over an image?

How can I make it so that when an image is hovered over, it automatically scrolls to the bottom of the image? I have a couple of questions: How can I ensure the image scrolls to the end when hovered over? Currently, when I hover over the image, it doe ...

designing the border at the bottom of the existing menu selection

I am trying to enhance the look of my current-menu-item div by adding a border at the bottom. It seems simple enough to achieve this by simply including the border in the div. However, I'm facing an issue with the width and position of the border. Ide ...

Can a rotationX be applied within an existing rotationX?

I have a collection of 3 divs labeled a, b and c inside a container. The container is rotatedX by 90 degrees, giving the appearance that it is "lying on its back". Now, I am trying to rotate the a, b, and c divs so they appear to be "standing up" again. Ho ...

Is it possible to modify the HTML element within a Blazor application simply by clicking a button?

Is it possible to dynamically change the type of an HTML element in a Blazor application by clicking a button? For example, turning normal text into input fields. In my table, there is a button in the first column for each entry. I want to make it so that ...

Adjusting the spacing between a pair of radio buttons within the identical group

Is there a way to adjust the spacing between two horizontal radio buttons? The buttons are part of the same group, and I want to shift the right button ("Clear Selection") further to the right so it aligns with the buttons in another group below. ...

Adding a popover to a cell in a table: A step-by-step guide

Currently, I am attempting to display data in a single cell when hovered over using a popover. The problem I'm facing is that adding the data-toggle inside the td tag has no effect. Each cell is structured like this: <td style="padding: 0px; back ...