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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:05:21+00:00 2026-05-27T21:05:21+00:00

I got a <div> containing 2 <p> s: #in .html file <style type=text/css> div.box

  • 0

I got a <div> containing 2 <p>s:

#in .html file
<style type="text/css">
    div.box {
        position: relative;
        height: 30px;
    }
    div.box p#id1 {
        position: absolute;
        margin-left: 0px;
    }
    div.box p#id2 {
        position: absolute;
        margin-right: 0px;
    }
</style>
...
<div class="box">
    <p id="id1">ID1</p>
    <p id="id2">ID2</p>
</div>

When the browser’s view is maximized, it looks like this:

-------------------------------------------------------------
|                                                           |
|ID1                                                     ID2|
|                                                           |
-------------------------------------------------------------

when I zoom out the browser, it looks like this (which is not what I want it to be):

---------------------------------
|                               |
|ID1                         ID2|
|                               |
---------------------------------

When the browser zooms, the content on the right side (ID2) shifts away.
What I expected is that, when I zoom out the browser, the content on the right side should be left out, like this:

-------------------------------------------------------------
|                                                           |
|ID1                                                     ID2|
|                                                           |
-------------------------------------------------------------
-----------------------------------------------------------
|                                                         |
|ID1                                                     I|
|                                                         |
-----------------------------------------------------------
---------------------------------
|                               |
|ID1                            |
|                               |
---------------------------------

How to do it in Css?

PS
The only way I thought of to do the job is to set the <div> block’s width to an explicit number, but how can I know what the width should be, because the screens’ size are not the same as mine, right?

  • 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-05-27T21:05:22+00:00Added an answer on May 27, 2026 at 9:05 pm

    try this style element, it does what you want

        <style type="text/css">
            div.box {
                position: relative;
                height: 30px;
                min-width:400px;
            }
            div.box p#id1 {
                position: relative;
                margin-left: 0px;
                display:inline-block;
                float:left;
                clear:none;
            }
            div.box p#id2 {
                position: relative;
                margin-right: 0px;
                display:inline-block;
                float:right;
                clear:none;
            }
        </style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got contenteditable div as below. <div style= border:solid 1px #D31444 contenteditable=true>12 some text...</div>
i´ve got elements inside a containing div with a class. i could use text-align:
I've got several div id's, each containing a different client. I want to be
I have got a div [projItemsContent] that varies in height based on the contents,the
I've got UpdatePanel with Div <telerik:RadAjaxPanel runat=server ID=RadAjaxPanel1> <div class=pnlFind style=display:none;> </div> </telerik:RadAjaxPanel> wanna
Ive got two DIV elements one of which has absolute position (lower left corner
I got a div which is of fixed width and height: #containersimg { width:
In my html i have got div with given class. After clicking a button
I have div containing multiple divs and text. The inner divs are alternately floated
I got a large div that is containing several dynamic divs inside of it.

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.