473,603 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

fixing size of page layout sections to replace tables

Hi.

I'm trying to get a page layout using css instead of tables, where the
various sections have fixed widths even when you resize the browser window.

The css below produces the correct layout but I cannot get the center id=txt
section to fix at 700px.

Does anyone know how I can achieve this?

/* set margins, padding, and inline-level content alignment */
body,div { margin: 0; padding: 0; text-align: center }

/* set widths and float nav & ads div content boxes */
#hdr { margin-left: 100px; height: 150px; }
#nav { float: left; width: 150px; height: 100% }
#ads { float: right; width: 120px; height: 100% }
/* note: if you change the widths above also change the margins in the rule
below */

/* set side txt margins and height */
#txt { margin-left: 150px; margin-right: 120px; height: 100%; width:
00px; }

/* ensure footer stays at the bottom */
#ftr { clear: both }

/* show boundaries and set image sizes - for clarity only */
#hdr, #ftr { background: aqua }
#nav, #ads { background: yellow }
#txt { background: lime }

/* stretch image to represent content - for clarity only */
#hdr img { width: 250px; height: 25px }
#ads img { width: 75px; height: 100px }
#txt img { width: 150px; height: 200px }
Cheers,

--
Harry Smith
Apr 14 '06 #1
3 1579
To further the education of mankind, "Harry"
<cellerymail-harry<at>yahoo. co.uk> declaimed:
Hi.

I'm trying to get a page layout using css instead of tables, where the
various sections have fixed widths even when you resize the browser
window.

The css below produces the correct layout but I cannot get the center
id=txt section to fix at 700px.

Does anyone know how I can achieve this?

/* set margins, padding, and inline-level content alignment */
body,div { margin: 0; padding: 0; text-align: center }

/* set widths and float nav & ads div content boxes */
#hdr { margin-left: 100px; height: 150px; }
#nav { float: left; width: 150px; height: 100% }
#ads { float: right; width: 120px; height: 100% }
/* note: if you change the widths above also change the margins in the
rule below */

/* set side txt margins and height */
#txt { margin-left: 150px; margin-right: 120px; height: 100%; width:
00px; }

/* ensure footer stays at the bottom */
#ftr { clear: both }

/* show boundaries and set image sizes - for clarity only */
#hdr, #ftr { background: aqua }
#nav, #ads { background: yellow }
#txt { background: lime }

/* stretch image to represent content - for clarity only */
#hdr img { width: 250px; height: 25px }
#ads img { width: 75px; height: 100px }
#txt img { width: 150px; height: 200px }


700px what? If width, you have that set to "00px".

--
Neredbojias
Infinity can have limits.
Apr 14 '06 #2
Yes, sorry.... that should have read

#txt { margin-left: 150px; margin-right: 120px; height: 100%; width:
00px; }

That was a mistake when I pasted the code, it does read 700px in the
stylesheet yet only the #nav and #ad sewctions

#nav { float: left; width: 150px; height: 100% }
#ads { float: right; width: 120px; height: 100% }

keep their widths when the window is resized.

--
Harry Smith
"Neredbojia s" <http://www.neredbojias .com/fliam.php?cat=a lt.html> wrote in
message news:Xn******** *************** ***********@208 .49.80.251...
To further the education of mankind, "Harry"
<cellerymail-harry<at>yahoo. co.uk> declaimed:
Hi.

I'm trying to get a page layout using css instead of tables, where the
various sections have fixed widths even when you resize the browser
window.

The css below produces the correct layout but I cannot get the center
id=txt section to fix at 700px.

Does anyone know how I can achieve this?

/* set margins, padding, and inline-level content alignment */
body,div { margin: 0; padding: 0; text-align: center }

/* set widths and float nav & ads div content boxes */
#hdr { margin-left: 100px; height: 150px; }
#nav { float: left; width: 150px; height: 100% }
#ads { float: right; width: 120px; height: 100% }
/* note: if you change the widths above also change the margins in the
rule below */

/* set side txt margins and height */
#txt { margin-left: 150px; margin-right: 120px; height: 100%; width:
00px; }

/* ensure footer stays at the bottom */
#ftr { clear: both }

/* show boundaries and set image sizes - for clarity only */
#hdr, #ftr { background: aqua }
#nav, #ads { background: yellow }
#txt { background: lime }

/* stretch image to represent content - for clarity only */
#hdr img { width: 250px; height: 25px }
#ads img { width: 75px; height: 100px }
#txt img { width: 150px; height: 200px }


700px what? If width, you have that set to "00px".

--
Neredbojias
Infinity can have limits.
Apr 14 '06 #3
Harry <cellerymail-harry wrote:
Hi.

I'm trying to get a page layout using css instead of tables, where the
various sections have fixed widths even when you resize the browser window.

The css below produces the correct layout but I cannot get the center id=txt
section to fix at 700px.

Does anyone know how I can achieve this?

/* set margins, padding, and inline-level content alignment */
body,div { margin: 0; padding: 0; text-align: center }

/* set widths and float nav & ads div content boxes */
#hdr { margin-left: 100px; height: 150px; }
#nav { float: left; width: 150px; height: 100% }
#ads { float: right; width: 120px; height: 100% }
/* note: if you change the widths above also change the margins in the rule
below */

/* set side txt margins and height */
#txt { margin-left: 150px; margin-right: 120px; height: 100%; width:
00px; }

/* ensure footer stays at the bottom */
#ftr { clear: both }

/* show boundaries and set image sizes - for clarity only */
#hdr, #ftr { background: aqua }
#nav, #ads { background: yellow }
#txt { background: lime }

/* stretch image to represent content - for clarity only */
#hdr img { width: 250px; height: 25px }
#ads img { width: 75px; height: 100px }
#txt img { width: 150px; height: 200px }
Cheers,

Have a link for us to see the thing in action? Does the code validate ?
(If not, that will be first answer you'll get next post... Make sure it
does!)

Sh.
Apr 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5976
by: Victor Louie | last post by:
Hi, I'm a newbie...I'm having trouble changing the size of an image when I use different window sizes when loading the and resizing the browser window. If anyone could help it would be appreciated. Thanks Victor
12
3037
by: AussieTraders.com.au | last post by:
Should I use <font size=-2> or <font size=1>?? They seem to give the same results... I wish to be able to set the default font family and font size for a website and STILL SUPPORT _fluid_texts_. -- Erik Andersson ( AussieTraders.com.au ) http://www.aussietraders.com.au/ - Placing an add is FREE at AussieTraders.com.au, Australia's buy & sell
115
7163
by: J | last post by:
I've run CSSCheck on my style sheets and I always get a warning similar to this: "font: bold 9pt/100% sans-serif Warning: Absolute length units should not generally be used on the Web ..." Yet if I use 'x-small' instead of 9pt, I get bigger type on IE6 and smaller type on Mozilla. My choices seem to be:
4
1545
by: Der Kommissar | last post by:
Hi all I've been working on a site, in which I had to use tables for layout, but I've used CSS to style the text and a few other things. http://www.cultuurnet.be/ The site seems to work as intended in virtually any browser (according to browsercam), except for IE 5.x/Win and Opera 6/Mac, where the huge text size breaks the layout (as can be seen on
11
9468
by: SarahMarsden | last post by:
I'm new to Dreamweaver (using MX 2004). I have a 2 row 3 column table. I have set each column to 200 pixels. The second row I have merged into one cell. When I enter text (or anything else) into the merged cell the 3 columns above change pixel width. The pixel width still says 200. But the pixel width shown in green above the columns it says 200(172)for example. It seems that the bracketed number is the size the cell displays at rather...
2
1157
by: priyank | last post by:
I am new to asp.net. I want to setup best presentation layer templete so I can use easily of all aspx pages. someone suggested that you should remove gridlayout and choose flow but it is very difficult to setup sections on page. I can not position objects easily. Any suggestions? I do not want to use other well known editors. Are there any articles or sample available?
6
1336
by: Bill | last post by:
I am trying to figure out how to do page layouts using tables (obviously not my background). If I have, say, a 5x5 table defaulting to20px wide per cell, why can't I make the cell in, for example, (3,1) 10 px wide? It seems to want to use the widest cell in a column... i.e. 20px. Also, if I make any of the cells greater than 20, all the rest in a column default to the same larger width. It seems that each row's cells should be rendered...
2
1032
by: Andy | last post by:
Hi, We have a few rather heavy pages and would like to speed up the 'perceived' download time by rendering some sections of the page which are ready to be shown while sill awaiting other parts of the page (e.g. which rely on longer retrieval from a database). How would I go about doing this? We're using ASP.net 1.1.. Many thanks for any help or advise. Andy
1
1823
by: cdea | last post by:
hi, i'm trying to fix my layout for ie7 but i haven't the slightest clue as to where i should start. you can check out the layout for yourself at http://www.deepcoterie.com/index.php the css file can be found at http://www.deepcoterie.com/ndxz-studio/site/deepcoterie/style.css from what's showing up on my browser it looks like the div named "content" isn't getting it's top margin of 110px applied.
0
7996
marktang
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...
0
7928
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8415
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8060
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,...
0
8273
tracyyun
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...
0
6735
agi2029
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...
0
5441
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();...
0
3903
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.