Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Web Technology by (40.7k points)

I have 2 divs: one on the left side and one on the right side of my page. The one in the left side has fixed width and I want the one of the right side to fill the remaining space.

    #search {

        width: 160px;

        height: 25px;

        float: left;

        background-color: #ffffff;

    }

    #navigation {

        width: 780px;

        float: left;  

        background-color: #A53030;

    }

<div id="search">Text</div>

<div id="navigation">Navigation</div>

1 Answer

0 votes
by (20.3k points)

You can try using the code given below:

#left {

  float:left;

  width:180px;

  background-color:#ff0000;

}

#right {

  width: 100%;

  background-color:#00FF00;

}

<div>

  <div id="left">

    left

  </div>

  <div id="right">

    right

  </div>

</div>

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Sep 2, 2019 in Web Technology by Tech4ever (20.3k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...