473,606 Members | 2,825 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 1889
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*******@gmai l.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...@gmai l.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
1673
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? I have already tried the following which are un-associated with this white space: CellSpacing="0" CellPadding="0"
2
2249
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 on the left and the contents gets displayed on the right side. Everytime the JavaScript:t('1') is clicked the section below is displayed. The text of the JavaScript hyperlink is at the top similar to a header. When I click on the hyperlinks in...
3
2984
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 with tables in CSS or use an alternative. The first page: http://www.mi-harness.com/hof/0a0.html Is part of a frames section, with 17 such pages A-Z. It is my desire to have
12
1745
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 so it can b referenced by Javascript. My question, can this be converted to CSS and more importantly should even bother or would I be better off leaving it as a table?
4
1427
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 string to this application, it'll receive that string and many unwanted "new line" characters on its end. Examle: If I send "some_string" application display
2
996
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 statement: #include "rect.h" to include the corresponding library. But when I build, the compiler doesn't recognize "rect.h" as a library. What is the problem?
4
2655
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: To keep it really easy let's say this is the code: function addition(int, int); int X;
0
1245
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 if 'insert' or 'update' is the route I should be taking. CODE: #Import Pythond Standard Library Modules import win32com.client, sys, os, string, copy, glob import mx.ODBC.Windows as odbc
1
1642
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
8045
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
7981
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
8462
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 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...
0
8320
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
6803
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...
1
5994
isladogs
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...
0
3952
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...
0
4011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2458
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.