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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:44:46+00:00 2026-06-15T18:44:46+00:00

html: <div class=parent> <div> <a href=>First Page</a><a href=>Second Page</a><a href=>Third Page</a> </div> </div> css:

  • 0

html:

<div class="parent">
<div>
         <a href="">First Page</a><a href="">Second Page</a><a href="">Third Page</a>
</div>
</div>

css:

div.parent > div > a {
margin-right: 2em;              
}
div.parent {
border: 1px solid red;
height: 100px;
background-color: #bbb;
}
div.parent > div {
border: 1px solid lightblue;
background-color: #fff;

height: 40px;
width: 900px;

display: block;
float: default;
margin: 0 auto 0;
}

Example:

The result of the stylesheet can be seen on JSFiddle: http://jsfiddle.net/BMEXR/2/

Notice: The colors and spacings are set for better differentiating.

How can the div be aligned in the middle, and that relative to its parent?
So that the div will move relative to the height setting of the parent div?

  • 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-15T18:44:47+00:00Added an answer on June 15, 2026 at 6:44 pm

    If you don’t mind some markup change:
    http://jsfiddle.net/BMEXR/30/

    HTML:

    <div class="parent">
        <div class="childContainer">
            <div class="childContents">
                 <a href="">First Page</a><a href="">Second Page</a><a href="">Third Page</a>
            </div>
        </div>
    </div>
    

    CSS:

    div.childContents a {
       margin-right: 2em;              
    }
    div.childContents{
       background-color:white;
       height: 25px;
       width: 900px;    
    }
    div.parent {
       border: 1px solid red;
       height: 100px;
       background-color: #bbb;
       display:table-row;
    }
    div.childContainer {
       border: 1px solid lightblue;
       background-color: transparent;
       vertical-align:middle;
       display: table-cell;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Fiddle is here - http://jsfiddle.net/ashwyn/a45ha/ HTML here - <div class=parent> <div class=a>Class A</div> <div
Hi I've got something like the following HTML: <div class="container"> <img src="first.png" /> <img
The HTML: <div id=timerList> ... <li rel=project class=open> <a class= style= href=><ins>&nbsp;</ins>Project C</a> </li>
HTML: <ul id=mode> <li><a href=#tab1>tab1</a> <div class=extra>tada</div> </li> <li><a href=#tab2>tab2</a> <div class=extra>tada</div> </li> </ul>
HTML: <ul> <li><a href=#tab1>tab1</a></li> <li><a href=#tab2>tab2</a></li> </ul> <div id=tab1 class=tab-content>content 1</div> <div id=tab2 class=tab-content>content
HTML: <div class=tabbed-section> <ul class=tabs> <li><a href=#tab-1>Tab 1</a><li> <li><a href=#tab-2>Tab 2</a><li> </ul> <div id=tab-1
<div> <h3 class=ft-default bold inline-block>Callback</h3> <ul class=Browsingtree02> <li><a href=/description.html>LoadCallBack</a></li> <li><a>ChangeCallBack</a></li> <li><a>beforeJobCallBack</a></li> <li><a>afterJobCallBack</a></li> <li><a>afterListCallBack</a></li> <li><a>afterReadCallBack</a></li>
Html code is: <div id=questions> <ul> <li class=selected><a href=#fly>Fly</a></li> <li><a href=#fly1>Fly 1</a></li> </ul> <div
this the html page: <div class=gs_ri> <h3 class=gs_rt> <span class=gs_ctc> <span class=gs_ct1>[BOOK]</span> <span class=gs_ct2>[B]</span></span>
Here's my HTML: <DIV class = parent> <DIV class = child> <Anchor ...> </DIV>

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.