The content is placed within the div element

Code:

.input-wide {
  width: 100%;
  padding: 10px;
  margin: 15px;
  box-sizing: border-box;
}

.container-wide {
  min-height: 80px;
  margin: 20px;
  background-color: #fff;
  border: 1px solid #666;
}

.container-wide>.content {
  padding: 5px;
  color: #444;
  min-height: 40px;
}
<div class="container-wide">
  <div class="content2">
    <form action="http://localhost/projekt2/new-post" class="new-post" method="post" accept-charset="utf-8">
      <input type="text" name="tytul" value="" placeholder="Wpisz tutaj tytuł...." class="input-wide">
      <input type="text" name="opis" value="" placeholder="Wpisz tutaj opis....">
      <input type="date" name="data" value="">
      <select name="status">
    <option value="0">Niepubliczny</option>
    <option value="1" selected="selected">Publiczny</option>
    <option value="2">Zaplanowany</option>
    </select>
    </form>
  </div>
</div>

SS:https://i.sstatic.net/CgCzO.jpg

I attempted implementing the box-sizing property, as shown in the code snippet above, but unfortunately it did not resolve the issue. I am unsure of how to effectively address this problem. While one option could be changing the input's width to 90%, that solution is not ideal for my needs. I want the input field to have equal spacing from both the left and right (margin) while fitting perfectly within a centered layout at 100% width.

Answer №1

.input-wide {
    width: 100%;
    padding: 10px;
    margin-bottom:10px; /*change margin to margin-bottom*/
    box-sizing : border-box;
}
.container-wide {
    min-height: 80px;
    margin: 20px;
    background-color: #fff;
    border: 1px solid #666;
    padding: 10px; /*added the padding on div*/
}
.container-wide > .content {
    padding: 5px;
    color: #444;
    min-height: 40px;
}
<div class="container-wide">
        <div class="content2">
            <form action="http://localhost/projekt2/new-post" class="new-post" method="post" accept-charset="utf-8">
<input type="text" name="tytul" value="" placeholder="Wpisz tutaj tytuł...." class="input-wide">
<input type="text" name="opis" value="" placeholder="Wpisz tutaj opis....">
<input type="date" name="data" value="">
<select name="status">
<option value="0">Niepubliczny</option>
<option value="1" selected="selected">Publiczny</option>
<option value="2">Zaplanowany</option>
</select>
        </form></div>
    </div>

Review my changes. Functionality restored.

Answer №2

Modify the CSS as follows:

.input-wide{
    padding: 10px;
    }

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

Using Bootstrap to add an input field next to a radio button in line

I'm in search of a way to align a text field next to a radio button using Bootstrap. If anyone knows of a specific class that can help achieve this, I would greatly appreciate it. My current method results in misalignment, with the textbox appearing ...

AngularJS: ng-show causing flickering issue upon page refresh

Recently, I encountered an issue with my code snippet: <body> <ng-view></ng-view> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js"></script> <script src="http://ajax.googleapis.com/ajax/ ...

Unable to retrieve dropdown value using JavaScript and display it in a div

javaScript code: Retrieving data from a dropdown and displaying it in the inner HTML of a div. function showcost() { var days = document.getElementById("Ddays"); var Dudays = days.options[days.selectedIndex].text; var div = docu ...

"The Divine Chalice" trichotomy format employing flexbox styling

My goal is to create a three-column layout known as the "holy grail" using the new display: flex syntax, as outlined in this ALA article. The setup requirements are: A header and footer with three columns in between The outer columns have fixed widths T ...

When a label is clicked, the ng-change event is not triggered on the corresponding radio button

I developed a custom directive that allows you to select a radio button by focusing on its label and pressing the spacebar. However, although the radio button is checked, the ng-change function action() does not get triggered. Below is the HTML code snipp ...

The background color disappears when viewed on mobile devices

I have created a table using HTML and CSS. The issue is that the background colors of the table display correctly on a desktop, but on a mobile phone, they appear completely transparent while the text remains visible. I am using Bootstrap 4 for this websi ...

Why is Selectpicker (bootstrap-select) not functioning properly and displaying a disabled menu?

Currently, I am attempting to implement the selectpicker feature from Bootstrap-Select in order to create a dropdown menu that supports multiple selections. Below is the snippet of code that I have included in my HTML file: <select class="selectpicker" ...

What is the correct way to target CSS child elements?

If I wanted to customize the background of the initial 2 <div> elements within the "main" <div> in the following HTML snippet. SOURCE CODE <div class="main"> <div>1</div> <div>2</div> <div>3< ...

The positioning of the input element within the div is set to

Currently, I have a container div for textbox (div.tb) with position:relative. Inside this div, there are input and placeholder divs, both of which have position:absolute. The issue lies in the fact that while the input text is vertically centered, the pl ...

Confirm that one input falls within a specified range of two inputs

I am trying to implement javascript validation for a form with two inputs. Specifically, I want to achieve the following: If a text input is entered and the dropdown remains unselected, the validation should trigger for the text input and the form should ...

Ways to create spacing between vertically stacked columns in Bootstrap

I have created a website using Bootstrap and PHP to display data from 18 categories in columns. The code for listing the categories in a single row is shown below: <div class="row"> <?php foreach($categories as $val){?> <div class="col ...

IE7 compatibility issue: jQuery shadowbox video fails to function

The shadowbox video plugin appears to have compatibility issues with IE7, as it is functioning properly in Firefox and Safari. Any feedback on this matter would be greatly appreciated. Website: HTML Code: <a href="m/abc-gardening-australia-caroline- ...

"PHP MySQL news error" - An unexpected error occurred

Just incorporated a news system using MySQL/PHP, it functions flawlessly; however, encounters errors when inserting HTML. For instance, inserting a YouTube video results in the addition of / or \ Can someone advise on what changes need to be made in ...

Having trouble enclosing a div within anchor tags in a Rails project

I am facing an issue in my rails app where I have a view containing a div with various content, including links. My goal is to make the entire div clickable. Here is a snippet of code from my view.html.erb file: <a href="/google"> <div class=" ...

Python Qt - Unlocking the Power of QTextDocument and QPainter in the Toolbox

I am looking to create a comprehensive report using a toolbox that includes multiple documents. Starting with two pages is ideal as I work on formatting later. In my attempts, I have tried utilizing QTextDocument in Html and alternatively QPainter for thi ...

My image is being cropped on larger screens due to the background-size: cover property

I am currently in the process of designing a website with a layout consisting of a Header, Content, and Footer all set at 100% width. To achieve a background image that fills the screen in the content section, I utilized CSS3 with background-size:cover pr ...

Upon clicking the navigation link, the dropdown menu is opening and closing simultaneously

My dropdown menu is behaving strangely, opening and closing simultaneously when I click the nav link. I've been working on creating a dropdown menu, but it keeps closing on its own: Whenever I try to open the dropdown, it closes by itself, and I&apos ...

Assign a variable name to the ng-model using JavaScript

Is there a way to dynamically set the ng-model name using JavaScript? HTML <div ng-repeat="model in models"> <input ng-model="?"> </div JS $scope.models= [ {name: "modelOne"}, {name: "modelTwo"}, {name: "modelThree"} ]; Any ...

In JavaScript, the input box is set to automatically capitalize the first letter, but users have the ability

How can I automatically capitalize the first letter of a user's name input, but allow for overrides like in the case of names such as "de Salis"? I've read on Stack Overflow that CSS alone cannot achieve this with text-transform:capitalize;, so ...

Position the button to display aligned to the right below the paragraph

I have a text paragraph along with a button that I am trying to align properly on the page. Despite my efforts, I am having trouble getting the button to display right-aligned below the text as desired. Here is the current layout: Is there a way to achie ...