User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 374,163 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,301 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting

Taking the plunge into Layers

Join Date: Feb 2008
Posts: 19
Reputation: dwlamb_001 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dwlamb_001 dwlamb_001 is offline Offline
Newbie Poster

Re: Taking the plunge into Layers

  #4  
May 5th, 2008
Is it possible to use div tags, using relative positioning, to have two columns so that the top line of two blocks line up?

I'm coding an online version of a c.v. Using a table scheme, I could achieve this with coding a row like this:
  1. <tr valign="top">
  2. <td width="85%">
  3. <p class="c5">
  4. Job Title
  5. </p>
  6. <p class="c4">
  7. Company and City
  8. </p>
  9. <p class="c4">
  10. Job Description and other details
  11. </p>
  12. </td>
  13. <td width="15%" nowrap="nowrap">
  14. <p class="yrs">
  15. Dates there
  16. </p>
  17. <p class="c4">
  18. <br />
  19. </p>
  20. </td>
  21. </tr>

This would display the time served at a company in a new column, lining up with the top line of the first column.

In CSS I have the following code:

  1. <div style="position: relative; background-color: blue;
  2. left: 0px; top: 0px; width: 80%; height: automatic; z-index: 4">
  3. <p class="c5">
  4. Company
  5. </p>
  6. <p class="c4">
  7. Job Title
  8. </p>
  9. <p class="c4">
  10. Description.
  11. (This can be quite long and
  12. is a key factor for making
  13. the height automatic since
  14. </p>
  15. </div>
  16. <div style="position: relative; background-color: blue;
  17. left: 0px; top: 5px; width: 20%; margin-left: 80%;
  18. height: automatic; z-index: 4">
  19. <p class="yrs">
  20. yyyy - yyyy
  21. </p>
  22. </div>

The desired result is 67% of what I want. The years display one line below the information provided in the description instead of at the top, but to the right where I want it.

I don't think positioning with absolutes is viable because the height of the blocks for describing a job will vary on the left. As well, there is text above this area that would make coding absolutes very difficult to achieve.
Reply With Quote  
All times are GMT -4. The time now is 3:47 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC