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 8173785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:17:03+00:00 2026-06-06T22:17:03+00:00

Hello all I am working on html and javascript.And I am going to ask

  • 0

Hello all I am working on html and javascript.And I am going to ask a very basic question. I have written a simple code tried different thing.But unable to make it work my bad.
What I want to do is that I have a div which has two inner divs.Both inner divs has an svg element inside equal to the size of div.and I want both inner divs to be side by side.But my divs are not equal Ist div is big second is small in width.

<html>
<head></head>
<body>
 <div position:relative; width = "100%"; height = "400px" float:left>
  <div width = "1000px" height = "400px"; float:left>
    <svg width = "1000px" height = "400px"> 
    </svg>
  </div >
  <div width = "300px" height = "400px"float:left>
    <svg width = "300px" height = "400px"> 
    </svg>
  </div>
 </div>
</body>
</html>

How can I achieve this.
Also should i write height and width with both div and svg or it fine to use with only one

  • 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-06T22:17:04+00:00Added an answer on June 6, 2026 at 10:17 pm

    If you want the divs to be equal in width, you’ll need to set their width value to be equal. There are two ways of doing this. First, you could manually set the width:

    <html>
    <head></head>
    <body>
     <div position:relative; width = "100%" height = "400px">
      <div width = "1000px" height = "400px" style="float:left">
        <svg width = "1000px" height = "400px"> 
        </svg>
      </div >
      <div width = "1000px" height = "400px" style="float:right">
        <svg width = "1000px" height = "400px"> 
        </svg>
      </div>
     </div>
    </body>
    </html>
    

    Or, you could just use percentages:

    <html>
    <head></head>
    <body>
     <div position:relative; width = "100%"; height = "400px">
      <div width = "50%" height = "400px" style="float:left">
        <svg width = "100%" height = "400px"> 
        </svg>
      </div >
      <div width = "50%" height = "400px" style="float:right">
        <svg width = "100%" height = "400px"> 
        </svg>
      </div>
     </div>
    </body>
    </html>
    

    In both cases, if you want the divs to be side-by-side, one needs to be float:right and the other float:left. There are other ways of accomplishing this but floats are simple.

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

Sidebar

Related Questions

Hello all I am working in javascript and html5.I want to ask that how
Problem Hello all! I have this code which takes my jpg image loops through
Hello all this is my first post here i have been working in an
I have this simple hello world version of a google map api javascript v3
I have something pretty simple I want to do. I'm still working through all
I have below html code <div id=divTest> Hello <input type=text id=txtID value= /> <input
I have below code in html <div id=divTest> Hello <input type=text id=txtID/> <input type=text
Working with chrome on ubuntu, have a basic java applet and javascript interaction. The
I have this simple jQuery code $(document).ready(function() { $('#test').attr('value','hello world'); $('#test1').text('hello world'); }); And
hello all I have a small dialog which I created dynamically, which has a

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.