473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Table-less design question

I'm trying to do my site without table unless absolutely necessary, and
I've run into a problem I'm not sure how to get around. I have a div
with float:right that contains some images (the outer edges) and a div
sandwiched between two of them. The sandwiched div has a background
image which is to tile based upon it's width. The thing is, divs are
normally set to display:block, which causes it to be placed on it's own
line. If I set it's display to inline, it collapses. Does anyone know a
trick to get around this, or should I just use a table instead?

#middle {float: right;}
#topborder {background-image: url(images/content3.gif); width: 300px;
height: 53px;}

<div id="middle"><img src="images/sign_bottom.gif" alt="Making Homes
Beautiful Since 1992" border="0" /><img src="images/content1.gif" alt=""
border="0" /><div id="topborder"></div><img src="images/content2.gif"
alt="" border="0" /></div>

You can see what I mean at www.aaron-chandler.com, where the site is
hosted temporarily.

Thanks,
Aaron

Jul 20 '05 #1
1 1667
On Fri, 02 Jul 2004 13:48:04 -0700, Aaron <ag********@comcast.not>
wrote:
I'm trying to do my site without table unless absolutely necessary, and
I've run into a problem I'm not sure how to get around. I have a div
with float:right that contains some images (the outer edges) and a div
sandwiched between two of them. The sandwiched div has a background
image which is to tile based upon it's width. The thing is, divs are
normally set to display:block, which causes it to be placed on it's own
line. If I set it's display to inline, it collapses. Does anyone know a
trick to get around this, or should I just use a table instead?

#middle {float: right;}
#topborder {background-image: url(images/content3.gif); width: 300px;
height: 53px;}

<div id="middle"><img src="images/sign_bottom.gif" alt="Making Homes
Beautiful Since 1992" border="0" /><img src="images/content1.gif" alt=""
border="0" /><div id="topborder"></div><img src="images/content2.gif"
alt="" border="0" /></div>


As much as I hate to suggest it, given that your design is completely
based around pixel-oriented images, you might enjoy better luck
abandoning the float approach and instead using CSS positioning with
pixel values to get the images in the right places to fit together.

You can still retain some semblance of dynamic scaling by having, at
the root of the document, a couple of elements with widths specified
in percentages, and then use position:absolute to position the child
images relative to the dynamic boxes. (position:absolute is supposed
to be relative to the containing element, but I seem to remember some
browser bugs in this regard)

Unrelated to your question, I suggest you also try to throw in some
more semantic markup there so that it'll work more nicely for text or
speech browsers. Specifically, only one of your "Making homes
beautiful" images needs alternative text; the rest can just have
alt="". Same for "Coastal Roofing Company". Put the main heading
images inside a <h1> element so that the text is rendered as a
heading. If you can persuade browsers to cooperate, you should also
make your navigation bar some kind of list, such as UL. You can then
use CSS to stop it being a list for graphical browsers:

ul {
list-style: none;
margin: 0;
padding: 0;
}
ul li {
margin: 0;
padding: 0;
}
(although you'll probably want to use some classes or ids there rather
than setting *all* elements)

The best way to see if you've got it right is to load it into Opera
and turn on "User mode" (so it'll ignore your CSS) and turn off image
loading. Any images with alt="" will vanish completely, and others
will be rendered as the surrounding markup dictates, albeit with some
boxes around the images. You will have to ensure that all of your CSS
is in a stylesheet rather than in STYLE attributes, though. You could
also try lynx or links, which are popular text-only browsers.

(Making it nice for non-graphical browsers benefits you because
Google's indexing robot is a non-graphical browser!)

Good luck,
-Claire
Jul 20 '05 #2

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

Similar topics

15
by: Xah Lee | last post by:
Here's the belated Java solution. import java.util.List; import java.util.ArrayList; import java.lang.Math; class math { public static List range(double n) { return range(1,n,1); }
5
by: Jim Garrison | last post by:
Scenario: 1) Create a GLOBAL TEMPORARY table and populate it with one (1) row. 2) Join that table to another with about 1 million rows. The join condition selects a few hundred rows. ...
4
by: Gaz | last post by:
Hi, I need to have a table nested within another table. The tables are alongside each other visually speaking, and the nested table (on the right) can vary in size. My problem is that when the...
3
by: Terrence Brannon | last post by:
I don't know what Postgres considers a relation and had no intention of creating one when piping my schema to it... I always DROP TABLE before CREATE TABLE, so here are the ERRORS emitted when...
4
by: maricel | last post by:
I have the following base table structure - DDL: CREATE TABLE "ADMINISTRATOR"."T1" ( "C1" INTEGER NOT NULL ) IN "TEST_TS" ; ALTER TABLE "ADMINISTRATOR"."T1" ADD PRIMARY KEY
4
by: Simone Battagliero | last post by:
I wrote a program which inserts and finds elements in an hash table. Each element of the table is a dinamic list, which holds all elements having the same hash value (calculated by an int...
76
MMcCarthy
by: MMcCarthy | last post by:
Normalisation is the term used to describe how you break a file down into tables to create a database. There are 3 or 4 major steps involved known as 1NF (First Normal Form), 2NF (Second Normal...
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
12
by: Michael.Z | last post by:
Anyone who can help: Given a Table.h file I am writing a Table.c file. I keep getting the compile error: previous declaration of Table was here / conflicting types for I think the...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...
0
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,...
0
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...
0
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...

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.