Click here to get back home

DIV & CSS style - applied to tag works - using css fails!

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
DIV & CSS style - applied to tag works - using css fails! Frobinrobin 01-24-2007
Get Chitika Premium
Posted by Frobinrobin on January 24, 2007, 6:04 am
Please log in for more thread options


Hi all,

I have this irritating problem. I cannot use tables and I need to
format text in columns.

I decided that DIV would serve the purpose and set about learning a few
properties for them.

When I apply properties to the DIV tag direct, the display is correct.
When I use a CSS stylesheet, the display is incorrect. Please can
someone help / point me in the right direction?

HERE IS MY CODE:


Applied directly to DIV TAG
<div style="background-color:#003366; color: #ffffff; float: left;
position: relative; padding-left: 10px; width: 120px;"><a
href="browse.php">Description</a></div>
<div style="background-color:#003366; color: #ffffff; float: left;
position: relative; padding-left: 10px; width: 30px;"><a
href=\"edit.php">[edit]</a></div>

outputs:

description edit
description edit
description edit


---------------------
Using CSS:

stylesheet:
.make_column {
background-color: #003366;
color: #ffffff;
float: left;
position: relative;
padding-left: 10px;
width: 120px
}

html page:
<div class="make_column"><a href="browse.php">Description</a></div>
<div class="make_column"><a href=\"edit.php">[edit]</a></div>

outputs:


description edit
description edit
description
edit
---------------------------------------------

The results (as you can see) are that when using the stylesheet, the
columns continue on the next HALF line whereas they are in line when
applied direct to the div tag.

I've tried putting an extra div tag which has a width of the two
columns but it does not have the desired effect (I dont think width is
a element of the div tag?)


Any help would be much appreciated! (even if it is to suggest a
different method of making columns than DIV tags)

Regards

Rob


Similar ThreadsPosted
DIV & CSS style - applied to tag works - using css fails! January 24, 2007, 6:01 am
Textarea style not applied on first load November 22, 2007, 4:29 pm
CFP: APPLIED COMPUTING 2007 - Submission Deadline extended October 30, 2006, 12:41 pm
XHTML DOCTYPE breaks JavaScript x.style.top and x.style.left? July 5, 2005, 12:58 pm
Fails on IE?! July 18, 2006, 3:04 pm
The validator fails English check! September 6, 2006, 11:43 pm
XHTML Validation fails with nested block elements. January 10, 2005, 5:38 am
Does it works? March 30, 2005, 12:33 am
Works on Mac. Not PC. Arggh. October 11, 2004, 12:23 pm
mailto works on my machine August 26, 2004, 5:26 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap