Sturdy and adaptable in a container designed with a responsive width

Currently, I am developing a responsive app and I am facing the challenge of making some parts of the search bar responsive while keeping others fixed in width (like the search icon).

I attempted to achieve this using the following code:

.wrapper{
    width:80%;
    height:auto;
    border-bottom:solid 5px red;
}
.solid{
    width:50px;
    height:50px;
    background-color:green;
}
.responsiv{
    width:100%;
    height:50px;
    background-color:yellow;
}
<div class="wrapper">
    <div class="solid"></div>
    <div class="responsiv"></div>    
</div>

However, my desired outcome is for the search bar to appear similar to this, but with a responsive design:

.wrapperWant{
    width:912px;
    height:auto;
    border-bottom:solid 5px red;
}
.solidWant{
    width:50px;
    height:50px;
    background-color:green;
    float:left;
}
.responsivWant{
    float:left;
    width:862px;
    height:50px;
    background-color:yellow;
}


.clear{
    clear:both;
}
<div class="wrapperWant">
    <div class="solidWant"></div>
    <div class="responsivWant"></div>    
    <div class="clear"></div>
</div>

Answer №1

.container{
    width:90%;
    height:60px;
    border-bottom:solid 6px blue;
    margin-left:60px;
}
.box{
    width:70px;
    height:60px;
    background-color:purple;
    float:left;
    margin-left:-60px;
    border-bottom:solid 6px blue;
}
.mobile{
    width:100%;
    height:60px;
    background-color:orange;
    float:left;
}
   .clearfix
   {
width:0; height:0; clear:both;}
<div class="container">
    <div class="box"></div>
    <div class="mobile"></div>
    <div class="clearfix"></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

Application of id missing on all buttons in Bootstrap tour template

I'm having an issue with applying a new id to the next button in a Bootstrap tour template. I added the id to the button, but it only seems to work for the first stage and not the subsequent ones. Can anyone provide insight into why this might be happ ...

Finding web page links from competition rankings using pattern matching

Challenge I am currently delving into the realm of natural language processing projects. Before diving in, I intend to explore existing works on datasets, particularly those organized on a leaderboard (refer to the "Three-way Classification" section). Ho ...

Is there a way to adjust the label elevation for a Material UI TextField component?

I am trying to enhance the appearance of a textfield label, but I am facing some challenges with my code. textStyle: { backgroundColor: '#1c1a1a', border: 0, borderRadius: 0, width: 400, height: 66, display: 'flex&a ...

Using CSS to conceal an element when a different element is also invisible

My inquiry is as follows: I currently possess a code that conceals class element 1 when it possesses a specific value (which varies across different sites). Now, my objective is to also conceal class element 2 ONLY IF class element 1 is already hidden. ...

What is the best way to extract additional values linked to the query within the array?

I have successfully retrieved all subcategories of a category using the code below. However, I am now facing an issue where I also want to fetch other fields associated with each subcategory, such as the price if the subcategory is a Product like Smartphon ...

Closing the video on an HTML5 player using an iPad

My task is to incorporate a video into a website with a button to close and stop the video. Once closed, an image will appear below. Everything works perfectly on all browsers. The issue arises on the iPad... On the iPad, the "close" button does not wor ...

Identifying dates in pandas index and header: A comprehensive guide

After utilizing the HTML parser to extract a table from a particular website, the current output looks similar to the following: Current Output: 1 Sep 2 Sep 3 Sep 4 Sep 00:00 11 47 54 10 ...

Include a new row in the form that contains textareas using PHP

I'm trying to add a new row to my form, but I'm facing challenges. When I click the add button, nothing happens. If I change the tag to , then I am able to add a row, but it looks messy and doesn't seem correct to me. Here is my JavaScript ...

The nth-child selector is not functioning correctly with material-ui components

Trying to figure out how to give two paragraphs different background colors using nth-child. Here's the JSX: <div className={classes.paragraphs}> <p>Test 1</p> <p>Test 2</p> </div> And the CSS: const useSty ...

Tips for transferring parameters using a href tag without causing a page refresh

Is there a way to pass parameter values without refreshing the page? I would appreciate any help. Thank you. searchresult.php <a href="index.php?id=<?php echo $data['ID']?>">clickme</a> index.php <?php echo $_GET['id ...

Prevent Text Overflow in CSS, Material-UI, and React styling efforts

I am facing an issue where the cardTitle is overlapping the Card when the text is too long. Currently, I am manually setting a static maxWidth, but I would prefer for it to adjust based on the size of the Card. Is there a way to achieve this dynamically? ...

What is the best way to connect or link to a HTML table row <tr>

Is there a way to trigger an alert when the user double clicks on the whole row? ...

A unique Javascript feature that switches the text on various buttons

As someone who is relatively new to Javascript and web development, I am currently working on a project that involves creating multiple text areas for users to input and save text. Each text area is accompanied by a button with a unique ID that functions a ...

Button with opaque background over a see-through backdrop

I am having trouble making the button within a semi-transparent caption area over an image non-transparent. Any suggestions on how to achieve this? <div class="col-md-12 landing-container"> <img src="images/pig.jpg" class="main-imag ...

Basic inquiries concerning Vue.js and JavaScript

Hey there, I recently developed a small app to practice my Vue skills. However, there are a few features that I would like to implement but I'm not sure how to do it just yet. <div class="container" id="app"> <div class="row"> <d ...

Displaying feedback messages and redirecting in Flask may result in the response being visible in the developer tools, but

Just starting out with Flask and encountering an issue. I am trying to determine if a response is empty, and if it is, display a message. The problem lies in the fact that even though the redirect works and the subsequent GET request returns the correct HT ...

Using the <script> attribute within the <head> tag without the async or defer attributes

https://i.stack.imgur.com/cRFaR.pngCurious about Reddit's use of the async or defer attribute in the script tag. Are there situations where blocking the parser is necessary? ...

Blazor Razor Component Library (RCL) Lacks CSS IntelliSense

I am encountering an issue with the CSS intellisense in my razor class library (RCL) that houses all the pages of my Blazor application. It appears that the CSS intellisense is not functioning within the RCL unless I modify the RCL .csproj xml tag From Sdk ...

Is it possible to determine which child element is currently in view within a scrollable parent div?

In an attempt to replicate a "current page" feature using divs, similar to a PDF reader. document.addEventListener("DOMContentLoaded", function(event) { var container = document.getElementById("container"); container.onscroll = function() { let ...

Move the scroll bar outside of the div and set it to automatically overflow

My issue involves a small div with the CSS property overflow:auto;. However, when the scroll bar appears, it covers up a significant portion of the div. One possible solution is to use overflow:scroll;, but this can result in an unsightly faded scroll bar ...