473,322 Members | 1,347 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,322 software developers and data experts.

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

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>

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>
The results (as you will see) are that when using the stylesheet, the
columns continue on the next HALF line resulting in:

description

Jan 24 '07 #1
2 6303
On 24 Jan, 11:01, "Frobinrobin" <frobinro...@hotmail.comwrote:
I cannot use tables and I need to format text in columns.
Of course you can use <table>s if that's what's appropriate.

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?
This is probably some tedious syntax problem that we could solve in
seconds if only you'd told us where the site was. This sort of bug
isn't fixable from snippets though.
HERE IS MY CODE:
We don't care. Give us a URL.

It looks as if the HTML needs changing a little though. You need
different behaviour on the column cells, as the leftmost needs a
clear:left; as well. Using the same class on both makes this hard to
apply.

Jan 24 '07 #2
Frobinrobin wrote:
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>

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>
The results (as you will see) are that when using the stylesheet, the
columns continue on the next HALF line resulting in:

description
For tabular displays (e.g., data in columns), tables might indeed be
okay. However, for creating two parallel columns, see my
<http://www.rossde.com/PGP/pgp_keysign.html>, where both the table of
contents and the lists of cities are in columns formatted via <divand
CSS.

--

David E. Ross
<http://www.rossde.com/>

Concerned about someone (e.g., Pres. Bush) snooping
into your E-mail? Use PGP.
See my <http://www.rossde.com/PGP/>
Jan 24 '07 #3

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

Similar topics

6
by: Michael Rozdoba | last post by:
I've had some trouble getting IE to behave in respect of applying absolute positioning to a span on an a:hover. I can get it to work, but I don't understand why certain code causes it to fail to...
24
by: abracad_1999 | last post by:
I'm told the standards way of referencing page content is document.getElementById() What is the lowest version of each browser type with which this will work? Thank you
27
by: Daniel Vallstrom | last post by:
I'm having problems with inconsistent floating point behavior resulting in e.g. assert( x > 0.0 && putchar('\n') && x == 0.0 ); holding. (Actually, my problem is the dual one where I get...
15
by: Geoff Cox | last post by:
Hello, Can I separately declare and initialize a string array? How and where would I do it in the code below? It was created using Visual C++ 2005 Express Beta 2 ... In C# I would have ...
7
by: Paul Lautman | last post by:
Hi y'all, I found the toggle function (shown below) and applied it to a form of mine. It works fine in IE, but in Firefox it appears to fail on the eval lines. I've searched around but I can't...
0
by: Frobinrobin | last post by:
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....
8
by: marss | last post by:
I want to define style that have to be applied to cells of a specified table but not to any nested tables cells. I use: ..somestyle tbody tr td { background-color:red; } Such construction works...
1
by: abaybas | last post by:
I'm creating a page in which a certain "content" part of the page is refreshed using ajax. I do this by using a div#content, and it's child div#container. the code: ... ...
5
by: Nathan Sokalski | last post by:
I have css that would normally be placed in style tags in the header of the Master page that I want to add programmatically for a specific Web Content Form (the *.aspx page). How do I do this for a...
4
Frinavale
by: Frinavale | last post by:
So a while ago I created a Tab Strip Control (before the AjaxToolkit had theirs otherwise I would have probably just used theirs). When I looked at the AjaxToolkit control to see how they got...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.