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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:33:01+00:00 2026-05-24T06:33:01+00:00

Let suppose i have two html pages p1 & p2 and it uses different

  • 0

Let suppose i have two html pages p1 & p2 and it uses different layouts l1 & l2 respectively. I have to design the two different layouts and i only want to use common ID names. I just tried to let you understand that what i have in my mind, pls conisder js fn too (id does matter when we use js).

  commonPage.css
    p1 > l1 > #right { width:25%; height:25% .... }
            > #left  { width:25%; height:25% .... }  

    p2 > l2 > #right { width:30%; height:35% .... }
            > #left  { width:30%; height:35% .... } 

follwing are html pages :

 p1.html
  <html> <head> <link rel="stylesheet" href="commonPage.css" type="text/css"/>
   </head> <body>  
   <div id = "l1.right"></div>        <div id= "l1.left"></div>   </body></html>

 p2.html
  <html> <head> <link rel="stylesheet" href="commonPage.css" type="text/css"/>
   </head> <body>
     <div id = "l2.right"></div>    <div id= "l2.left"></div>   </body></html>

@Edit My Question is : how to write same Id names for many html tags with different properties and it should not affect to each other.

  • 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-24T06:33:03+00:00Added an answer on May 24, 2026 at 6:33 am

    You can’t identify HTML elements in a page by the page’s file name, so you have to either put the unique styles in style tags in each page, or use IDs/classes for each page.

    In p1.html, give your body element an ID of p1, name it p2 in p2.html, name both of your divs right and left respectively, so your HTML looks like this (showing only body contents):

    p1.html

    <body id="p1">
      <div id="right"></div> 
      <div id="left"></div>
    </body>
    

    p2.html

    <body id="p2">
      <div id="right"></div> 
      <div id="left"></div>
    </body>
    

    Then use these selectors:

    #p1 > #right 
    #p1 > #left 
    #p2 > #right 
    #p2 > #left
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's suppose I have a model with only two fields: name and street name
I have two Tables Let suppose A and B Now suppose the structure of
Suppose I have two tables in a parent - child relationship. Let's call them
My question is kinda simple... Let's suppose I have two simples tables on a
Let's suppose I have a trait with two type parameters, e.g. trait Qux[A, B]
Suppose that you have two huge files (several GB) that you want to concatenate
I want to build text base calculator in c# Let suppose I have text
Let's suppose that I have a list of elements, and I want to select
Let us suppose that I want to query mongo on the dateTime. I have
Let's suppose I have an applet running within a page in a browser. What

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.