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

  • Home
  • SEARCH
  • 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 8236947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:18:15+00:00 2026-06-07T19:18:15+00:00

I am trying to add two divs inside the parent div, which has a

  • 0

I am trying to add two divs inside the parent div, which has a button inside each div.
I need to fix the width in pixels only for the second div and the 1st div should be having width in % so that the button inside the 1st div should be covering the entire space of the browser.

I need all the widths in % and also I don’t want to change either html structure and css because it is already implemented so i just need changes in css property.

Here is my demo
http://jsfiddle.net/zuyyT/2/

P.S : When I scale the browser, the second div is coming in next line. Please scale it and check once.

  • 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-07T19:18:16+00:00Added an answer on June 7, 2026 at 7:18 pm

    Fiddle is working on and off … you can go either one of two ways; using floats (need to change the order of your markup) or positioning – like such …

    <div class="block">
        <div class="block_right"><a href=""> <span>last button</span></a> </div>
        <div class="block_left"><a href="" class="scButton score" > <span>Lorem ipsum</span></a></div>
    </div>
    

    and your CSS …

    .block {
        display:block; background-color:#FFC; width:100%; float:left; height:30px
    }
    .block_left{
        background-color:#C93; margin-right: 150px;  
    }
    .block_left a{
        background-color:#CCC; border-radius:4px; padding:4px; width:100%; display:block
    }
    .block_right{
        float:right; width:130px; background-color:#CC9
    }
    

    … using position, you’ll need to add position:relative to .block and then right:0 to .block_right; keep the margin on .block_left

    Using positioning, you won’t need to change the order of the elements in your markup (should that be an issue).

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

Sidebar

Related Questions

We have a situation where we are trying to add two UITableViews inside a
I'm trying to add two buttons to each cell in a tableview, but when
I have two divs and a link for each. I'm trying to write an
I am trying to create a control which contains two listboxes with add/remove buttons
In my html page i have two divs inside a container div. The two
I'm trying to get the IDs from my parent divs <div id=btn1><label class=btn><input type=submit
I'm trying to add two object that they are in the same class. In
I'm trying to add two inputs to a QTCaptureSession in the following: mainSession =
I am trying to add two larger binary numbers (i.e. number of bits are
I am trying to add two values in a byte array. This is my

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.