How can I make the parent div adjust to accommodate the overflow of its child?

After creating three tabs out of divs and placing them along with a textbox into another div named "window", I wanted the window to encompass all of the content, have a red background, and a blue border around it. However, I encountered an issue where the tab divs seemed to be overflowing their parent div (window), causing the background and border to fill a smaller area than intended.

I attempted to fix this by setting overflow:hidden on the window, but this resulted in part of the tabs being cut off, which was not ideal. On the positive side, the border now surrounded the content perfectly, which was my desired outcome.

Alternatively, I tried setting overflow:auto on the window, but this led to the creation of a scroll bar that I did not want to appear.

Is there a solution to prevent the child elements from overflowing or to expand the window div to accommodate this overflow?

You can view the page I am working on here.

body {
  background-color: #F79F94;
  text-align: center;
}
.tab {
  background-color: #F47564;
  min-height: 50px;
  padding: 0px;
  margin: 0px;
  box-sizing: border-box;
}
.tab-right-line {
  border-right-style: solid;
  border-right-width: 1px;
  border-right-color: #F79F94;
}
.tab-text {
  color: white;
  font-size: 14pt;
  font-family: georgia;
}
#window {
  border-color: blue;
  border-style: solid;
  border-width: 1px;
  background-color: red;
  display: inline-block;
}
<div id="window">
  <div class="row">
    <div class="col-xs-4 tab tab-right-line">
      <h1 class="tab-text text-center">All</h1>
    </div>
    <div class="col-xs-4 tab tab-right-line">
      <h1 class="tab-text text-center">Online</h1>
    </div>
    <div class="col-xs-4 tab">
      <h1 class="tab-text text-center">Offline</h1>
    </div>
  </div>

  <br>

  <div class="row">
    <input type='text' class='form-control' required>
  </div>
</div>

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

Arranging div elements in a dynamic container

I'm facing a challenge with structuring a new widget I'm developing. My goal is to incorporate a geographic map with hotspots without resorting to image maps. Here's the incomplete solution I've come up with so far: http://jsfiddle.ne ...

Altering the height of cells in a table for HTML emails being sent to Gmail accounts

When attempting to send an HTML email from Outlook 2013 to Gmail, I have encountered a significant gap between the rows. Despite my efforts, I have been unable to adjust the row height. I am seeking advice on how to resolve this issue. Here is the code s ...

Server blocking access to Javascript files

Having some trouble with my code, it works fine on Localhost but not on Fasthosts server. Seems to be an access issue to a folder on the server, here are the debug messages: GET (http://reggarockaboogie.co.uk/images/gallery/fld01/) 403 (Forbidden) k.cors ...

Using the googleapis library within HTML is not permitted

I have been attempting to execute a simple function (uploadFile(test.txt)) within an HTML file, but I am encountering issues as my app.js and Google APIs are not being recognized or called. Node.js is throwing this error: Uncaught ReferenceError: uploadFi ...

Using CSS to break or wrap long words in text

I have a div that spans the width of the page. I'm looking to ensure that a very long word in this div breaks and wraps properly, so all the content stays within the screen width and doesn't overflow beyond 100%. Although I've attempted usi ...

Overflow: Scroll vertically and Visible horizontally

I'm struggling with a problem and can't seem to find a solution. https://i.sstatic.net/fw8C9.png My goal is to have the container scroll vertically only, while allowing overflow horizontally to display a dropdown menu. Is this even achievable? ...

Experience a seamless front/back DIV transition with a mouseover effect similar to the ones on USAT

Recently, I was tasked with creating a mouseover transition effect for a div similar to the one used on USAToday's website. The structure of the boxes on the site includes: <div class="asset"> <div class="front">'image and some t ...

Modify the color of the legend when the input is selected

Can I change the color of legend text with CSS when an input is focused, similar to how fieldsets work? Fieldsets change color when their respective input fields are focused. I want to achieve the same effect for legends. ...

Display the list items when the page first loads

I currently have this code snippet: <nav> <ul class="sel"> <li> <a href="#LINK1" data-title="A">A</a> </li> <li> <a href ...

Tips for displaying the html content saved in the database onto an ejs webpage

This task seems simple, but I'm struggling to solve it. In my Node.js/Express webapp, I have the Quill.js editor installed. It stores my description in MySQL DB like this: <p><strong>This is the quill data. How are we doing dev?</stron ...

Ensuring Radiobuttons are Selected on a Page After Clicking the Submit Button

Seeking assistance with this issue: I am working on a page that includes radio buttons: <label>Delivery type:</label> <input type="radio" name="delivery" value="7" class="delivery-item" id="del-type-7" onclick=""><label class="label" ...

Tips for incorporating API-provided CSS values into AngularJS expressions for stylish card customization

I am in the process of creating unique Pokemon cards that pull data from an API. My question is, how can I apply specific CSS styling to each card directly from the API, similar to how I have utilized AngularJS to render the information? So far, I have su ...

Child Div Elements Ignoring Z-Index Property

Check out this sample: http://jsfiddle.net/gBQqQ/ This is the html code: <div id='testtexture'> <div id='testinside'> <div style='vertical-align: top;' class='test'></div> </div> </ ...

repeating the identical content in the same setting

I am encountering an issue with jquery as I have 2 different sets of icons, each of which I want to do the same thing: My primary codes are <ul> <li> <a href=""> <i class="fa fa-facebook"></i> ...

Dynamic binding of CSS properties in AngularJS is a powerful feature that enables

I am attempting to dynamically bind the css property counter-reset in AngularJS. To see my efforts, check out this Fiddle link. Essentially, I aim to have the numbering of li elements begin with the number specified in the controller. Despite trying to us ...

jQuery Mobile Dialog Alert Box

Here's a code snippet that can be used to open a dialog box: <p><a href="ShopItems/Rotax125MicroMax.html" data-rel="dialog" data-role="button">Rotax 125 Micro Max</a></p> Next, we have a page whic ...

Items vanish when hovering over them

Creating nested links in the sidebar navigation bar with CSS has been a challenge for me. While hovering over main links, I can see the sub-links being displayed. However, when I try to hover/click on the children of the sub-links, they disappear. Note: M ...

What is the best way to showcase AJAX response values in a column format on an individual basis

My task involves retrieving 3 user values from PHP using AJAX and displaying them in a column format. However, when I tried the code below, it failed to display as expected. The output shows all first names displayed vertically followed by all last names d ...

Images of significant size displayed on websites appear distorted when viewed on mobile devices

I am currently working on a web application that specializes in storing and showcasing satellite images based on specific locations. One issue I have encountered is the large file size of these images, which can be up to 20MB in jpg format, leading to ren ...

IndexedDB is not supported for storing pages on IE10

This is an example of a demo application using IndexedDB. It runs smoothly on my IE10 when accessed through the web. However, if I save the file (named index.html) and try to open it, a JavaScript dialog box appears due to the following code: window.inde ...