What is the reason behind the decision to have the writable section of the form begin in the center?

Hey everyone, I recently attempted to create a form for the first time but ran into an issue with the writable area not starting at the beginning. I suspect it has something to do with the padding, but being new to this environment, I'm having trouble figuring it out. I know the solution may be obvious, but any help would be greatly appreciated. Below is the relevant code snippet from the website. Thank you!

label{
    font-size: 30px;
    font-family: 'Raleway', sans-serif;
    margin-left: -390px;
    margin-right: 100px;
    display: block;
    margin-top: 70px;
}
input[type=text],
input[type=email],
textarea{
    padding: 12px 200px;
    box-sizing: border-box;
    background-color: #222326;
    border: none;
    border-bottom: 1px solid #D9D9D9;
    text-align: left;
}
.msg-label{
    margin-left: -345px;
}

.email-label{
    margin-left: -398px;
}

textarea{
    margin-bottom: 100px;
    padding-right: 300px 220px;
    overflow:hidden;
    margin-right: -50px;
}
<div id="contact-me">
            <div id="center">
                <h2>CONTACT ME</h2>
            </div>

            <div id="center">
                <form action="action-page.php">
                    <label for="name" class="name-label">Name</label>
                    <input type="text" id="name" name="full-name" >

                    <label for="email" class="email-label">Email</label>
                    <input type="email" id="email" name="email">

                    <label for="message" class="msg-label">Message</label>
                    <textarea id="msg" name="message"></textarea>

                    <input type="submit" value="Submit">
                </form>
            </div>
        </div>

https://i.sstatic.net/4WRd9.jpg

Answer №1

input[type=text],
input[type=email],
textarea{
    padding: 12px 200px;
    box-sizing: border-box;
    background-color: #222326;
    border: none;
    border-bottom: 1px solid #D9D9D9;
    text-align: left;
}

The addition of padding in the code snippet above is crucial. By including padding, you create space within the element which results in pushing everything inside.

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

Tips for maintaining consistent webpage layout across various screen sizes

Although this method may seem outdated, I have always been intrigued by how it was accomplished. In the past, before websites became responsive, pages would simply shrink down to fit on mobile devices without adjusting their appearance. How was this achie ...

What is the method for inserting a vertical line between two div elements?

Can you show me how to add a vertical line between two div elements? .flex-container { display: -webkit-flex; margin: 0 auto; text-align: center; } .flex-container .column { width: 320px; text-align: center; } .vr { border-left: 2px dott ...

Is it possible to add padding to an HTML element without affecting its overall dimensions?

Is it possible to apply padding to a div without increasing its size? <div id="someDiv"> someContent </div> #someDiv{ padding: 1em; } One potential solution is to add another nested div within #someDiv and apply margin to that, rathe ...

The alignment of flexNav.js submenus is not consistent

I'm looking to implement the Flex Navigation plugin for a responsive menu. Although the plugin functions properly, I'm encountering an issue with the alignment of submenus under their respective parent items. You can view the problematic behavi ...

Tips for using a unique format for a single field in jqGrid

My JQGRID site has table configuration set up like this: configid config rule 1. Application_name 'MyApps' 2. Max number 1,000,00 3. Application End 12/31/2012 Some cells are for numbers and others for dates. If a user wants to edit a date ce ...

Is there a way to simultaneously apply the :active pseudoclass to multiple elements?

<div id="a">A</div> <div id="b">B</div> <div id="c">C</div> <style> #a, #b, #c { height: 100px; width: 100px; background-color:red; font-size: 100px; margin-bottom: 20px; } ...

Guide to adding a Json file in a PHP file with PHP

I have a PHP file with an embedded JSON file, and I want to update the JSON file with new information from a form. The form looks like this: <form action="process.php" method="POST"> First name:<br> <input type="text" name="firstName"> ...

Is there a more efficient method to halt a jQuery animation plugin? Surely, there must be a more effective solution

After feeling under the weather for the past week and feeling incredibly bored, I decided to delve into the world of creating jQuery plugins. In just half an hour, I managed to put together a plugin that mimics the "wiggle" effect when pressing and holding ...

Microsoft Edge browser incorrectly calculates range.endOffset value

This particular problem is specific to the Microsoft Edge browser. I am attempting to apply a CSS style to a selected word using Range API's, but I am encountering an issue with the range.endOffset functionality in Edge. Below is the code snippet I am ...

Unable to reach the top of an absolute or centered div when it exceeds the height of the viewport

I have successfully created a centered div with position: absolute/top: 50%/left: 50%/transform: translate(-50%, -50%) css properties on my website. However, I am facing an issue where the height of the div exceeds the viewport height and scrolling to the ...

Splitting a CSS hierarchical list into horizontally aligned levels of hierarchy

I am trying to horizontally lay out an ordered list with multiple top level nodes while preserving the vertical layout of child nodes. For example, consider a basic list structure like this: <ol> <li>Top 1 <li>Sub 1</li ...

What is the process for assigning an ID to an object by clicking on an adjacent link in Django?

Trying to set an identifier for a CSV file's name so that clicking on a link next to it will lead to viewing the file itself on another webpage. Encountering the error message 'QueryDict' object has no attribute 'objects' Please ...

Creating a multi-column layout with HTML and CSS

I'm currently exploring the most effective method to design this concept: https://i.stack.imgur.com/SOQp4.png The black square symbolizes small icons, accompanied by a heading and paragraph for each specific section. The icons need to align with the ...

What is causing my mobile version not to resize and adjust to fit the screen properly?

Currently utilizing Bootstrap 4 along with the viewport meta tag, %meta{:content => "width=device-width, initial-scale=1, shrink-to-fit=no", :name => "viewport"}/ Even after hiding all images with .hidden-xs-up, the display on Chrome mobile appear ...

Saving Information from an HTML Form Input?

I am currently working on a form that collects information about employees including their name, age, position, and details. When the "Add Record" button is pressed, this information should be added to a designated div. Although I have set up the Object C ...

Add a div element only if there is a background image present

I am facing a situation where I need to display an image as the background of a div only if it is available. If the image is not present, I do not want the div to be visible at all. I am working with django templates and here is my current approach: {% if ...

Is it possible to modify the text alignment of a div based on the dropdown selection

I'm having trouble getting the alignment to work with my dropdown list that styles the font of a div. It's frustrating because I usually find solutions easily on Google, but this time the align feature is really bugging me. <SCRIPT LANGUAGE=" ...

Utilizing media queries to customize the appearance of a jQuery accordion widget

Hello, I'm struggling with implementing a jQuery accordion for mobile platforms that destroys itself on larger screens. While my code is mostly working, I've encountered two issues: The accordion only gets destroyed when the window is resized ...

What are the steps for submitting a form by clicking on text?

Whenever I try to submit a form by clicking on span id="ToolBarDownload", the form id="myformID" doesn't seem to get submitted. Can someone help me figure out what's wrong with my code? Any suggestions are greatly appreciated! Thanks! Also, just ...

Switch up the appearance of a button by altering its image depending on the value it holds

There are two buttons generated dynamically (not within my control) that I would like to customize with different images. Since I can't actually change the button code, I believe I will need to utilize CSS to achieve this based on the CSS values. The ...