473,387 Members | 1,575 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,387 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 6305
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.