hi guys .. I was wondering if someone could offer some guidance with regards to a web page positioning?
I would like to position my web page or main div container to appear in the middle of a browser regardless of the end user's chosen resolution.. is this possible?
below is my html -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
-
<head>
-
-
<title>Creative Developments</title>
-
<link rel="stylesheet" href="creativestylesheet.css">
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
</head>
-
-
<body>
-
-
<div id="root">
-
-
<div id="header"></div>
-
-
-
<div id="menu">
-
<a href="http://creativedevelopments.net/CV/">Home</a>
-
|
-
<a href="http://creativedevelopments.net/CV/">CV</a>
-
|
-
<a href="http://creativedevelopments.net/Portfolio/">Portfolio</a>
-
|
-
<a href="http://creativedevelopments.net/Interest/">Interests</a>
-
|
-
<a href="http://creativedevelopments.net/Contactme/">Contact me</a>
-
</div>
-
-
-
<div id="main">
-
<h1> Home </h1>
-
<p> I'm a freelance web developer with over five years' experience in the industry. </p><br />
-
-
<p> general text goes here
-
</div>
-
-
<div id="sidebar">
-
</div>
-
-
-
-
<div id="footer">
-
<a class="text1" href="http://creativedevelopments.net">Home</a>
-
|
-
<a class="text1" href="http://creativedevelopments.net/CV/">CV</a>
-
|
-
<a class="text1" href="http://creativedevelopments.net/Portfolio/">Portfolio</a>
-
|
-
<a class="text1" href="http://creativedevelopments.net/Interest/">Interests</a>
-
|
-
<a class="text1" href="http://creativedevelopments.net/Contactme/">Contact me</a>
-
<div id="rightcontent">
-
<a class="text2" href="http://www.creativedevelopments.net">Powered by Creative Developments</a></div>
-
</div>
-
-
-
</div>
-
-
-
</body>
-
</html>
-
-
below is my css -
#body {background-color:#009933}
-
#root {margin-left: auto; margin-right: auto; margin-top: 0px; height: 705px; width: 900px; font-family: tahoma}
-
-
#header {height: 90px; width: 898px;background-color: #CD2626; border-width: 1px; border-color: #8B8989; border-style: solid;}
-
#menu {text-align: center; padding-top:10px; padding-bottom:10px; background-color: white; height: 30px; width: 898px; margin-top: 4px;font-family: Tahoma, Helvetica, sans-serif;font-size: 14px; font-weight: bold; color: black; border-width: 1px; border-color: #8B8989; border-style: solid;}
-
#menu a:link {border-style: solid; border-width : 1px 4px 4px 1px; text-decoration : none; padding : 4px; border-color : #69f #00f #00f #69f;color: black; }
-
#menu a:visited {font-family: Tahoma, Helvetica, sans-serif; font-size: 14px; font-weight: bold; color: black; text-decoration: none; }
-
#menu a:hover {border-color: #ccc; text-decoration: underline;color: black; }
-
-
#main {margin-top: 4px;float:left; width: 674px; height: 500px; background-color: white; border-width: 1px; border-color: #8B8989; border-style: solid}
-
#sidebar {margin-top: 4px;margin-left: 4px;float:right; width: 218px; height: 500px; background-color: white;border-width: 1px; border-color: #8B8989; border-style: solid}
-
-
#footer {margin-top: 4px;margin-bottom: 4px;float: left; height: 45px; width: 898px; background-color: #CD2626;border-width: 1px; border-color: #8B8989; border-style: solid}
-
#rightcontent {float: right; padding: 5px; font-family: Tahoma; font-size: 11px; color: white}
-
-
#text1 a:link {font-family: Tahoma, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: white; text-decoration: underline;}
-
#text1 a:visited {color: #00611C; font-weight:bold;text-decoration: none}
-
#text1 a:hover {color: #00611C;font-weight:bold;text-decoration: underline}
-
-
a {font-size: 12px; font-weight: bold; color: white;text-decoration: none}
-
-
b {position: relative; top: 117px; left: 50px; margin-top: 0; font-size: 14px; font-family: Tahoma; color: #white;}
-
h1 {padding: 18px 20px; margin-top: 0; font-size: 22px; font-family: Tahoma; color: #800080;}
-
h2 {padding: 0px 24px; margin-top: 0; font-size: 16px; font-family: Tahoma; color: #800080;}
-
h3 {padding: 0px 24px; font-size: 12px; font-weight: bold; font-family: Tahoma; color: #000000;}
-
h4 {padding: 0px 24px; font-size: 11px; font-family: Tahoma; font-weight: normal; color: #000000;}
-
h5 {margin-right: 6px; margin-left: 6px; margin-top: 5px; margin-bottom: 5px; font-size: 11px; font-family: Tahoma; font-weight: bold; color: #FFFFFF;}
-
h6 {margin-right: 6px; margin-left: 6px; margin-top: 5px; margin-bottom: 5px; font-size: 11px; font-family: Tahoma; font-weight: bold; color: #800080;}
-
4 4096
A centered div remains centered regardless of resolution. If you mean sizing of the browser window, then what you have should keep it centered by using 'auto' on root.
hi there thanks for your reply
what i would like to do is have the root div to display vertically and horizontally in the middle of a browser page regardless to resolution
iv tried to amend my code but not having any luck... please advise
thanks in advance : )
gits 5,390
Recognized Expert Moderator Expert
hi ...
have a look at this thread and see whether it helps or not :)
kind regards
thanks for your reply - that was a wonderful example. got my web page to display nicely in the middle
thanks for your help : )
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Robster |
last post by:
I'd to postion a pop up windown to appear in a position relevtive to
the centre of the screen, rather than top=200, left=200.
Is there any way i can do this?
Alternatively i need a script that will position the popup in the same
place irellevent of browser window and resolution....
Any ideas?
|
by: Ney André de Mello Zunino |
last post by:
Hello.
The issue is quite known: you have a block-level container holding a
set of floated elements and you need that the container's content
height take the floated elements' dimensions into consideration. E.g.:
<div class="images">
<div class="image"><img src="example1.png" width="160" height="120"
alt=""></div>
<div class="image"><img src="example2.png" width="160" height="120"
|
by: Don G |
last post by:
Is it possible to lock the aspect ratio of container using CSS?
For example, have a <div> that is resized according to the size of the
browser window, but remains square, regardless of it's size.
In the sample code that follows, I have set the width and height of the
<div> to be 75%, however the height of the height does not vary with the
size of the content window. If it did vary, it probably wouldn't give
the desired results because...
|
by: Andrew Crook |
last post by:
I placed the following code in my html file
window.resizeTo(1000,700)
window.moveTo((screen.availWidth/2)-(1000/2),(availHeight/2)-(700/2));
The resize seems to work fine, however, the move does not seem to work.
Tested under IE6 and firefox.
I wish the browser to resize and centre on screen when the user goes to my
site.
|
by: santiago538 |
last post by:
Hi,
Is there any way to specify which monitor a Window.open() will launch a
new browser window in on systems with more than one display. It would
only need to work with Mozilla browsers, and not IE. Thanks!
| |
by: balabing79 |
last post by:
Hi all I am running internet explorer 7 at a resolution of 1024 768
the problem i am having with my page is that when it is viewed on
resolutions such as 1280 1024 or higher the page appears on the upper
left of the screen and a yukky white border all around.
theres actuall 2 things i need to be able to do and believe both done in css the first is to make the page appear centre in larger browsers so if someone can tell me how to do that it...
|
by: Grzegorz Klimsa |
last post by:
Hi !
I have a problem wiht detecting resolution of client web browser
I prepare several files of css style for different browsers and different
resolutions,
(such as : Style_1024x768.css ; Styleff_1024x768.css; Style_1280x1024.css ;
Styleff_1280x1024.css )
I want to set css style file depends on resolution browser
I wrote this script to detect type of browsers, but i don't have any idea
|
by: gerry |
last post by:
I am trying to create a custom container control that will only ever contain
a specific type of control.
At design time, when a control of a different type is added to the container
I would like to wrap the control in the proper control type - which is also
a container.
At design time I want to be able to turn this :
<my:container>
<asp:textbox />
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |