PDA

View Full Version : CSS questions (float, width, columns)


bratta
04.02.2002, 16:11
Hey ppl.

I have a couple of questions here.

1. If I have two elements on a page, where one of them (A) has float:right, and the other one (B) width:100%. Should the width of B be 100% - WIDTH_OF_A?

As far as remember the spec it should, and IE actually does that, but Mozilla and Opera makes B width 100% of the entire document and messes it up. But since both of them does that I guess that that's how it supposed to be?

Simple example:
http://www.dhtmlcentral.com/xhtml/100_percentage_example.html

Though I know there are different ways of doing that, I just thought that was nice (if it worked that way that is)

2. If your viewing this site without the coolMenus you'll see a table with the menu choices on the top (news - projects - scripts et cetera), what would be the best way to space them correctly without using tables? I have tried lots of different ways (float, percentage width, percentage margins, inline display et cetera), but I can't seem to find a way that places the "perfectly" in columns.


Thanks,


-Thomas Brattli-
http://www.bratta.com/
http://www.dhtmlcentral.com/

mad hatter
04.02.2002, 16:47
<BLOCKQUOTE id=quote><font size=1 face="Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
1. If I have two elements on a page, where one of them (A) has float:right, and the other
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Arial, Helvetica" size=2 id=quote>

If you float something, it stops taking up that space in the document to a certain degree. If you just floated something inline w/an object that does not have a specified size, then one will cut ino the other. Otherwise, it will show up like it did in Mozilla.

*Note: if you have <?xml..> in your header in IE, it won't turn on standards mode, even w/the XHTML dtd. Sorry. (I'm 99% sure on that one, test it out a bit).

<BLOCKQUOTE id=quote><font size=1 face="Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
2. If your viewing this site without the coolMenus you'll see a table with the menu choices on the top (news - projects - scripts et cetera), what would be the best way to space them correctly without using tables? I have tried lots of different ways (float, percentage width, percentage margins, inline display et cetera), but I can't seem to find a way that places the "perfectly" in columns.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Arial, Helvetica" size=2 id=quote>

If you float and define widths, you should be good to go.

- Dave
<[url="http://www.stilleye.com"]<font color=black>still</font id=black><font color=orange>e</font id=orange><font color=black>ye</font id=black>[/url:kaxyir4hou]>

bratta
04.02.2002, 17:15
<BLOCKQUOTE id=quote><font size=1 face="Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
*Note: if you have <?xml..> in your header in IE, it won't turn on standards mode, even w/the XHTML dtd.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Arial, Helvetica" size=2 id=quote>

It seems like your right. Thanks a lot for pointing that out. I've basically been testing in mozilla so I haven't really noticed.

<BLOCKQUOTE id=quote><font size=1 face="Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
If you float and define widths, you should be good to go.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Arial, Helvetica" size=2 id=quote>

Well yea, but in the old table version I defined different percentage values on each TD to get (almost) the correct space between the elements (because of the different length of the words), I was kind hoping to find a better solution this time.


-Thomas Brattli-
http://www.bratta.com/
http://www.dhtmlcentral.com/