Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

div tags

Status
Not open for further replies.

inusrat

Programmer
Feb 28, 2004
308
CA
Hi,

I used <Div> tags on my page. I used left and top propertites to align my images and menues.
But now when I go to other monitor, either bigger or smaller than mine, whole page gets messed up and things are not where they are suppose to be. Or if I change the resolution, all alignment gets messed up. Is there any way around it?
If not I wonder, why <div>
statemnts are so popular.

Thanks
 
You will need to be more specific. What breaks up? Could you show us the code, or even better, the page? Divs are used as containers in a similar way tables are used as containers. Except to create a box in a table, you needed at least table, tr and td tags and in the case of divs you only need one div. Show us what you have done and we will be able to help you.
 
Thanks for your reply. I meant that when i change the resolution my text and images are not aligned they way they should be. Hard to put all the code but i am doing something like that outside my table tags.

<div id="Layer2" style="position:absolute; z-index:5; top: 180px; left: 570px;">
<img src="images/isotopes.jpg" width="191" height="187" >
</div>

I also have tables on my page too. I am positioning my main table by doing align property (align=center).
I thnk if i also poition my tables like I am doing my div (left: px) then probably evertything will remain intact in the same order, what you think?

Thanks
 
Hi Vragabond,

The website I am working is under construction.

See that menu on top. I download it from Dynamic drive website. The poitioning of that menu is by distance from left and top in pixeles, just like we do sometime in <DIV>.

My table is align center. Right now everything looks nice and pretty if you have same monior size and resloution like I have. If I change the resolution then you will see that menu and images do not remain part of the page but infact their poition changes...

Thanks
 
inusrat,

If I may, the issue seems to be here:
<div id="Layer2" style="[red]position:absolute[/red]; z-index:5; top: 180px; [red]left: 570px[/red];">

Regardless of your monitor resolution, the element will be positioned [red]570 pixels[/red] from the left margin. You can specify a percentage value [red]without the position variable[/red].

There is good info on CSS and what specific tags do at


Wishdiak
 
Thanks fou your message. You were right left: 570px was the problem, I just took out the Div and put everything except menu in <td>. But I am still puzzeled about the poition of the menu. Like I said I downloaded the menu from
"Dynamic Drive" and they are poitioning the menu with the following code. which again presents the same problem that I was having with <Div>


addmenu(menu=[ // This is the array that contains your menu properties
"mainmenu", //Menu Name
140, // Menu Top position in pixels-
525, //Menu Left position in pixels
, //Menu Width -
1, // Menu Border Width

Any idea how can I take care of this problem so that when page resolution changes my page still remain intact.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top