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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:59:59+00:00 2026-06-09T16:59:59+00:00

Here is a basic scenario (I’m not doing this to align text specifically, but

  • 0

Here is a basic scenario (I’m not doing this to align text specifically, but div’s with lots of other stuff in them so don’t tell me this isn’t the most appropriate way to align text 😀 I’m more interested in the principle here);

<div id="1" class="mydivclass">
  <p>The first div</p>
  <div id="2" class="mydivclass">
    <p>The second div</p>
    <div id="3" class="mydivclass">
      <p>The third div</p>
    </div>
  </div>
</div>

Using css, can I make div’s with a child div (a div inside a div) using the same class to position them self on the page, relative to it’s parent? So I would like my output from the above to look like this:

The first div
  The second div
    The third div

I’d like to know if I can, and how to if so, achieve this using CSS? For example, could you use something like the following to pad each child div 10 more pixel in than the parent, to give the above result?

.mydivclass {
  padding-left: 10px;
}

So, by nesting the same CSS class on each div, they are slowly incrementing their horizontal alignment.

  • 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-09T17:00:01+00:00Added an answer on June 9, 2026 at 5:00 pm

    Do you mean a combinaison of position:relative; and left like this? http://jsfiddle.net/EUTPB/

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

Sidebar

Related Questions

this seems pretty basic stuff here, but actually i'm finding it a bit harsh
I'm sure I'm doing something really dumb and basic here but I can't seem
This seems impossible but I will ask anyway. Here is the scenario I have
Here's a basic view of what my html looks like: <form> <div id=part1> //
Here's the basic layout of a page I'm working on: alt text http://www.mfrl.org/images/pagelayout.png What
I have what I think is a very basic scenario, but what I've read
Here's the scenario: I have a standard applicationConfig.xml spring configuration for a basic web
Here's the scenario: I have a standard applicationConfig.xml spring configuration for a basic web
I'm pretty new to anything but the more basic features of GIT. Here's the
Here is the scenario. I have a WCF service, when this service is called

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.