![]() |
DIV Tags in Mozilla
I have been having trouble with DIV tags in Mozilla. I use Mozilla Firefox 0.8 for Windows. I don't have any examples right now, but I test the same page in IE 6.0 and it looks fine.
I have two div tags side-by-side. They each say float: left. The left one is shorter than the right one but I don't want to limit the lengths of either one. The right one says float: left and clear: right. This way, if the contents of it are longer than the left column, it stays seperated into columns. However, what happens is if I put a p tag with a sentence in it, for example, and the text is just slightly longer than the space provided, I expected it to wrap the text, which it does in IE. However, in Mozilla, it moves the entire div tag under the left div tag instead of to the right of it. Then, if it still doesn't fit, it wraps it anyways. I don't know if I explained this too well, but if anyone gets what I am saying, and if you know how to fix that, please let me know. Thanks. |
Re: DIV Tags in Mozilla
Quote:
==EDIT== Could you get the actual code you're using? :) That would help. |
Re: DIV Tags in Mozilla
I doubt this is the reason, but you might as well upgrade firefox to 0.91. Can't hurt (and it might help). Otherwise, post the code, like Texan said.
|
Re: DIV Tags in Mozilla
I don't have code right now to post, but we just tried putting it in a table and that fixed it. I was trying not to use tables, which brings up another question. Someone told me that tables are no longer supported by web standards. Is this true? I rather use div tags, but tables work the same in most browsers, unlike div tags.
|
Re: DIV Tags in Mozilla
Just by looking at arbitrary webpages, you wouldn't know it, but tables are supposed to be in decline. I believe they are deprecated (other methods, like DIV, are preferred over them) in current standards and will be eliminated from standards eventually. If you want some real in depth info, check the official docs: http://www.w3.org/TR/xhtml1/#h-4.1
|
Re: DIV Tags in Mozilla
Tables have never been designed for positioning items on a page, and thus are deprecated for that. Tables are designed for organizing information, and are not deprecated for that use.
Just like you don't type a letter in excel, you shouldn't position things with a table. |
Re: DIV Tags in Mozilla
There's no such thing as "no longer supported by web standards," but the use of tables in a presentational context is deprecated by the community, and is of course misusing a medium for representing tabular data. Often tables are easier to use, but are of course only useful if you intend for your pages to only ever be readable by specific types of browsers on PCs. They destroy the idea of browsing the web from anything other than a PC, and incidentally are slow to render and even slower to load comparatively. That said, table-based layouts will still validate and render as you'd expect in mainstream browsers under typical doctypes. They'll just be perpetually a tad silly. If you're still interested, I'm fairly certain I could fix your problem without the use of tables if you post the source code.
As for div tags, max, they aren't much better. Overuse of divs and spans (which are theoretically for defining divisions not addressed by othe HTML elements) results in semantic nonsense and presentational HTML. The table will be in HTML for the forseeable future, but is simply meant for tabular data, and not as a structural device. |
Re: DIV Tags in Mozilla
I understand the whole content vs presentation thing, I guess I should have wrote about that in my post.
Jonathan, I'm not sure what you mean by "overuse" of divs and spans. What is overuse? Obviously don't make a page more complicated than you need to display how you want it to, but, if I'm not mistaken, divs and spans are what you are intended to use for positioning in a webpage. Use them (in your CSS, of course) till you get the appearance you like. Correct? |
Re: DIV Tags in Mozilla
Quote:
The true overuse of spans and divs occurs when webdesigners try such presentational things as try to nest them within each other to get rounded corners as background-images for example. Sometimes, instead of defining a paragraph as display: block, they'll enclose it in a div which is by default block-level (which means, basically, it's shaped like a block and doesn't flow around other elements like text does). Sometimes they'll use CSS selectors to define rules around any span in an element Code:
p span { font-size:larger; } |
Re: DIV Tags in Mozilla
Quote:
|
Re: DIV Tags in Mozilla
Errr, using <large>, <strong> etc, is fine. In fact, it would be incorrect to use CSS for such a use. You shouldn't create some sorta span to just to bold this word or to italicize this one. The articles you are reading are probably referring to pages where all <p> or all <h1> are additionally <strong> or <large> modified. If you want to bold your headers or your text, do that in CSS.
Another thing you might have read is about <strong> vs <b>. Any html tags that just specify the appearance of something like <b> (bold) or <i> (italicize) should be replaced with tags taht have more semantic meaning like <strong> and <em>. They will appear the same (at least in most mainstream browsers), but will also be usable on all sorts of displays. For example, if it is some sort of html-to-speech browser, you might drop <b> assuming they are just appearance tweaks, but you wouldn't drop <strong> (you might have the broswer read the word with emphasis....errr... that <em> but close enough). (the <large> tag probably falls under html tags like <b> and <i> that are deprecated because I can't think of any english semantic for it other than "display larger") |
Re: DIV Tags in Mozilla
Absolutely right, max. Though I should note, I started a trend when I wrote that last sentence. It's a <big> tag, not a <large> tag. AFAIK, <large> doesn't exist.
|
Re: DIV Tags in Mozilla
Quote:
Quote:
|
Re: DIV Tags in Mozilla
I think that it is still up to web designers to decide whether they want to use all CSS or use some html tags. I also agree that in the situation of a technical paper or any kind of article-type writing, strong and em tags should be used. I think that if you are setting any other CSS properties for the text, then use CSS, otherwise, use the html tags, except for technical papers or whatever where you would always use strong and em so that programs like Jaws, which reads the screen out loud, realizes that it is more important. I realized this when making a website for an organization for the blind and visually handicapped. That is how I did it.
|
Re: DIV Tags in Mozilla
what ever happened to <b> and <i>?
|
| All times are GMT -5. The time now is 20:34. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi