Making div tags fit every browser and screen

For discussions about game development that does not fit in any of the other topics.
Post Reply
Baseball435
Posts: 548
Joined: Sun May 30, 2010 3:49 am

Making div tags fit every browser and screen

Post by Baseball435 »

hey everyone. Well i have been trying to make a basic web layout and i use the code for my top bar div tag as

Code: Select all

#topbar {
	text-indent:25px;
	text-align:right;
	background:#000;
	border: 1px solid #000;
	width:1010px;
	height: 30px;
but when i go onto my other computer the width is too far because of the screen being smaller. How could i make it so that it fits every screen and the text stays where i want it? (top right)

Thanks in advance!

~baseball435
User avatar
Chris
Posts: 1581
Joined: Wed Sep 30, 2009 7:22 pm

Re: Making div tags fit every browser and screen

Post by Chris »

You could either not give it any width, set the width to auto or 100%.

Or you could:

Code: Select all

left:0;
right:0;
position: absolute;
Fighting for peace is declaring war on war. If you want peace be peaceful.
Baseball435
Posts: 548
Joined: Sun May 30, 2010 3:49 am

Re: Making div tags fit every browser and screen

Post by Baseball435 »

Oh ok thanks
Post Reply

Return to “General Development”