Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8436559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:12:37+00:00 2026-06-10T07:12:37+00:00

I created two DIV elements. Those two DIV elements will be only in one

  • 0

I created two DIV elements. Those two DIV elements will be only in one page, and in all other pages will be only one DIV element.
When second element disappear, first element automatically takes all width.
Sorry, i can’t add pictures yet, but i will try to create an example:

[div element “one”] width:50% [div element “two”] width:50%

*div element “two” disappear

[div element”one”] width 100%

How can i get like that? With simple CSS/HTML i can’t reach result like in an image.
* And I cant change class of DIV element

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T07:12:38+00:00Added an answer on June 10, 2026 at 7:12 am

    Write like this:

    HTML

    <div class="two">two</div>
    <div class="one">one</div>
    

    CSS

    .two{
        background:red;
        float:right;
        width:50%;
    }
    .one{
        background:green;
        overflow:hidden;
    }
    

    Check this http://jsfiddle.net/gJ22P/

    OR

    You can use display:table property for this.

    Check this http://jsfiddle.net/gJ22P/1/

    It’s work’s till IE8 & above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a div there are two childs of that div one is
I'm gonna create two div tags with CSS that appear in the page like
I created two classes in netbeans;One of them is a JPanel form and another
I created two apps one free and one PRO and published them to the
I created two modules, one with def _func(): print hi and another def func():
I created two arrays. First the arrays show the elements with no order whatsoever.
i created two divs first a red background div and then a blue background
Ok so I'm currently working on a page where ill have two elements, the
I've two html files. One includes the other in an iframe. The iframe executes
I created two dropdpwn calendar in my form with these codes: <script type=text/javascript src=http://code.jquery.com/jquery-latest.js></script>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.