473,508 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Beginner converting from tables -- probably very simple answer

Hi,

I've decided to take the plunge and move from tables to a pure css
layout. I still "think" in tables when I do my layouts and I was
wondering the following:

I have a simple, standard two column layout:

header
nav content
footer

The items are in a 720px #wraper and the nav column is 200px wide and
the content is 500px wide.

How do I position am image, for example, specifically in the content
area? Does the image needs it's own div?

Should I use relative positioning so that the image (call it
image.jpg) is relative to the content div, and if so should I place
the image using padding? Or assign it an absolute position relative to
the content container div

Similarly, what do you do with two or three images? It seems that a
DIV for each can't be the best way ......

How you achieve this in real practice?

e.g. <div id="content">
<div id="imageOne">
<a href......>
</div>
<div>

<style>
#imageOne
{
padding: 20px
}
Thanks in advance for your help,
Rangy

Mar 4 '07 #1
3 1883
Scripsit Rangy:
I've decided to take the plunge and move from tables to a pure css
layout.
Why? That's an expensive exercise in futility when applied to existing
pages, and makes things just more difficult for new pages _unless_ you are
also changing the whole mental model of design (and layout).
I have a simple, standard two column layout:

header
nav content
footer
Crucial question: Is navigation useful? Well, yes, of course it is
indispensable, but is it useful to _keep a navigation block visible_ at any
time at any cost? The sure cost includes waste of space, and in your
"standard" layout this means wasting the precious horizontal space. For all
that you can know, the horizontal dimension of the available space ranges
from zero to infinity, and on the average it's probably smaller than you
think.
The items are in a 720px #wraper and the nav column is 200px wide and
the content is 500px wide.
That's part of a wrong mental model. A fixed width of 720 pixels is simply
too much in many circumstances.
How do I position am image, for example, specifically in the content
area?
It depends on how you wish to position it. But that's too early a question
now.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Mar 4 '07 #2
On 2007-03-04, Rangy <da*******@gmail.comwrote:
Hi,

I've decided to take the plunge and move from tables to a pure css
layout. I still "think" in tables when I do my layouts and I was
wondering the following:

I have a simple, standard two column layout:

header
nav content
footer

The items are in a 720px #wraper and the nav column is 200px wide and
the content is 500px wide.

How do I position am image, for example, specifically in the content
area? Does the image needs it's own div?
Probably not, unless you want to give it a little centred caption or
something. Just put the <imgin the content div, and it will display in
the content area, assuming you've done your two column layout in a
fairly sensible way. Use display: block or perhaps float on the <img>
element directly to change the image's position if you need to.
Should I use relative positioning so that the image (call it
image.jpg) is relative to the content div, and if so should I place
the image using padding? Or assign it an absolute position relative to
the content container div
Relative positioning isn't relative to the content div, but relative to
where the element's own box would have been if it hadn't been positioned
at all. The browser does everything as if the element had been normal
flow, and then at the last minute translates the element's box(es) by
the relative offset you've provided, leaving a gap behind it.

Absolute positioning is relative to the containing block. Fixed
positioning is relative to the viewport. The terms are highly confusing.
Similarly, what do you do with two or three images? It seems that a
DIV for each can't be the best way ......
Just put the imgs in and style them directly, no need for divs until you
run into some problem that specifically requires them.
How you achieve this in real practice?

e.g. <div id="content">
<div id="imageOne">
<a href......>
</div>
<div>

<style>
#imageOne
{
padding: 20px
}
You need to give more information about the end result you want.
Mar 4 '07 #3
Thanks very much for your help. The questions was more general --
about generically placing images and other content within a "column
div" --- and you answered it.

Much appreciated.
Rangy

On Mar 4, 4:29 am, Ben C <spams...@spam.eggswrote:
On 2007-03-04, Rangy <davidw...@gmail.comwrote:
Hi,
I've decided to take the plunge and move from tables to a pure css
layout. I still "think" in tables when I do my layouts and I was
wondering the following:
I have a simple, standard two column layout:
header
nav content
footer
The items are in a 720px #wraper and the nav column is 200px wide and
the content is 500px wide.
How do I position am image, for example, specifically in the content
area? Does the image needs it's own div?

Probably not, unless you want to give it a little centred caption or
something. Just put the <imgin the content div, and it will display in
the content area, assuming you've done your two column layout in a
fairly sensible way. Use display: block or perhaps float on the <img>
element directly to change the image's position if you need to.
Should I use relative positioning so that the image (call it
image.jpg) is relative to the content div, and if so should I place
the image using padding? Or assign it an absolute position relative to
the content container div

Relative positioning isn't relative to the content div, but relative to
where the element's own box would have been if it hadn't been positioned
at all. The browser does everything as if the element had been normal
flow, and then at the last minute translates the element's box(es) by
the relative offset you've provided, leaving a gap behind it.

Absolute positioning is relative to the containing block. Fixed
positioning is relative to the viewport. The terms are highly confusing.
Similarly, what do you do with two or three images? It seems that a
DIV for each can't be the best way ......

Just put the imgs in and style them directly, no need for divs until you
run into some problem that specifically requires them.
How you achieve this in real practice?
e.g. <div id="content">
<div id="imageOne">
<a href......>
</div>
<div>
<style>
#imageOne
{
padding: 20px
}

You need to give more information about the end result you want.

Mar 4 '07 #4

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

Similar topics

2
1668
by: Kirk | last post by:
A very simple question for anyone who knows their HTML tags and attributes. Is there an atribute that I can use to hide the white space around a table which I have used to fill an entire page? ...
2
2246
by: Norman Fritag | last post by:
Hi there, I have a <a href "JavaScript:t('1')"> event that expands and collapse hyperlinks, similar to a treeview (<div>). The webpage is split in Left and right side. The "treeview" resides...
3
2979
by: lostinspace | last post by:
Hello, My sites were created primarily with tables as layout. :-( I have two page designs which I used frequently and hopefully somebody can provide some insight as to whether its best to remain...
12
1736
by: C.W | last post by:
Not sure if I should but this is what I have: 3 x 3 table grid. You click on a square and it places a picture in i using Javascript. Fairly simple stuff, each table <td> has a name attribute...
4
1420
by: Tomas Machala | last post by:
Hi, I'm trying to make an application communicating over TCP/IP. It should do only one thing - write received data to console and terminate itself when "exit" received. Problem is that if I send some...
2
993
by: matt7124 | last post by:
I use Visual C++.NET 2003. I've been reading an older book on C++. One program example shows how to make a simple window and draw a rectangle inside it. At the beginning, they include the...
4
2647
by: Ranginald | last post by:
Sorry for the simple question but thanks in advance: My goal is to create reusale code for a web app in C#. I have written the code already as a windows app but here is where I am confused: ...
0
1242
by: Greg Corradini | last post by:
Hello all, I'm having trouble inserting an SQL selection into a new MS Access table. I get a parameter error on my insert statement when I try this (see below for code and error msg). I'm not sure...
1
1635
by: Richard | last post by:
If you take a look at: http://www.sandiegomft.com you'll see it is simple. I see it as... 1. 100% r .... 2. Left box 33% (photo) Right box (text) ....
0
7227
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,...
0
7391
jinu1996
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...
1
7054
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...
0
7501
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...
0
5633
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,...
0
4713
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...
0
3204
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...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.